summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2007-04-08 01:12:44 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2007-04-08 01:12:44 +0100
commit3a233b827783151c4c08985224782f1dcce43a8f (patch)
tree5377813a1b3369d2700050df921ec0b33426b7f6
parentf12149f0ca2743e6f5f9d39ba53b27c306137597 (diff)
downloadxine-lib-3a233b827783151c4c08985224782f1dcce43a8f.tar.gz
xine-lib-3a233b827783151c4c08985224782f1dcce43a8f.tar.bz2
Mark various private arrays, structs & fn parameters as static and/or const.
Two of the modified files are headers, but each contains definitions as well as declarations and is only ever used once.
-rw-r--r--src/demuxers/demux_iff.c4
-rw-r--r--src/demuxers/demux_qt.c2
-rw-r--r--src/demuxers/iff.h7
-rw-r--r--src/demuxers/qtpalette.h6
-rw-r--r--src/input/input_gnome_vfs.c2
-rw-r--r--src/input/pnm.c6
-rw-r--r--src/input/vcd/xineplug_inp_vcd.c2
-rw-r--r--src/libmpeg2/idct_altivec.c2
-rw-r--r--src/libmpeg2/slice.c2
-rw-r--r--src/libspucc/cc_decoder.c22
-rw-r--r--src/libspudec/xine_spu_decoder.c2
-rw-r--r--src/post/audio/upmix.c2
-rw-r--r--src/post/deinterlace/pulldown.c26
-rw-r--r--src/post/planar/noise.c2
-rw-r--r--src/video_out/video_out_opengl.c4
-rw-r--r--src/video_out/video_out_xxmc.c2
-rw-r--r--src/xine-engine/audio_out.c2
-rw-r--r--src/xine-engine/buffer_types.c4
-rw-r--r--src/xine-engine/configfile.c2
-rw-r--r--src/xine-engine/load_plugins.c2
20 files changed, 52 insertions, 51 deletions
diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c
index cc4df0c85..7ca851718 100644
--- a/src/demuxers/demux_iff.c
+++ b/src/demuxers/demux_iff.c
@@ -148,7 +148,7 @@ typedef struct {
* different decoding deltas
*/
-static int8_t delta_decode_block(int8_t *source, int32_t n, int8_t *dest, int8_t x, int8_t *table) {
+static int8_t delta_decode_block(const int8_t *source, int32_t n, int8_t *dest, int8_t x, const int8_t *table) {
int32_t i;
int lim = n * 2;
@@ -163,7 +163,7 @@ static int8_t delta_decode_block(int8_t *source, int32_t n, int8_t *dest, int8_t
}
/* Decode a complete delta encoded array */
-static void delta_decode(int8_t *dest, int8_t *source, int32_t n, int8_t *table){
+static void delta_decode(int8_t *dest, const int8_t *source, int32_t n, const int8_t *table){
delta_decode_block(&source[2], n-2, dest, source[1], table);
}
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 6693637c7..f837a2272 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -832,7 +832,7 @@ static qt_error parse_trak_atom (qt_trak *trak,
int color_index;
int color_dec;
int color_greyscale;
- unsigned char *color_table;
+ const unsigned char *color_table;
/* initialize trak structure */
trak->edit_list_count = 0;
diff --git a/src/demuxers/iff.h b/src/demuxers/iff.h
index 9d4fb5abe..64f44fd94 100644
--- a/src/demuxers/iff.h
+++ b/src/demuxers/iff.h
@@ -118,7 +118,8 @@
#define HAMBITS_RED 2 /* modify red component */
#define HAMBITS_GREEN 3 /* modify green component */
-int bitplainoffeset[] = { 1, 2, 4, 8,
+static const int bitplainoffeset[] = {
+ 1, 2, 4, 8,
16, 32, 64, 128,
1, 2, 4, 8,
16, 32, 64, 128,
@@ -237,9 +238,9 @@ typedef struct {
#define max_volume 65536 /* Unity = Fixed 1.0 = maximum volume */
-int8_t fibonacci[] = { -34, -21, -13, -8, -5, -3, -2, -1, 0, 1, 2, 3, 5, 8, 13, 21 };
+static const int8_t fibonacci[] = { -34, -21, -13, -8, -5, -3, -2, -1, 0, 1, 2, 3, 5, 8, 13, 21 };
-int8_t exponential[] = { -128, -64, -32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32, 64 };
+static const int8_t exponential[] = { -128, -64, -32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32, 64 };
typedef struct {
uint32_t oneShotHiSamples; /* # samples in the high octave 1-shot part */
diff --git a/src/demuxers/qtpalette.h b/src/demuxers/qtpalette.h
index 18b47c697..a8a44e916 100644
--- a/src/demuxers/qtpalette.h
+++ b/src/demuxers/qtpalette.h
@@ -7,14 +7,14 @@
#ifndef QTPALETTE_H
#define QTPALETTE_H
-unsigned char qt_default_palette_4[4 * 4] = {
+static const unsigned char qt_default_palette_4[4 * 4] = {
0x93, 0x65, 0x5E, 0x00,
0xFF, 0xFF, 0xFF, 0x00,
0xDF, 0xD0, 0xAB, 0x00,
0x00, 0x00, 0x00, 0x00
};
-unsigned char qt_default_palette_16[16 * 4] = {
+static const unsigned char qt_default_palette_16[16 * 4] = {
0xFF, 0xFB, 0xFF, 0x00,
0xEF, 0xD9, 0xBB, 0x00,
0xE8, 0xC9, 0xB1, 0x00,
@@ -33,7 +33,7 @@ unsigned char qt_default_palette_16[16 * 4] = {
0x00, 0x00, 0x00, 0x00
};
-unsigned char qt_default_palette_256[256 * 4] = {
+static const unsigned char qt_default_palette_256[256 * 4] = {
/* 0, 0x00 */ 0xFF, 0xFF, 0xFF, 0x00,
/* 1, 0x01 */ 0xFF, 0xFF, 0xCC, 0x00,
/* 2, 0x02 */ 0xFF, 0xFF, 0x99, 0x00,
diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c
index b9f516931..540abd0f4 100644
--- a/src/input/input_gnome_vfs.c
+++ b/src/input/input_gnome_vfs.c
@@ -304,7 +304,7 @@ gnomevfs_klass_dispose (input_class_t *this_gen)
g_free (this);
}
-static char * ignore_scheme[] = { "cdda", "file", "http" };
+static const char *const ignore_scheme[] = { "cdda", "file", "http" };
static input_plugin_t *
gnomevfs_klass_get_instance (input_class_t *klass_gen, xine_stream_t *stream,
diff --git a/src/input/pnm.c b/src/input/pnm.c
index 432520f6e..cba0aff1f 100644
--- a/src/input/pnm.c
+++ b/src/input/pnm.c
@@ -169,13 +169,13 @@ static const uint32_t pnm_available_bandwidths[]={14400,19200,28800,33600,34430,
115200,262200,393216,524300,1544000,10485800};
#define PNM_TWENTYFOUR_SIZE 16
-static unsigned char pnm_twentyfour[]={
+static const unsigned char pnm_twentyfour[]={
0xd5, 0x42, 0xa3, 0x1b, 0xef, 0x1f, 0x70, 0x24,
0x85, 0x29, 0xb3, 0x8d, 0xba, 0x11, 0xf3, 0xd6 };
/* now other data follows. marked with 0x0000 at the beginning */
-int after_chunks_length=6;
-unsigned char after_chunks[]={
+static const int after_chunks_length=6;
+static const unsigned char after_chunks[]={
0x00, 0x00, /* mark */
0x50, 0x84, /* seems to be fixated */
diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c
index 920b5c1d8..a15899f2d 100644
--- a/src/input/vcd/xineplug_inp_vcd.c
+++ b/src/input/vcd/xineplug_inp_vcd.c
@@ -88,7 +88,7 @@
Convert an autoplay enumeration into an vcdinfo itemtype enumeration.
See definitions in vcdplayer.h and vcdinfo.h to get the below correct.
*/
-vcdinfo_item_enum_t autoplay2itemtype[]={
+static const vcdinfo_item_enum_t autoplay2itemtype[]={
VCDINFO_ITEM_TYPE_TRACK, /* VCDPLAYER_AUTOPLAY_TRACK */
VCDINFO_ITEM_TYPE_ENTRY, /* VCDPLAYER_AUTOPLAY_ENTRY */
VCDINFO_ITEM_TYPE_SEGMENT, /* VCDPLAYER_AUTOPLAY_SEGMENT */
diff --git a/src/libmpeg2/idct_altivec.c b/src/libmpeg2/idct_altivec.c
index ed8b58cfd..895984c45 100644
--- a/src/libmpeg2/idct_altivec.c
+++ b/src/libmpeg2/idct_altivec.c
@@ -148,7 +148,7 @@
#define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) {a, b, c, d, e, f, g, h}
#endif
-static vector_s16_t constants[5] = {
+static const vector_s16_t constants[5] = {
VEC_S16(23170, 13573, 6518, 21895, -23170, -21895, 32, 31),
VEC_S16(16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725),
VEC_S16(22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521),
diff --git a/src/libmpeg2/slice.c b/src/libmpeg2/slice.c
index 8cb5c33b6..91a4c47b1 100644
--- a/src/libmpeg2/slice.c
+++ b/src/libmpeg2/slice.c
@@ -32,7 +32,7 @@
#include "vlc.h"
-static int non_linear_quantizer_scale [] = {
+static const int non_linear_quantizer_scale [] = {
0, 1, 2, 3, 4, 5, 6, 7,
8, 10, 12, 14, 16, 18, 20, 22,
24, 28, 32, 36, 40, 44, 48, 52,
diff --git a/src/libspucc/cc_decoder.c b/src/libspucc/cc_decoder.c
index ba688accf..46ea5c02c 100644
--- a/src/libspucc/cc_decoder.c
+++ b/src/libspucc/cc_decoder.c
@@ -72,7 +72,7 @@ enum { WHITE, GREEN, BLUE, CYAN, RED, YELLOW, MAGENTA, BLACK };
/* color mapping to OSD text color indices */
-static int text_colormap[NUM_FG_COL] = {
+static const int text_colormap[NUM_FG_COL] = {
OSD_TEXT1, OSD_TEXT2, OSD_TEXT3, OSD_TEXT4, OSD_TEXT5, OSD_TEXT6, OSD_TEXT7
};
@@ -91,7 +91,7 @@ typedef struct colorinfo_s {
} colorinfo_t;
-static colorinfo_t cc_text_trans[NUM_FG_COL] = {
+static const colorinfo_t cc_text_trans[NUM_FG_COL] = {
/* white, black border, translucid */
{
CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
@@ -142,7 +142,7 @@ static colorinfo_t cc_text_trans[NUM_FG_COL] = {
}
};
-static colorinfo_t cc_text_solid[NUM_FG_COL] = {
+static const colorinfo_t cc_text_solid[NUM_FG_COL] = {
/* white, black border, solid */
{
CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
@@ -194,21 +194,21 @@ static colorinfo_t cc_text_solid[NUM_FG_COL] = {
};
-static uint8_t cc_text_trans_alpha[TEXT_PALETTE_SIZE] = {
+static const uint8_t cc_text_trans_alpha[TEXT_PALETTE_SIZE] = {
0, 8, 9, 10, 11, 12, 15, 15, 15, 15, 15
};
-static uint8_t cc_text_solid_alpha[TEXT_PALETTE_SIZE] = {
+static const uint8_t cc_text_solid_alpha[TEXT_PALETTE_SIZE] = {
0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15
};
-static colorinfo_t *cc_text_palettes[NUM_CC_PALETTES] = {
+static const colorinfo_t *const cc_text_palettes[NUM_CC_PALETTES] = {
cc_text_trans,
cc_text_solid
};
-static uint8_t *cc_alpha_palettes[NUM_CC_PALETTES] = {
+static const uint8_t *const cc_alpha_palettes[NUM_CC_PALETTES] = {
cc_text_trans_alpha,
cc_text_solid_alpha
};
@@ -221,11 +221,11 @@ static uint8_t *cc_alpha_palettes[NUM_CC_PALETTES] = {
#define MAX(a, b) ((a) > (b)? (a) : (b))
/* mapping from PAC row code to actual CC row */
-static int rowdata[] = {10, -1, 0, 1, 2, 3, 11, 12, 13, 14, 4, 5, 6,
+static const int rowdata[] = {10, -1, 0, 1, 2, 3, 11, 12, 13, 14, 4, 5, 6,
7, 8, 9};
/* FIXME: do real TM */
/* must be mapped as a music note in the captioning font */
-static char specialchar[] = {'®','°','½','¿','T','¢','£','¶','à',
+static const char specialchar[] = {'®','°','½','¿','T','¢','£','¶','à',
TRANSP_SPACE,'è','â','ê','î','ô','û'};
/* character translation table - EIA 608 codes are not all the same as ASCII */
@@ -798,8 +798,8 @@ static void ccmem_exit(cc_memory_t *this)
static void cc_renderer_build_palette(cc_renderer_t *this)
{
int i, j;
- colorinfo_t *cc_text = cc_text_palettes[this->cc_state->cc_cfg->cc_scheme];
- uint8_t *cc_alpha = cc_alpha_palettes[this->cc_state->cc_cfg->cc_scheme];
+ const colorinfo_t *cc_text = cc_text_palettes[this->cc_state->cc_cfg->cc_scheme];
+ const uint8_t *cc_alpha = cc_alpha_palettes[this->cc_state->cc_cfg->cc_scheme];
memset(this->cc_palette, 0, sizeof (this->cc_palette));
memset(this->cc_trans, 0, sizeof (this->cc_trans));
diff --git a/src/libspudec/xine_spu_decoder.c b/src/libspudec/xine_spu_decoder.c
index 30c7f18c9..c98d9e4dd 100644
--- a/src/libspudec/xine_spu_decoder.c
+++ b/src/libspudec/xine_spu_decoder.c
@@ -49,7 +49,7 @@
#define LOG_BUTTON 1
*/
-static clut_t default_clut[] = {
+static const clut_t default_clut[] = {
CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
CLUT_Y_CR_CB_INIT(0x10, 0x80, 0x80),
diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c
index 76c9afe58..975d8b79e 100644
--- a/src/post/audio/upmix.c
+++ b/src/post/audio/upmix.c
@@ -57,7 +57,7 @@ typedef struct{
} biquad_t;
/* S-parameters for designing 4th order Butterworth filter */
-static biquad_t s_param[2] = {{{1.0,0.0,0.0},{1.0,0.765367,1.0}},
+static const biquad_t s_param[2] = {{{1.0,0.0,0.0},{1.0,0.765367,1.0}},
{{1.0,0.0,0.0},{1.0,1.847759,1.0}}};
/* Data for specific instances of this filter */
diff --git a/src/post/deinterlace/pulldown.c b/src/post/deinterlace/pulldown.c
index 41b31d596..cb263ccfb 100644
--- a/src/post/deinterlace/pulldown.c
+++ b/src/post/deinterlace/pulldown.c
@@ -85,19 +85,19 @@
*
*/
-/* Offset 1 2 3 4 5 */
-/* Field Pattern [T B T][B T][B T B] [T B] */
-/* Action Copy Save Merge Copy Copy */
-/* Bot Top */
-int tff_top_pattern[] = { 0, 1, 0, 0, 0 };
-int tff_bot_pattern[] = { 0, 0, 0, 1, 0 };
-
-/* Offset 1 2 3 4 5 */
-/* Field Pattern [B T B][T B][T B T] [B T] */
-/* Action Copy Save Merge Copy Copy */
-/* Top Bot */
-int bff_top_pattern[] = { 0, 0, 0, 1, 0 };
-int bff_bot_pattern[] = { 0, 1, 0, 0, 0 };
+/* Offset 1 2 3 4 5 */
+/* Field Pattern [T B T][B T][B T B] [T B] */
+/* Action Copy Save Merge Copy Copy */
+/* Bot Top */
+static const int tff_top_pattern[] = { 0, 1, 0, 0, 0 };
+static const int tff_bot_pattern[] = { 0, 0, 0, 1, 0 };
+
+/* Offset 1 2 3 4 5 */
+/* Field Pattern [B T B][T B][T B T] [B T] */
+/* Action Copy Save Merge Copy Copy */
+/* Top Bot */
+static const int bff_top_pattern[] = { 0, 0, 0, 1, 0 };
+static const int bff_bot_pattern[] = { 0, 1, 0, 0, 0 };
/* Timestamp mangling */
/* From the DVD : 0 + 3003+ 6006 + 9009+ 12012 = 15015 */
diff --git a/src/post/planar/noise.c b/src/post/planar/noise.c
index 154d5f8cc..a5bf03039 100644
--- a/src/post/planar/noise.c
+++ b/src/post/planar/noise.c
@@ -62,7 +62,7 @@ typedef struct noise_param_t {
static int nonTempRandShift[MAX_RES]= {-1};
-static int patt[4] = {
+static const int patt[4] = {
-1,0,1,0
};
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index b85bd3ccf..a027f2e06 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.c
@@ -966,7 +966,7 @@ static int render_setup_fp_yuv (opengl_driver_t *this) {
* List of render backends
*/
/* name, display, image, setup, needsrgb, defaction, fallback */
-opengl_render_t opengl_rb[] = {
+static const opengl_render_t opengl_rb[] = {
{ "2D_Tex_Fragprog", render_tex2d, render_image_fp_yuv,
render_setup_fp_yuv, 0, RENDER_NONE, 1 },
{ "2D_Tex", render_tex2d, render_image_tex,
@@ -1007,7 +1007,7 @@ static void *render_run (opengl_driver_t *this) {
opengl_frame_t *frame;
struct timeval curtime;
struct timespec timeout;
- opengl_render_t *render;
+ const opengl_render_t *render;
lprintf ("* render thread created\n");
while (1) {
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c
index 0abe2f0fc..fd19f391b 100644
--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -54,7 +54,7 @@ static void dispose_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo,
* is more efficient than VLD.
*/
-static unsigned accel_priority[] = {
+static const unsigned int accel_priority[] = {
#ifdef HAVE_VLDXVMC
XINE_XVMC_ACCEL_VLD,
#endif
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 89fbdde1a..d39c99aba 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -174,7 +174,7 @@ typedef struct {
}sXYData;
-static sIIRCoefficients iir_cf[] = {
+static const sIIRCoefficients iir_cf[] = {
/* 31 Hz*/
{ EQ_REAL(9.9691562441e-01), EQ_REAL(1.5421877947e-03), EQ_REAL(1.9968961468e+00) },
/* 62 Hz*/
diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c
index 2d455b67c..619a34c4c 100644
--- a/src/xine-engine/buffer_types.c
+++ b/src/xine-engine/buffer_types.c
@@ -59,7 +59,7 @@ typedef struct audio_db_s {
} audio_db_t;
-static video_db_t video_db[] = {
+static const video_db_t video_db[] = {
{
{
meFOURCC('m', 'p', 'e', 'g'),
@@ -767,7 +767,7 @@ static video_db_t video_db[] = {
};
-static audio_db_t audio_db[] = {
+static const audio_db_t audio_db[] = {
{
{
0x2000,
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c
index 28b44fd51..ec5f5c856 100644
--- a/src/xine-engine/configfile.c
+++ b/src/xine-engine/configfile.c
@@ -51,7 +51,7 @@ typedef struct {
const char *new;
} config_entry_translation_t;
-static config_entry_translation_t config_entry_translation[] = {
+static const config_entry_translation_t config_entry_translation[] = {
{ "audio.a52_pass_through", "" },
{ "audio.alsa_a52_device", "audio.device.alsa_passthrough_device" },
{ "audio.alsa_default_device", "audio.device.alsa_default_device" },
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index d35eba736..c72241487 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -96,7 +96,7 @@ static void remove_segv_handler(void){
#endif /* 0 */
-static int plugin_iface_versions[] = {
+static const int plugin_iface_versions[] = {
INPUT_PLUGIN_IFACE_VERSION,
DEMUXER_PLUGIN_IFACE_VERSION,
AUDIO_DECODER_IFACE_VERSION,