[MPlayer-dev-eng] [patch] type-correctness in (Gui/*)

Stefan Huehner stefan at huehner.org
Fri Jun 16 23:22:27 CEST 2006


Hi,

attached patch add (mostly) const to variable and parameter declaration,
where a char* was used and and 'const char*' should be. Additionally
some function declarations are made static if they aren't used outside
its declaring source file.
Only files under the Gui directory are affected by this patch.

Please review and consider for inclusion.

Regards,
Stefan
-------------- next part --------------
Index: Gui/interface.c
===================================================================
--- Gui/interface.c	(revision 18731)
+++ Gui/interface.c	(working copy)
@@ -54,7 +54,7 @@
 guiInterface_t guiIntfStruct;
 int guiWinID=-1;
 
-char * gstrcat( char ** dest,char * src )
+char * gstrcat( char ** dest,const char * src )
 {
  char * tmp = NULL;
 
@@ -75,21 +75,21 @@
  return tmp;
 }
 
-int gstrcmp( char * a,char * b )
+int gstrcmp( const char * a,const char * b )
 {
  if ( !a && !b ) return 0;
  if ( !a || !b ) return -1;
  return strcmp( a,b );
 }
 
-int gstrncmp( char * a,char * b,int size )
+int gstrncmp( const char * a,const char * b,int size )
 {
  if ( !a && !b ) return 0;
  if ( !a || !b ) return -1;
  return strncmp( a,b,size );
 }
 
-char * gstrdup( char * str )
+char * gstrdup( const char * str )
 {
  if ( !str ) return NULL;
  return strdup( str );
@@ -107,7 +107,7 @@
  free( *p ); *p=NULL;
 }
 
-void gset( char ** str,char * what )
+void gset( char ** str,char * const what )
 {
  if ( *str ) { if ( !strstr( *str,what ) ) { gstrcat( str,"," ); gstrcat( str,what ); }}
    else gstrcat( str,what );
@@ -116,7 +116,7 @@
 /**
  * \brief this actually creates a new list containing only one element...
  */
-void gaddlist( char *** list,char * entry )
+void gaddlist( char *** list,const char * entry )
 {
  int i;
 
@@ -135,7 +135,7 @@
  * \brief this replaces a string starting with search by replace.
  * If not found, replace is appended.
  */
-void greplace(char ***list, char *search, char *replace)
+void greplace(char ***list, const char *search, const char *replace)
 {
  int i = 0;
  int len = (search) ? strlen(search) : 0;
Index: Gui/wm/wsxdnd.c
===================================================================
--- Gui/wm/wsxdnd.c	(revision 18731)
+++ Gui/wm/wsxdnd.c	(working copy)
@@ -29,7 +29,7 @@
 
 Atom atom_support;
 
-void wsXDNDInitialize()
+void wsXDNDInitialize(void)
 {
 
     _XA_XdndAware = XInternAtom(wsDisplay, "XdndAware", False);
Index: Gui/wm/wskeys.h
===================================================================
--- Gui/wm/wskeys.h	(revision 18731)
+++ Gui/wm/wskeys.h	(working copy)
@@ -156,7 +156,7 @@
 typedef struct
 {
  int    code;
- char * name;
+ const char * name;
 } TwsKeyNames;
 
 extern TwsKeyNames wsKeyNames[ wsKeyNumber ];
Index: Gui/wm/wsxdnd.h
===================================================================
--- Gui/wm/wsxdnd.h	(revision 18731)
+++ Gui/wm/wsxdnd.h	(working copy)
@@ -3,7 +3,7 @@
 #define _XDND_H_
 
 
-void wsXDNDInitialize();
+void wsXDNDInitialize(void);
 Bool wsXDNDProcessSelection(wsTWindow* wnd,XEvent *event);
 Bool wsXDNDProcessClientMessage(wsTWindow* wnd, XClientMessageEvent *event);
 void wsXDNDMakeAwareness(wsTWindow* window);
Index: Gui/skin/skin.c
===================================================================
--- Gui/skin/skin.c	(revision 18731)
+++ Gui/skin/skin.c	(working copy)
@@ -586,7 +586,7 @@
 
 typedef struct
 {
- char * name;
+ const char * name;
  int  (*func)( char * in );
 } _item;
 
Index: Gui/app.h
===================================================================
--- Gui/app.h	(revision 18731)
+++ Gui/app.h	(working copy)
@@ -94,7 +94,7 @@
 typedef struct
 {
  int    msg;
- char * name;
+ const char * name;
 } evName;
 
 extern int evBoxs;
Index: Gui/interface.h
===================================================================
--- Gui/interface.h	(revision 18731)
+++ Gui/interface.h	(working copy)
@@ -208,10 +208,10 @@
 extern void * gtkSet( int cmd,float param, void * vparam );
 
 extern char * gconvert_uri_to_filename( char * str );
-extern char * gstrdup( char * str );
-extern int    gstrcmp( char * a,char * b );
+extern char * gstrdup( const char * str );
+extern int    gstrcmp( const char * a,const char * b );
 extern void   gfree( void ** p );
-extern void   gaddlist( char *** list,char * entry );
+extern void   gaddlist( char *** list,const char * entry );
 extern char * gstrchr( char * str,int c );
 
 #define guiSetFilename( s,n ) { gfree( (void **)&s ); s=gstrdup( n ); }
Index: Gui/mplayer/pixmaps/dvd.xpm
===================================================================
--- Gui/mplayer/pixmaps/dvd.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/dvd.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * dvd_xpm[] = {
+static const char * dvd_xpm[] = {
 "16 16 110 2",
 "  	c None",
 ". 	c #CACCD2",
Index: Gui/mplayer/pixmaps/next.xpm
===================================================================
--- Gui/mplayer/pixmaps/next.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/next.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * next_xpm[] = {
+static const char * next_xpm[] = {
 "16 16 60 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/aspect.xpm
===================================================================
--- Gui/mplayer/pixmaps/aspect.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/aspect.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * aspect_xpm[] = {
+static const char * aspect_xpm[] = {
 "16 16 3 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/title.xpm
===================================================================
--- Gui/mplayer/pixmaps/title.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/title.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * title_xpm[] = {
+static const char * title_xpm[] = {
 "16 16 4 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/stop.xpm
===================================================================
--- Gui/mplayer/pixmaps/stop.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/stop.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * stop_xpm[] = {
+static const char * stop_xpm[] = {
 "48 48 203 2",
 "  	c None",
 ". 	c #5A5A5A",
Index: Gui/mplayer/pixmaps/chapter.xpm
===================================================================
--- Gui/mplayer/pixmaps/chapter.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/chapter.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * chapter_xpm[] = {
+static const char * chapter_xpm[] = {
 "16 16 4 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/empty1px.xpm
===================================================================
--- Gui/mplayer/pixmaps/empty1px.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/empty1px.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * empty1px_xpm[] = {
+static const char * empty1px_xpm[] = {
 "1 1 1 1",
 " 	c None",
 " "};
Index: Gui/mplayer/pixmaps/a43.xpm
===================================================================
--- Gui/mplayer/pixmaps/a43.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/a43.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * a43_xpm[] = {
+static const char * a43_xpm[] = {
 "18 16 3 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/sound.xpm
===================================================================
--- Gui/mplayer/pixmaps/sound.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/sound.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * sound_xpm[] = {
+static const char * sound_xpm[] = {
 "16 16 121 2",
 "  	c None",
 ". 	c #939CA9",
Index: Gui/mplayer/pixmaps/loadeaf.xpm
===================================================================
--- Gui/mplayer/pixmaps/loadeaf.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/loadeaf.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * loadeaf_xpm[] = {
+static const char * loadeaf_xpm[] = {
 "16 16 132 2",
 "  	c None",
 ". 	c #5C5C5C",
Index: Gui/mplayer/pixmaps/empty.xpm
===================================================================
--- Gui/mplayer/pixmaps/empty.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/empty.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * empty_xpm[] = {
+static const char * empty_xpm[] = {
 "16 16 1 1",
 " 	c None",
 "                ",
Index: Gui/mplayer/pixmaps/logo.xpm
===================================================================
--- Gui/mplayer/pixmaps/logo.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/logo.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * logo_xpm[] = {
+static const char * logo_xpm[] = {
 "101 83 1141 2",
 "  	c None",
 ". 	c #9094BB",
Index: Gui/mplayer/pixmaps/file2.xpm
===================================================================
--- Gui/mplayer/pixmaps/file2.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/file2.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * file2_xpm[] = {
+static const char * file2_xpm[] = {
 "16 16 8 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/url.xpm
===================================================================
--- Gui/mplayer/pixmaps/url.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/url.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * url_xpm[] = {
+static const char * url_xpm[] = {
 "16 16 2 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/playdvd.xpm
===================================================================
--- Gui/mplayer/pixmaps/playdvd.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/playdvd.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * playdvd_xpm[] = {
+static const char * playdvd_xpm[] = {
 "16 16 118 2",
 "  	c None",
 ". 	c #CACCD2",
Index: Gui/mplayer/pixmaps/play.xpm
===================================================================
--- Gui/mplayer/pixmaps/play.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/play.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * play_xpm[] = {
+static const char * play_xpm[] = {
 "16 16 37 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/question.xpm
===================================================================
--- Gui/mplayer/pixmaps/question.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/question.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * question_xpm[] = {
+static const char * question_xpm[] = {
 "48 48 284 2",
 "  	c None",
 ". 	c #9B4C3A",
Index: Gui/mplayer/pixmaps/fs.xpm
===================================================================
--- Gui/mplayer/pixmaps/fs.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/fs.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * fs_xpm[] = {
+static const char * fs_xpm[] = {
 "16 16 90 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/half.xpm
===================================================================
--- Gui/mplayer/pixmaps/half.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/half.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * half_xpm[] = {
+static const char * half_xpm[] = {
 "16 16 125 2",
 "  	c None",
 ". 	c #000000",
Index: Gui/mplayer/pixmaps/double.xpm
===================================================================
--- Gui/mplayer/pixmaps/double.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/double.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * double_xpm[] = {
+static const char * double_xpm[] = {
 "16 16 132 2",
 "  	c None",
 ". 	c #000000",
Index: Gui/mplayer/pixmaps/pl.xpm
===================================================================
--- Gui/mplayer/pixmaps/pl.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/pl.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * pl_xpm[] = {
+static const char * pl_xpm[] = {
 "16 16 7 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/prev.xpm
===================================================================
--- Gui/mplayer/pixmaps/prev.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/prev.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * prev_xpm[] = {
+static const char * prev_xpm[] = {
 "16 16 58 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/vcd.xpm
===================================================================
--- Gui/mplayer/pixmaps/vcd.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/vcd.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * vcd_xpm[] = {
+static const char * vcd_xpm[] = {
 "16 16 160 2",
 "  	c None",
 ". 	c #CC9665",
Index: Gui/mplayer/pixmaps/pause.xpm
===================================================================
--- Gui/mplayer/pixmaps/pause.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/pause.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * pause_xpm[] = {
+static const char * pause_xpm[] = {
 "16 16 29 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/delsub.xpm
===================================================================
--- Gui/mplayer/pixmaps/delsub.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/delsub.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * delsub_xpm[] = {
+static const char * delsub_xpm[] = {
 "16 16 3 1",
 " 	c None",
 ".	c #CD0909",
Index: Gui/mplayer/pixmaps/prefs.xpm
===================================================================
--- Gui/mplayer/pixmaps/prefs.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/prefs.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * prefs_xpm[] = {
+static const char * prefs_xpm[] = {
 "16 16 50 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/mplayer-desktop.xpm
===================================================================
--- Gui/mplayer/pixmaps/mplayer-desktop.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/mplayer-desktop.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * mplayer_desktop_xpm[] = {
+static const char * mplayer_desktop_xpm[] = {
 "47 39 107 2",
 "  	c None",
 ". 	c #6D619F",
Index: Gui/mplayer/pixmaps/a169.xpm
===================================================================
--- Gui/mplayer/pixmaps/a169.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/a169.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * a169_xpm[] = {
+static const char * a169_xpm[] = {
 "18 16 3 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/tonguebla.xpm
===================================================================
--- Gui/mplayer/pixmaps/tonguebla.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/tonguebla.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * tonguebla_xpm[] = {
+static const char * tonguebla_xpm[] = {
 "16 16 137 2",
 "  	c None",
 ". 	c #FC151B",
Index: Gui/mplayer/pixmaps/a11.xpm
===================================================================
--- Gui/mplayer/pixmaps/a11.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/a11.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * a11_xpm[] = {
+static const char * a11_xpm[] = {
 "18 16 3 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/ab.xpm
===================================================================
--- Gui/mplayer/pixmaps/ab.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/ab.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * ab_xpm[] = {
+static const char * ab_xpm[] = {
 "16 16 15 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/cancel.xpm
===================================================================
--- Gui/mplayer/pixmaps/cancel.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/cancel.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * cancel_xpm[] = {
+static const char * cancel_xpm[] = {
 "55 16 120 2",
 "  	c None",
 ". 	c #786663",
Index: Gui/mplayer/pixmaps/normal.xpm
===================================================================
--- Gui/mplayer/pixmaps/normal.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/normal.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * normal_xpm[] = {
+static const char * normal_xpm[] = {
 "16 16 111 2",
 "  	c None",
 ". 	c #000000",
Index: Gui/mplayer/pixmaps/icon.xpm
===================================================================
--- Gui/mplayer/pixmaps/icon.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/icon.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * icon_xpm[] = {
+static const char * icon_xpm[] = {
 "64 64 256 2",
 "  	c None",
 ". 	c #060606",
Index: Gui/mplayer/pixmaps/sub.xpm
===================================================================
--- Gui/mplayer/pixmaps/sub.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/sub.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * sub_xpm[] = {
+static const char * sub_xpm[] = {
 "16 16 2 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/open.xpm
===================================================================
--- Gui/mplayer/pixmaps/open.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/open.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * open_xpm[] = {
+static const char * open_xpm[] = {
 "16 16 64 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/tongue.xpm
===================================================================
--- Gui/mplayer/pixmaps/tongue.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/tongue.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * tongue_xpm[] = {
+static const char * tongue_xpm[] = {
 "16 16 150 2",
 "  	c None",
 ". 	c #FC151B",
Index: Gui/mplayer/pixmaps/playvcd.xpm
===================================================================
--- Gui/mplayer/pixmaps/playvcd.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/playvcd.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * playvcd_xpm[] = {
+static const char * playvcd_xpm[] = {
 "16 16 182 2",
 "  	c None",
 ". 	c #CC9665",
Index: Gui/mplayer/pixmaps/skin.xpm
===================================================================
--- Gui/mplayer/pixmaps/skin.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/skin.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * skin_xpm[] = {
+static const char * skin_xpm[] = {
 "16 16 162 2",
 "  	c None",
 ". 	c #DBA97F",
Index: Gui/mplayer/pixmaps/eq.xpm
===================================================================
--- Gui/mplayer/pixmaps/eq.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/eq.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * eq_xpm[] = {
+static const char * eq_xpm[] = {
 "16 16 16 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/stop2.xpm
===================================================================
--- Gui/mplayer/pixmaps/stop2.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/stop2.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * stop2_xpm[] = {
+static const char * stop2_xpm[] = {
 "16 16 29 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/ok.xpm
===================================================================
--- Gui/mplayer/pixmaps/ok.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/ok.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * ok_xpm[] = {
+static const char * ok_xpm[] = {
 "37 16 5 1",
 " 	c None",
 ".	c #3539EC",
Index: Gui/mplayer/pixmaps/exit.xpm
===================================================================
--- Gui/mplayer/pixmaps/exit.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/exit.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * exit_xpm[] = {
+static const char * exit_xpm[] = {
 "16 16 63 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/dolby.xpm
===================================================================
--- Gui/mplayer/pixmaps/dolby.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/dolby.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * dolby_xpm[] = {
+static const char * dolby_xpm[] = {
 "16 11 9 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/pixmaps/a235.xpm
===================================================================
--- Gui/mplayer/pixmaps/a235.xpm	(revision 18731)
+++ Gui/mplayer/pixmaps/a235.xpm	(working copy)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * a235_xpm[] = {
+static const char * a235_xpm[] = {
 "18 16 3 1",
 " 	c None",
 ".	c #000000",
Index: Gui/mplayer/gtk/mb.c
===================================================================
--- Gui/mplayer/gtk/mb.c	(revision 18731)
+++ Gui/mplayer/gtk/mb.c	(working copy)
@@ -13,7 +13,7 @@
 GtkWidget * gtkMessageBoxText;
 GtkWidget * MessageBox = NULL;
 
-void ShowMessageBox( char * msg )
+void ShowMessageBox( const char * msg )
 {
  if ( MessageBox ) { gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); }
  MessageBox=create_MessageBox( 0 );
Index: Gui/mplayer/gtk/mb.h
===================================================================
--- Gui/mplayer/gtk/mb.h	(revision 18731)
+++ Gui/mplayer/gtk/mb.h	(working copy)
@@ -8,6 +8,6 @@
 extern GtkWidget * MessageBox;
 
 extern GtkWidget * create_MessageBox( int type );
-extern void ShowMessageBox( char * msg );
+extern void ShowMessageBox( const char * msg );
 
 #endif
Index: Gui/mplayer/gtk/menu.c
===================================================================
--- Gui/mplayer/gtk/menu.c	(revision 18731)
+++ Gui/mplayer/gtk/menu.c	(working copy)
@@ -62,7 +62,7 @@
 
 extern mixer_t mixer; // mixer from mplayer.c
 
-void ActivateMenuItem( int Item )
+static void ActivateMenuItem( int Item )
 {
 // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 );
  gtkPopupMenu=Item & 0x0000ffff;
@@ -70,7 +70,7 @@
  mplEventHandling( Item & 0x0000ffff,Item >> 16 );
 }
 
-GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,char* label, gboolean state, int Number)
+static GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,const char* label, gboolean state, int Number)
 {
  GtkWidget * Label = NULL;
  GtkWidget * Pixmap = NULL;
@@ -103,7 +103,7 @@
    
  return Item;
 }
-GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm,  GtkWidget * SubMenu,char * label,int Number )
+GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm,  GtkWidget * SubMenu,const char * label,int Number )
 {
  GtkWidget * Label = NULL;
  GtkWidget * Pixmap = NULL;
@@ -136,7 +136,7 @@
 }
 
 
-GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,char * label )
+GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,const char * label )
 {
  GtkWidget * Label = NULL;
  GtkWidget * Pixmap = NULL;
@@ -182,7 +182,7 @@
 typedef struct
 {
  int id;
- char * name;
+ const char * name;
 } Languages_t;
 
 #define lng( a,b ) ( (int)(a) * 256 + b )
@@ -363,13 +363,13 @@
 #undef lng
 
 #ifdef USE_DVDREAD
-static char * ChannelTypes[] =
+static const char * ChannelTypes[] =
 	{ "Dolby Digital","","Mpeg1","Mpeg2","PCM","","Digital Theatre System" };
-static char * ChannelNumbers[] =
+static const char * ChannelNumbers[] =
 	{ "","Stereo","","","","5.1" };
 #endif
 
-char * GetLanguage( int language )
+static const char * GetLanguage( int language )
 {
  unsigned int i;
  for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ )
Index: Gui/mplayer/gtk/menu.h
===================================================================
--- Gui/mplayer/gtk/menu.h	(revision 18731)
+++ Gui/mplayer/gtk/menu.h	(working copy)
@@ -5,8 +5,8 @@
 
 extern GtkWidget * DVDSubMenu;
 
-extern GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm,  GtkWidget * SubMenu,char * label,int Number );
-extern GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,char * label );
+extern GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm,  GtkWidget * SubMenu,const char * label,int Number );
+extern GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,const char * label );
 extern GtkWidget * AddSeparator( GtkWidget * Menu );
 extern GtkWidget * create_PopUpMenu( void );
 
Index: Gui/mplayer/gtk/common.c
===================================================================
--- Gui/mplayer/gtk/common.c	(revision 18731)
+++ Gui/mplayer/gtk/common.c	(working copy)
@@ -23,7 +23,7 @@
  return frame;
 }
 
-GtkWidget * AddFrame( char * title,int type,GtkWidget * parent,int add )
+GtkWidget * AddFrame( const char * title,int type,GtkWidget * parent,int add )
 {
  GtkWidget * frame = NULL;
  frame=gtk_frame_new( title );
@@ -36,7 +36,7 @@
  return frame;
 }
 
-GtkWidget * AddLabel( char * title,GtkWidget * parent )
+GtkWidget * AddLabel( const char * title,GtkWidget * parent )
 {
  GtkWidget * label;
  label=gtk_label_new( title );
@@ -76,7 +76,7 @@
  return hbox;
 }
 
-GtkWidget * AddCheckButton( char * title, GtkWidget * parent )
+GtkWidget * AddCheckButton( const char * title, GtkWidget * parent )
 {
  GtkWidget * CB;
  CB=gtk_check_button_new_with_label( title );
@@ -86,7 +86,7 @@
  return CB;
 }
 
-GtkWidget * AddRadioButton( char * title,GSList ** group,GtkWidget * parent )
+GtkWidget * AddRadioButton( const char * title,GSList ** group,GtkWidget * parent )
 {
  GtkWidget * RB;
  RB=gtk_radio_button_new_with_label( *group,title );
@@ -97,7 +97,7 @@
  return RB;
 }
 
-GtkWidget * AddButton( char * title,GtkWidget * parent )
+GtkWidget * AddButton( const char * title,GtkWidget * parent )
 {
  GtkWidget * B;
  B=gtk_button_new_with_label( title );
Index: Gui/mplayer/gtk/common.h
===================================================================
--- Gui/mplayer/gtk/common.h	(revision 18731)
+++ Gui/mplayer/gtk/common.h	(working copy)
@@ -6,13 +6,13 @@
 #include <gtk/gtk.h>
 
 extern GtkWidget * AddDialogFrame( GtkWidget * parent );
-extern GtkWidget * AddFrame( char * title,int type,GtkWidget * parent,int add );
-extern GtkWidget * AddLabel( char * title,GtkWidget * parent );
+extern GtkWidget * AddFrame( const char * title,int type,GtkWidget * parent,int add );
+extern GtkWidget * AddLabel( const char * title,GtkWidget * parent );
 extern GtkWidget * AddVBox( GtkWidget * parent,int type );
 extern GtkWidget * AddHBox( GtkWidget * parent,int type );
-extern GtkWidget * AddCheckButton( char * title, GtkWidget * parent );
-extern GtkWidget * AddRadioButton( char * title,GSList ** group,GtkWidget * parent );
-extern GtkWidget * AddButton( char * title,GtkWidget * parent );
+extern GtkWidget * AddCheckButton( const char * title, GtkWidget * parent );
+extern GtkWidget * AddRadioButton( const char * title,GSList ** group,GtkWidget * parent );
+extern GtkWidget * AddButton( const char * title,GtkWidget * parent );
 extern GtkWidget * AddHSeparator( GtkWidget * parent );
 extern GtkWidget * AddHButtonBox( GtkWidget * parent );
 extern GtkWidget * AddHScaler( GtkAdjustment * adj,GtkWidget * parent,int digit );
Index: Gui/mplayer/widgets.c
===================================================================
--- Gui/mplayer/widgets.c	(revision 18731)
+++ Gui/mplayer/widgets.c	(working copy)
@@ -112,7 +112,7 @@
 
 // --- funcs
 
-void gtkMessageBox( int type,gchar * str )
+void gtkMessageBox( int type,const gchar * str )
 {
  if ( !gtkInited ) return;
  ShowMessageBox( str );
Index: Gui/mplayer/widgets.h
===================================================================
--- Gui/mplayer/widgets.h	(revision 18731)
+++ Gui/mplayer/widgets.h	(working copy)
@@ -54,7 +54,7 @@
 extern void gtkEventHandling( void );
 
 extern void gtkShow( int type,char * param );
-extern void gtkMessageBox( int type,gchar * str );
+extern void gtkMessageBox( int type,const gchar * str );
 extern void gtkSetLayer( GtkWidget * wdg );
 extern void gtkActive( GtkWidget * wdg );
 


More information about the MPlayer-dev-eng mailing list