From 2ec8252503e00f6f6622011e152952da088fb023 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 26 Feb 2010 17:21:06 +0000 Subject: [PATCH 1/4] Mark vf_opts/vf_opts_fields structures as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30749 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_delogo.c | 4 ++-- libmpcodecs/vf_format.c | 4 ++-- libmpcodecs/vf_hue.c | 4 ++-- libmpcodecs/vf_noformat.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libmpcodecs/vf_delogo.c b/libmpcodecs/vf_delogo.c index 9562478009..7d5dee6fe3 100644 --- a/libmpcodecs/vf_delogo.c +++ b/libmpcodecs/vf_delogo.c @@ -233,7 +233,7 @@ static int vf_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 }, @@ -243,7 +243,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, diff --git a/libmpcodecs/vf_format.c b/libmpcodecs/vf_format.c index 1c0919f69c..fa511e9e79 100644 --- a/libmpcodecs/vf_format.c +++ b/libmpcodecs/vf_format.c @@ -53,12 +53,12 @@ static int vf_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, diff --git a/libmpcodecs/vf_hue.c b/libmpcodecs/vf_hue.c index 6609eae79a..221bee856d 100644 --- a/libmpcodecs/vf_hue.c +++ b/libmpcodecs/vf_hue.c @@ -177,13 +177,13 @@ static int vf_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, diff --git a/libmpcodecs/vf_noformat.c b/libmpcodecs/vf_noformat.c index fdca9b4b1e..f92014f88d 100644 --- a/libmpcodecs/vf_noformat.c +++ b/libmpcodecs/vf_noformat.c @@ -53,12 +53,12 @@ static int vf_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, From 0d7e91b104a88ffce8141135e112d528f5eb299c Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 26 Feb 2010 19:56:03 +0000 Subject: [PATCH 2/4] Mark all fmt_list arrays as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30750 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_delogo.c | 2 +- libmpcodecs/vf_noise.c | 2 +- libmpcodecs/vf_pp.c | 2 +- libmpcodecs/vf_unsharp.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmpcodecs/vf_delogo.c b/libmpcodecs/vf_delogo.c index 7d5dee6fe3..342c88ee59 100644 --- a/libmpcodecs/vf_delogo.c +++ b/libmpcodecs/vf_delogo.c @@ -189,7 +189,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, diff --git a/libmpcodecs/vf_noise.c b/libmpcodecs/vf_noise.c index 4976dc966b..6cddd0912b 100644 --- a/libmpcodecs/vf_noise.c +++ b/libmpcodecs/vf_noise.c @@ -416,7 +416,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, diff --git a/libmpcodecs/vf_pp.c b/libmpcodecs/vf_pp.c index 648d8562eb..2a0c964a90 100644 --- a/libmpcodecs/vf_pp.c +++ b/libmpcodecs/vf_pp.c @@ -159,7 +159,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, diff --git a/libmpcodecs/vf_unsharp.c b/libmpcodecs/vf_unsharp.c index c055ff326e..dd0bec03ff 100644 --- a/libmpcodecs/vf_unsharp.c +++ b/libmpcodecs/vf_unsharp.c @@ -263,7 +263,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, From 38b7648cac09ce9a803335e7d697f7798e12a885 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 26 Feb 2010 19:57:40 +0000 Subject: [PATCH 3/4] Mark character arrays as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30751 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/font_load_ft.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index b27bcac2bf..49c1c764c7 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -84,13 +84,13 @@ static FT_Library library; #define OSD_CHARSET_SIZE 15 -static FT_ULong osd_charset[OSD_CHARSET_SIZE] = +static const FT_ULong osd_charset[OSD_CHARSET_SIZE] = { 0xe001, 0xe002, 0xe003, 0xe004, 0xe005, 0xe006, 0xe007, 0xe008, 0xe009, 0xe00a, 0xe00b, 0xe010, 0xe011, 0xe012, 0xe013 }; -static FT_ULong osd_charcodes[OSD_CHARSET_SIZE] = +static const FT_ULong osd_charcodes[OSD_CHARSET_SIZE] = { 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, 0x09,0x0a,0x0b,0x10,0x11,0x12,0x13 From 89777b1f5703b37f78884644692f3e1ce09076d1 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 26 Feb 2010 20:01:04 +0000 Subject: [PATCH 4/4] cosmetics: Rename "codecs_st" struct to just plain "codecs". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30752 b3059339-0415-0410-9bf9-f77b7e298cf2 --- codec-cfg.h | 2 +- libmpdemux/stheader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codec-cfg.h b/codec-cfg.h index d3a1ae03ab..3522f68a48 100644 --- a/codec-cfg.h +++ b/codec-cfg.h @@ -56,7 +56,7 @@ typedef struct { #endif -typedef struct codecs_st { +typedef struct codecs { unsigned int fourcc[CODECS_MAX_FOURCC]; unsigned int fourccmap[CODECS_MAX_FOURCC]; unsigned int outfmt[CODECS_MAX_OUTFMT]; diff --git a/libmpdemux/stheader.h b/libmpdemux/stheader.h index ae9a13b231..c8624aea3e 100644 --- a/libmpdemux/stheader.h +++ b/libmpdemux/stheader.h @@ -27,7 +27,7 @@ #define SH_COMMON \ demux_stream_t *ds; \ - struct codecs_st *codec; \ + struct codecs *codec; \ unsigned int format; \ int initialized; \ float stream_delay; /* number of seconds stream should be delayed (according to dwStart or similar) */ \