0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

Mark some constant symbols as such

This commit is contained in:
Uoti Urpala 2008-04-26 16:35:40 +03:00
parent 37e1edee35
commit 05ad815133
16 changed files with 34 additions and 34 deletions

View File

@ -517,7 +517,7 @@ static int mp_property_metadata(m_option_t *prop, int action, void *arg,
MPContext *mpctx) {
m_property_action_t* ka;
char* meta;
static m_option_t key_type =
static const m_option_t key_type =
{ "metadata", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL };
if (!mpctx->demuxer)
return M_PROPERTY_UNAVAILABLE;

View File

@ -578,7 +578,7 @@ static int mp_input_print_key_list(m_option_t* cfg);
static int mp_input_print_cmd_list(m_option_t* cfg);
// Our command line options
static m_option_t input_conf[] = {
static const m_option_t input_conf[] = {
{ "conf", &config_file, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL },
{ "ar-delay", &ar_delay, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL },
{ "ar-rate", &ar_rate, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL },
@ -589,7 +589,7 @@ static m_option_t input_conf[] = {
{ NULL, NULL, 0, 0, 0, 0, NULL}
};
static m_option_t mp_input_opts[] = {
static const m_option_t mp_input_opts[] = {
{ "input", &input_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
{ "nojoystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL },
{ "joystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL },

View File

@ -193,7 +193,7 @@ static int query_format(struct vf_instance* vf, unsigned int fmt){
return 0;
}
static unsigned int fmt_list[]={
static const unsigned int fmt_list[]={
IMGFMT_YV12,
IMGFMT_I420,
IMGFMT_IYUV,
@ -253,7 +253,7 @@ static int open(vf_instance_t *vf, char* args){
}
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
static m_option_t vf_opts_fields[] = {
static const m_option_t vf_opts_fields[] = {
{ "x", ST_OFF(xoff), CONF_TYPE_INT, 0, 0, 0, NULL },
{ "y", ST_OFF(yoff), CONF_TYPE_INT, 0, 0, 0, NULL },
{ "w", ST_OFF(lw), CONF_TYPE_INT, 0, 0, 0, NULL },
@ -263,7 +263,7 @@ static m_option_t vf_opts_fields[] = {
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
static m_struct_t vf_opts = {
static const m_struct_t vf_opts = {
"delogo",
sizeof(struct vf_priv_s),
&vf_priv_dflt,

View File

@ -223,13 +223,13 @@ static int open(vf_instance_t *vf, char* args)
}
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
static m_option_t vf_opts_fields[] = {
static const m_option_t vf_opts_fields[] = {
{"brightness", ST_OFF(brightness), CONF_TYPE_INT, M_OPT_RANGE,-100 ,100, NULL},
{"contrast", ST_OFF(contrast), CONF_TYPE_INT, M_OPT_RANGE,-100 ,100, NULL},
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
static m_struct_t vf_opts = {
static const m_struct_t vf_opts = {
"eq",
sizeof(struct vf_priv_s),
&vf_priv_dflt,

View File

@ -444,7 +444,7 @@ static int open(vf_instance_t *vf, char* args){
}
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
static m_option_t vf_opts_fields[] = {
static const m_option_t vf_opts_fields[] = {
{"w", ST_OFF(exp_w), CONF_TYPE_INT, 0, 0 ,0, NULL},
{"h", ST_OFF(exp_h), CONF_TYPE_INT, 0, 0 ,0, NULL},
{"x", ST_OFF(exp_x), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL},
@ -455,7 +455,7 @@ static m_option_t vf_opts_fields[] = {
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
static m_struct_t vf_opts = {
static const m_struct_t vf_opts = {
"expand",
sizeof(struct vf_priv_s),
&vf_priv_dflt,

View File

@ -74,12 +74,12 @@ static int open(vf_instance_t *vf, char* args){
}
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
static m_option_t vf_opts_fields[] = {
static const m_option_t vf_opts_fields[] = {
{"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
static m_struct_t vf_opts = {
static const m_struct_t vf_opts = {
"format",
sizeof(struct vf_priv_s),
&vf_priv_dflt,

View File

@ -150,7 +150,7 @@ static int open(vf_instance_t *vf, char* args){
if (!eq[2][0]) strncpy(eq[2], eq[1], sizeof(eq[0])-1);
for(plane=0; plane<3; plane++){
static const char *const_names[]={
const char * const const_names[]={
"PI",
"E",
"X",
@ -162,7 +162,7 @@ static int open(vf_instance_t *vf, char* args){
"SH",
NULL
};
static const char *func2_names[]={
const char * const func2_names[]={
"lum",
"cb",
"cr",

View File

@ -168,13 +168,13 @@ static int open(vf_instance_t *vf, char* args)
}
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
static m_option_t vf_opts_fields[] = {
static const m_option_t vf_opts_fields[] = {
{"hue", ST_OFF(hue), CONF_TYPE_FLOAT, M_OPT_RANGE,-180.0 ,180.0, NULL},
{"saturation", ST_OFF(saturation), CONF_TYPE_FLOAT, M_OPT_RANGE,-10.0 ,10.0, NULL},
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
static m_struct_t vf_opts = {
static const m_struct_t vf_opts = {
"hue",
sizeof(struct vf_priv_s),
&vf_priv_dflt,

View File

@ -74,12 +74,12 @@ static int open(vf_instance_t *vf, char* args){
}
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
static m_option_t vf_opts_fields[] = {
static const m_option_t vf_opts_fields[] = {
{"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
static m_struct_t vf_opts = {
static const m_struct_t vf_opts = {
"noformat",
sizeof(struct vf_priv_s),
&vf_priv_dflt,

View File

@ -414,7 +414,7 @@ static void parse(FilterParam *fp, char* args){
if(fp->strength) initNoise(fp);
}
static unsigned int fmt_list[]={
static const unsigned int fmt_list[]={
IMGFMT_YV12,
IMGFMT_I420,
IMGFMT_IYUV,

View File

@ -19,14 +19,14 @@
// routines are incorrrect. they assume the palette to be of the same
// depth as the output, which is incorrect. --Joey
static unsigned int bgr_list[]={
static const unsigned int bgr_list[]={
IMGFMT_BGR32,
IMGFMT_BGR24,
// IMGFMT_BGR16,
// IMGFMT_BGR15,
0
};
static unsigned int rgb_list[]={
static const unsigned int rgb_list[]={
IMGFMT_RGB32,
IMGFMT_RGB24,
// IMGFMT_RGB16,
@ -39,7 +39,7 @@ static unsigned int gray_pal[256];
static unsigned int find_best(struct vf_instance* vf, unsigned int fmt){
unsigned int best=0;
int ret;
unsigned int* p;
const unsigned int* p;
if(fmt==IMGFMT_BGR8) p=bgr_list;
else if(fmt==IMGFMT_RGB8) p=rgb_list;
else return 0;

View File

@ -138,7 +138,7 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
extern int divx_quality;
static unsigned int fmt_list[]={
static const unsigned int fmt_list[]={
IMGFMT_YV12,
IMGFMT_I420,
IMGFMT_IYUV,

View File

@ -65,7 +65,7 @@ static int config(struct vf_instance* vf,
i,
0
};
static const char *const_names[]={
const char * const const_names[]={
"PI",
"E",
"known",

View File

@ -46,7 +46,7 @@ static struct vf_priv_s {
void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam);
static unsigned int outfmt_list[]={
static const unsigned int outfmt_list[]={
// YUV:
IMGFMT_444P,
IMGFMT_422P,
@ -612,7 +612,7 @@ struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat,
}
/// An example of presets usage
static struct size_preset {
static const struct size_preset {
char* name;
int w, h;
} vf_size_presets_defs[] = {
@ -627,21 +627,21 @@ static struct size_preset {
};
#define ST_OFF(f) M_ST_OFF(struct size_preset,f)
static m_option_t vf_size_preset_fields[] = {
static const m_option_t vf_size_preset_fields[] = {
{"w", ST_OFF(w), CONF_TYPE_INT, M_OPT_MIN,1 ,0, NULL},
{"h", ST_OFF(h), CONF_TYPE_INT, M_OPT_MIN,1 ,0, NULL},
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
static m_struct_t vf_size_preset = {
static const m_struct_t vf_size_preset = {
"scale_size_preset",
sizeof(struct size_preset),
NULL,
vf_size_preset_fields
};
static m_struct_t vf_opts;
static m_obj_presets_t size_preset = {
static const m_struct_t vf_opts;
static const m_obj_presets_t size_preset = {
&vf_size_preset, // Input struct desc
&vf_opts, // Output struct desc
vf_size_presets_defs, // The list of presets
@ -651,7 +651,7 @@ static m_obj_presets_t size_preset = {
/// Now the options
#undef ST_OFF
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
static m_option_t vf_opts_fields[] = {
static const m_option_t vf_opts_fields[] = {
{"w", ST_OFF(w), CONF_TYPE_INT, M_OPT_MIN,-11,0, NULL},
{"h", ST_OFF(h), CONF_TYPE_INT, M_OPT_MIN,-11,0, NULL},
{"interlaced", ST_OFF(interlaced), CONF_TYPE_INT, M_OPT_RANGE, 0, 1, NULL},
@ -666,7 +666,7 @@ static m_option_t vf_opts_fields[] = {
{ NULL, NULL, 0, 0, 0, 0, NULL }
};
static m_struct_t vf_opts = {
static const m_struct_t vf_opts = {
"scale",
sizeof(struct vf_priv_s),
&vf_priv_dflt,

View File

@ -262,7 +262,7 @@ static void parse( FilterParam *fp, char* args ) {
//===========================================================================//
static unsigned int fmt_list[] = {
static const unsigned int fmt_list[] = {
IMGFMT_YV12,
IMGFMT_I420,
IMGFMT_IYUV,

View File

@ -61,7 +61,7 @@ m_config_t *m_config_new(void *optstruct,
m_config_t* config;
static int initialized = 0;
static m_option_type_t profile_opt_type;
static m_option_t ref_opts[] = {
static const m_option_t ref_opts[] = {
{ "profile", NULL, &profile_opt_type, CONF_NOSAVE, 0, 0, NULL },
{ "show-profile", show_profile, CONF_TYPE_PRINT_FUNC, CONF_NOCFG, 0, 0, NULL },
{ "list-options", list_options, CONF_TYPE_PRINT_FUNC, CONF_NOCFG, 0, 0, NULL },