[MPlayer-cvslog] r19115 - in trunk: 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

reynaldo subversion at mplayerhq.hu
Sun Jul 16 03:40:27 CEST 2006


Author: reynaldo
Date: Sun Jul 16 03:40:24 2006
New Revision: 19115

Modified:
   trunk/Gui/app.h
   trunk/Gui/mplayer/gtk/menu.c
   trunk/Gui/skin/skin.c
   trunk/Gui/wm/wskeys.h
   trunk/input/input.c
   trunk/libmpdemux/demux_ogg.c
   trunk/libmpdemux/extension.c
   trunk/libmpdemux/frequencies.h
   trunk/mplayer.c

Log:
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.



Modified: trunk/Gui/app.h
==============================================================================
--- trunk/Gui/app.h	(original)
+++ trunk/Gui/app.h	Sun Jul 16 03:40:24 2006
@@ -94,7 +94,7 @@
 typedef struct
 {
  int    msg;
- char * name;
+ const char * name;
 } evName;
 
 extern int evBoxs;

Modified: trunk/Gui/mplayer/gtk/menu.c
==============================================================================
--- trunk/Gui/mplayer/gtk/menu.c	(original)
+++ trunk/Gui/mplayer/gtk/menu.c	Sun Jul 16 03:40:24 2006
@@ -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++ )

Modified: trunk/Gui/skin/skin.c
==============================================================================
--- trunk/Gui/skin/skin.c	(original)
+++ trunk/Gui/skin/skin.c	Sun Jul 16 03:40:24 2006
@@ -586,7 +586,7 @@
 
 typedef struct
 {
- char * name;
+ const char * name;
  int  (*func)( char * in );
 } _item;
 

Modified: trunk/Gui/wm/wskeys.h
==============================================================================
--- trunk/Gui/wm/wskeys.h	(original)
+++ trunk/Gui/wm/wskeys.h	Sun Jul 16 03:40:24 2006
@@ -156,7 +156,7 @@
 typedef struct
 {
  int    code;
- char * name;
+ const char * name;
 } TwsKeyNames;
 
 extern TwsKeyNames wsKeyNames[ wsKeyNumber ];

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	(original)
+++ trunk/input/input.c	Sun Jul 16 03:40:24 2006
@@ -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);

Modified: trunk/libmpdemux/demux_ogg.c
==============================================================================
--- trunk/libmpdemux/demux_ogg.c	(original)
+++ trunk/libmpdemux/demux_ogg.c	Sun Jul 16 03:40:24 2006
@@ -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" },

Modified: trunk/libmpdemux/extension.c
==============================================================================
--- trunk/libmpdemux/extension.c	(original)
+++ trunk/libmpdemux/extension.c	Sun Jul 16 03:40:24 2006
@@ -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 },

Modified: trunk/libmpdemux/frequencies.h
==============================================================================
--- trunk/libmpdemux/frequencies.h	(original)
+++ trunk/libmpdemux/frequencies.h	Sun Jul 16 03:40:24 2006
@@ -94,7 +94,7 @@
 };
 
 struct CHANLISTS {
-    char                   *name;
+    const char             *name;
     const struct CHANLIST  *list;
     int                    count;
 };

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Sun Jul 16 03:40:24 2006
@@ -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 },



More information about the MPlayer-cvslog mailing list