Mercurial > mplayer.hg
changeset 19110:08888397444e
marks several strings inside structs as const when they hold just
read-only information and modifies GetLanguage in Gui/mplayer/gtk/menu.c
to cope which the changes.
author | reynaldo |
---|---|
date | Sun, 16 Jul 2006 01:40:24 +0000 |
parents | 6e840952870d |
children | 3630818b288e |
files | Gui/app.h Gui/mplayer/gtk/menu.c Gui/skin/skin.c Gui/wm/wskeys.h input/input.c libmpdemux/demux_ogg.c libmpdemux/extension.c libmpdemux/frequencies.h mplayer.c |
diffstat | 9 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/Gui/app.h Sun Jul 16 01:24:42 2006 +0000 +++ b/Gui/app.h Sun Jul 16 01:40:24 2006 +0000 @@ -94,7 +94,7 @@ typedef struct { int msg; - char * name; + const char * name; } evName; extern int evBoxs;
--- a/Gui/mplayer/gtk/menu.c Sun Jul 16 01:24:42 2006 +0000 +++ b/Gui/mplayer/gtk/menu.c Sun Jul 16 01:40:24 2006 +0000 @@ -182,7 +182,7 @@ typedef struct { int id; - char * name; + const char * name; } Languages_t; #define lng( a,b ) ( (int)(a) * 256 + b ) @@ -369,7 +369,7 @@ { "","Stereo","","","","5.1" }; #endif -char * GetLanguage( int language ) +const char * GetLanguage( int language ) { unsigned int i; for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ )
--- a/Gui/skin/skin.c Sun Jul 16 01:24:42 2006 +0000 +++ b/Gui/skin/skin.c Sun Jul 16 01:40:24 2006 +0000 @@ -586,7 +586,7 @@ typedef struct { - char * name; + const char * name; int (*func)( char * in ); } _item;
--- a/Gui/wm/wskeys.h Sun Jul 16 01:24:42 2006 +0000 +++ b/Gui/wm/wskeys.h Sun Jul 16 01:40:24 2006 +0000 @@ -156,7 +156,7 @@ typedef struct { int code; - char * name; + const char * name; } TwsKeyNames; extern TwsKeyNames wsKeyNames[ wsKeyNumber ];
--- a/input/input.c Sun Jul 16 01:24:42 2006 +0000 +++ b/input/input.c Sun Jul 16 01:40:24 2006 +0000 @@ -1671,7 +1671,7 @@ static int mp_input_print_cmd_list(m_option_t* cfg) { mp_cmd_t *cmd; int i,j; - char* type; + const char* type; for(i = 0; (cmd = &mp_cmds[i])->name != NULL ; i++) { printf("%-20.20s",cmd->name);
--- a/libmpdemux/demux_ogg.c Sun Jul 16 01:24:42 2006 +0000 +++ b/libmpdemux/demux_ogg.c Sun Jul 16 01:40:24 2006 +0000 @@ -463,13 +463,13 @@ /// Try to print out comments and also check for LANGUAGE= tag static void demux_ogg_check_comments(demuxer_t *d, ogg_stream_t *os, int id, vorbis_comment *vc) { - char *hdr, *val; + const char *hdr, *val; char **cmt = vc->user_comments; int index, i; ogg_demuxer_t *ogg_d = (ogg_demuxer_t *)d->priv; struct table { - char *ogg; - char *mp; + const char *ogg; + const char *mp; } table[] = { { "ENCODED_USING", "Software" }, { "ENCODER_URL", "Encoder URL" },
--- a/libmpdemux/extension.c Sun Jul 16 01:24:42 2006 +0000 +++ b/libmpdemux/extension.c Sun Jul 16 01:40:24 2006 +0000 @@ -12,7 +12,7 @@ * An autodetection based on the extension is not a good idea, but we don't care ;-) */ static struct { - char *extension; + const char *extension; int demuxer_type; } extensions_table[] = { // { "mpeg", DEMUXER_TYPE_MPEG_PS },
--- a/libmpdemux/frequencies.h Sun Jul 16 01:24:42 2006 +0000 +++ b/libmpdemux/frequencies.h Sun Jul 16 01:40:24 2006 +0000 @@ -94,7 +94,7 @@ }; struct CHANLISTS { - char *name; + const char *name; const struct CHANLIST *list; int count; };
--- a/mplayer.c Sun Jul 16 01:24:42 2006 +0000 +++ b/mplayer.c Sun Jul 16 01:40:24 2006 +0000 @@ -2290,7 +2290,7 @@ /// List of the commands that can be handled by setting a property. static struct { /// property name - char* name; + const char* name; /// cmd id int cmd; /// set/adjust or toggle command @@ -2300,7 +2300,7 @@ /// osd msg id if it must be shared int osd_id; /// osd msg template - char* osd_msg; + const char* osd_msg; } set_prop_cmd[] = { // audio { "volume", MP_CMD_VOLUME, 0, OSD_VOLUME, -1, MSGTR_Volume },