# HG changeset patch # User reynaldo # Date 1153014024 0 # Node ID 08888397444e3658b76a6819e61020bdf7beb326 # Parent 6e840952870d822b155feb542878b1729d5f2c47 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. diff -r 6e840952870d -r 08888397444e Gui/app.h --- 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; diff -r 6e840952870d -r 08888397444e Gui/mplayer/gtk/menu.c --- 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;iname != NULL ; i++) { printf("%-20.20s",cmd->name); diff -r 6e840952870d -r 08888397444e libmpdemux/demux_ogg.c --- 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" }, diff -r 6e840952870d -r 08888397444e libmpdemux/extension.c --- 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 }, diff -r 6e840952870d -r 08888397444e libmpdemux/frequencies.h --- 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; }; diff -r 6e840952870d -r 08888397444e mplayer.c --- 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 },