summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-16 01:40:24 +0000
committerreynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-16 01:40:24 +0000
commit15e8c12de234ddd93366def38b807567928fbb40 (patch)
tree6736b2a829cd66460dcc765391e3296ab646196a
parentca57bf90332aa59bba3385fa13cff139b7a20295 (diff)
downloadmpv-15e8c12de234ddd93366def38b807567928fbb40.tar.bz2
mpv-15e8c12de234ddd93366def38b807567928fbb40.tar.xz
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19115 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--Gui/app.h2
-rw-r--r--Gui/mplayer/gtk/menu.c4
-rw-r--r--Gui/skin/skin.c2
-rw-r--r--Gui/wm/wskeys.h2
-rw-r--r--input/input.c2
-rw-r--r--libmpdemux/demux_ogg.c6
-rw-r--r--libmpdemux/extension.c2
-rw-r--r--libmpdemux/frequencies.h2
-rw-r--r--mplayer.c4
9 files changed, 13 insertions, 13 deletions
diff --git a/Gui/app.h b/Gui/app.h
index 49e9a81bb5..293ed7e30e 100644
--- a/Gui/app.h
+++ b/Gui/app.h
@@ -94,7 +94,7 @@
typedef struct
{
int msg;
- char * name;
+ const char * name;
} evName;
extern int evBoxs;
diff --git a/Gui/mplayer/gtk/menu.c b/Gui/mplayer/gtk/menu.c
index 401f95ea7c..35d2883eda 100644
--- a/Gui/mplayer/gtk/menu.c
+++ b/Gui/mplayer/gtk/menu.c
@@ -182,7 +182,7 @@ GtkWidget * AddSeparator( GtkWidget * Menu )
typedef struct
{
int id;
- char * name;
+ const char * name;
} Languages_t;
#define lng( a,b ) ( (int)(a) * 256 + b )
@@ -369,7 +369,7 @@ static char * ChannelNumbers[] =
{ "","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++ )
diff --git a/Gui/skin/skin.c b/Gui/skin/skin.c
index 123af0944c..852d3bdab6 100644
--- a/Gui/skin/skin.c
+++ b/Gui/skin/skin.c
@@ -586,7 +586,7 @@ int cmd_decoration( char * in )
typedef struct
{
- char * name;
+ const char * name;
int (*func)( char * in );
} _item;
diff --git a/Gui/wm/wskeys.h b/Gui/wm/wskeys.h
index b1438af92f..830aecbc39 100644
--- a/Gui/wm/wskeys.h
+++ b/Gui/wm/wskeys.h
@@ -156,7 +156,7 @@
typedef struct
{
int code;
- char * name;
+ const char * name;
} TwsKeyNames;
extern TwsKeyNames wsKeyNames[ wsKeyNumber ];
diff --git a/input/input.c b/input/input.c
index 4b1afa3214..2da5353bfa 100644
--- a/input/input.c
+++ b/input/input.c
@@ -1671,7 +1671,7 @@ static int mp_input_print_key_list(m_option_t* cfg) {
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);
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index e997fb562b..f521e4ca42 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -463,13 +463,13 @@ static int demux_ogg_sub_reverse_id(demuxer_t *demuxer, int id);
/// 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 --git a/libmpdemux/extension.c b/libmpdemux/extension.c
index a75134db3e..df1fb2b368 100644
--- a/libmpdemux/extension.c
+++ b/libmpdemux/extension.c
@@ -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 --git a/libmpdemux/frequencies.h b/libmpdemux/frequencies.h
index f1fd806544..13cf111f44 100644
--- a/libmpdemux/frequencies.h
+++ b/libmpdemux/frequencies.h
@@ -94,7 +94,7 @@ struct CHANLIST {
};
struct CHANLISTS {
- char *name;
+ const char *name;
const struct CHANLIST *list;
int count;
};
diff --git a/mplayer.c b/mplayer.c
index f3b2a318cf..dbe8b2759e 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2290,7 +2290,7 @@ int mp_property_do(const char* name,int action, void* val) {
/// 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 @@ static struct {
/// 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 },