diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-04-30 23:18:39 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-04-30 23:18:39 +0000 |
commit | 5d830c85ae1d9138701e83aed2aab82515d9cc47 (patch) | |
tree | 489ca5f33f974bbf245846f8af489c578e04cdca /sys | |
parent | 3ec12cb286c481a24373d2b10c209086fd13f5f5 (diff) |
constify a few structs
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/bktr/bktr_core.c | 32 | ||||
-rw-r--r-- | sys/dev/pci/bktr/bktr_tuner.c | 24 |
2 files changed, 28 insertions, 28 deletions
diff --git a/sys/dev/pci/bktr/bktr_core.c b/sys/dev/pci/bktr/bktr_core.c index b88e10792d5..5e7b6a24d6c 100644 --- a/sys/dev/pci/bktr/bktr_core.c +++ b/sys/dev/pci/bktr/bktr_core.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bktr_core.c,v 1.4 2002/03/14 03:16:06 millert Exp $ */ +/* $OpenBSD: bktr_core.c,v 1.5 2002/04/30 23:18:38 mickey Exp $ */ /* $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.114 2000/10/31 13:09:56 roger Exp $ */ /* @@ -283,7 +283,7 @@ typedef u_char bool_t; * Parameters describing size of transmitted image. */ -static struct format_params format_params[] = { +static const struct format_params format_params[] = { /* # define BT848_IFORM_F_AUTO (0x0) - don't matter. */ { 525, 26, 480, 910, 135, 754, 640, 780, 30, 0x68, 0x5d, BT848_IFORM_X_AUTO, 12, 1600 }, @@ -314,7 +314,7 @@ static struct format_params format_params[] = { * Table of supported Pixel Formats */ -static struct meteor_pixfmt_internal { +static const struct meteor_pixfmt_internal { struct meteor_pixfmt public; u_int color_fmt; } pixfmt_table[] = { @@ -343,7 +343,7 @@ static struct meteor_pixfmt_internal { */ /* FIXME: Also add YUV_422 and YUV_PACKED as well */ -static struct { +static const struct { u_long meteor_format; struct meteor_pixfmt public; } meteor_pixfmt_table[] = { @@ -2633,7 +2633,7 @@ static bool_t split(bktr_reg_t * bktr, volatile u_long **dma_prog, int width , volatile u_char ** target_buffer, int cols ) { u_long flag, flag2; - struct meteor_pixfmt *pf = &pixfmt_table[ bktr->pixfmt ].public; + const struct meteor_pixfmt *pf = &pixfmt_table[ bktr->pixfmt ].public; u_int skip, start_skip; /* For RGB24, we need to align the component in FIFO Byte Lane 0 */ @@ -2723,7 +2723,7 @@ rgb_vbi_prog( bktr_ptr_t bktr, char i_flag, int cols, int rows, int interlace ) volatile u_long *dma_prog; /* DMA prog is an array of 32 bit RISC instructions */ volatile u_long *loop_point; - struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; + const struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; u_int Bpp = pf_int->public.Bpp; unsigned int vbisamples; /* VBI samples per line */ unsigned int vbilines; /* VBI lines per field */ @@ -2903,7 +2903,7 @@ rgb_prog( bktr_ptr_t bktr, char i_flag, int cols, int rows, int interlace ) volatile u_long target_buffer, buffer, target,width; volatile u_long pitch; volatile u_long *dma_prog; - struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; + const struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; u_int Bpp = pf_int->public.Bpp; OUTB(bktr, BKTR_COLOR_FMT, pf_int->color_fmt); @@ -3067,7 +3067,7 @@ yuvpack_prog( bktr_ptr_t bktr, char i_flag, volatile unsigned int inst3; volatile u_long target_buffer, buffer; volatile u_long *dma_prog; - struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; + const struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; int b; OUTB(bktr, BKTR_COLOR_FMT, pf_int->color_fmt); @@ -3181,7 +3181,7 @@ yuv422_prog( bktr_ptr_t bktr, char i_flag, volatile unsigned int inst; volatile u_long target_buffer, t1, buffer; volatile u_long *dma_prog; - struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; + const struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; OUTB(bktr, BKTR_COLOR_FMT, pf_int->color_fmt); @@ -3295,7 +3295,7 @@ yuv12_prog( bktr_ptr_t bktr, char i_flag, volatile unsigned int inst1; volatile u_long target_buffer, t1, buffer; volatile u_long *dma_prog; - struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; + const struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; OUTB(bktr, BKTR_COLOR_FMT, pf_int->color_fmt); @@ -3403,8 +3403,8 @@ build_dma_prog( bktr_ptr_t bktr, char i_flag ) int rows, cols, interlace; int tmp_int; unsigned int temp; - struct format_params *fp; - struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; + const struct format_params *fp; + const struct meteor_pixfmt_internal *pf_int = &pixfmt_table[ bktr->pixfmt ]; fp = &format_params[bktr->format_params]; @@ -3610,7 +3610,7 @@ static void start_capture( bktr_ptr_t bktr, unsigned type ) { u_char i_flag; - struct format_params *fp; + const struct format_params *fp; fp = &format_params[bktr->format_params]; @@ -3668,7 +3668,7 @@ start_capture( bktr_ptr_t bktr, unsigned type ) static void set_fps( bktr_ptr_t bktr, u_short fps ) { - struct format_params *fp; + const struct format_params *fp; int i_flag; fp = &format_params[bktr->format_params]; @@ -3720,7 +3720,7 @@ set_fps( bktr_ptr_t bktr, u_short fps ) static u_int pixfmt_swap_flags( int pixfmt ) { - struct meteor_pixfmt *pf = &pixfmt_table[ pixfmt ].public; + const struct meteor_pixfmt *pf = &pixfmt_table[ pixfmt ].public; u_int swapf = 0; switch ( pf->Bpp ) { @@ -3749,7 +3749,7 @@ static u_int pixfmt_swap_flags( int pixfmt ) static int oformat_meteor_to_bt( u_long format ) { int i; - struct meteor_pixfmt *pf1, *pf2; + const struct meteor_pixfmt *pf1, *pf2; /* Find format in compatibility table */ for ( i = 0; i < METEOR_PIXFMT_TABLE_SIZE; i++ ) diff --git a/sys/dev/pci/bktr/bktr_tuner.c b/sys/dev/pci/bktr/bktr_tuner.c index e4b2fd3c998..5d9b657f960 100644 --- a/sys/dev/pci/bktr/bktr_tuner.c +++ b/sys/dev/pci/bktr/bktr_tuner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bktr_tuner.c,v 1.1 2001/03/28 03:27:10 fgsch Exp $ */ +/* $OpenBSD: bktr_tuner.c,v 1.2 2002/04/30 23:18:38 mickey Exp $ */ /* $FreeBSD: src/sys/dev/bktr/bktr_tuner.c,v 1.9 2000/10/19 07:33:28 roger Exp $ */ /* @@ -315,7 +315,7 @@ static const struct TUNER tuners[] = { * IF freq: 45.75 mHz */ #define OFFSET 6.00 -static int nabcst[] = { +static const int nabcst[] = { 83, (int)( 45.75 * FREQFACTOR), 0, 14, (int)(471.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), 7, (int)(175.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), @@ -338,7 +338,7 @@ static int nabcst[] = { * IF freq: 45.75 mHz */ #define OFFSET 6.00 -static int irccable[] = { +static const int irccable[] = { 116, (int)( 45.75 * FREQFACTOR), 0, 100, (int)(649.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), 95, (int)( 91.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), @@ -364,7 +364,7 @@ static int irccable[] = { * IF freq: 45.75 mHz */ #define OFFSET 6.00 -static int hrccable[] = { +static const int hrccable[] = { 116, (int)( 45.75 * FREQFACTOR), 0, 100, (int)(648.00 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), 95, (int)( 90.00 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), @@ -520,7 +520,7 @@ static int hrccable[] = { * 121 3890 000 IFFREQ * */ -static int weurope[] = { +static const int weurope[] = { 121, (int)( 38.90 * FREQFACTOR), 0, 100, (int)(303.25 * FREQFACTOR), (int)(8.00 * FREQFACTOR), 90, (int)(231.25 * FREQFACTOR), (int)(7.00 * FREQFACTOR), @@ -550,7 +550,7 @@ static int weurope[] = { */ #define OFFSET 6.00 #define IF_FREQ 45.75 -static int jpnbcst[] = { +static const int jpnbcst[] = { 62, (int)(IF_FREQ * FREQFACTOR), 0, 13, (int)(471.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), 8, (int)(193.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), @@ -575,7 +575,7 @@ static int jpnbcst[] = { */ #define OFFSET 6.00 #define IF_FREQ 45.75 -static int jpncable[] = { +static const int jpncable[] = { 63, (int)(IF_FREQ * FREQFACTOR), 0, 23, (int)(223.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), 22, (int)(165.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), @@ -606,7 +606,7 @@ static int jpncable[] = { * IF freq: 38.90 MHz */ #define IF_FREQ 38.90 -static int xussr[] = { +static const int xussr[] = { 107, (int)(IF_FREQ * FREQFACTOR), 0, 78, (int)(231.25 * FREQFACTOR), (int)(8.00 * FREQFACTOR), 70, (int)(111.25 * FREQFACTOR), (int)(8.00 * FREQFACTOR), @@ -624,7 +624,7 @@ static int xussr[] = { */ #define OFFSET 7.00 #define IF_FREQ 38.90 -static int australia[] = { +static const int australia[] = { 83, (int)(IF_FREQ * FREQFACTOR), 0, 28, (int)(527.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), 10, (int)(209.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), @@ -642,7 +642,7 @@ static int australia[] = { */ #define OFFSET 8.00 #define IF_FREQ 38.90 -static int france[] = { +static const int france[] = { 69, (int)(IF_FREQ * FREQFACTOR), 0, 21, (int)(471.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), /* 21 -> 69 */ 5, (int)(176.00 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), /* 5 -> 10 */ @@ -654,8 +654,8 @@ static int france[] = { #undef OFFSET #undef IF_FREQ -static struct { - int *ptr; +static const struct { + const int *ptr; char name[BT848_MAX_CHNLSET_NAME_LEN]; } freqTable[] = { {NULL, ""}, |