[MPlayer-cvslog] r19086 - in trunk/Gui: interface.c interface.h mplayer/gtk/common.c mplayer/gtk/common.h mplayer/gtk/mb.c mplayer/gtk/mb.h mplayer/gtk/menu.c mplayer/gtk/menu.h mplayer/widgets.c mplayer/widgets.h

diego subversion at mplayerhq.hu
Fri Jul 14 18:57:25 CEST 2006


Author: diego
Date: Fri Jul 14 18:57:24 2006
New Revision: 19086

Modified:
   trunk/Gui/interface.c
   trunk/Gui/interface.h
   trunk/Gui/mplayer/gtk/common.c
   trunk/Gui/mplayer/gtk/common.h
   trunk/Gui/mplayer/gtk/mb.c
   trunk/Gui/mplayer/gtk/mb.h
   trunk/Gui/mplayer/gtk/menu.c
   trunk/Gui/mplayer/gtk/menu.h
   trunk/Gui/mplayer/widgets.c
   trunk/Gui/mplayer/widgets.h

Log:
Mark several string parameters that are not modified in the function as const.
patch by Stefan Huehner, stefan at huehner org


Modified: trunk/Gui/interface.c
==============================================================================
--- trunk/Gui/interface.c	(original)
+++ trunk/Gui/interface.c	Fri Jul 14 18:57:24 2006
@@ -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, const char * 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;

Modified: trunk/Gui/interface.h
==============================================================================
--- trunk/Gui/interface.h	(original)
+++ trunk/Gui/interface.h	Fri Jul 14 18:57:24 2006
@@ -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 ); }

Modified: trunk/Gui/mplayer/gtk/common.c
==============================================================================
--- trunk/Gui/mplayer/gtk/common.c	(original)
+++ trunk/Gui/mplayer/gtk/common.c	Fri Jul 14 18:57:24 2006
@@ -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 );

Modified: trunk/Gui/mplayer/gtk/common.h
==============================================================================
--- trunk/Gui/mplayer/gtk/common.h	(original)
+++ trunk/Gui/mplayer/gtk/common.h	Fri Jul 14 18:57:24 2006
@@ -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 );

Modified: trunk/Gui/mplayer/gtk/mb.c
==============================================================================
--- trunk/Gui/mplayer/gtk/mb.c	(original)
+++ trunk/Gui/mplayer/gtk/mb.c	Fri Jul 14 18:57:24 2006
@@ -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 );

Modified: trunk/Gui/mplayer/gtk/mb.h
==============================================================================
--- trunk/Gui/mplayer/gtk/mb.h	(original)
+++ trunk/Gui/mplayer/gtk/mb.h	Fri Jul 14 18:57:24 2006
@@ -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

Modified: trunk/Gui/mplayer/gtk/menu.c
==============================================================================
--- trunk/Gui/mplayer/gtk/menu.c	(original)
+++ trunk/Gui/mplayer/gtk/menu.c	Fri Jul 14 18:57:24 2006
@@ -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;

Modified: trunk/Gui/mplayer/gtk/menu.h
==============================================================================
--- trunk/Gui/mplayer/gtk/menu.h	(original)
+++ trunk/Gui/mplayer/gtk/menu.h	Fri Jul 14 18:57:24 2006
@@ -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 );
 

Modified: trunk/Gui/mplayer/widgets.c
==============================================================================
--- trunk/Gui/mplayer/widgets.c	(original)
+++ trunk/Gui/mplayer/widgets.c	Fri Jul 14 18:57:24 2006
@@ -112,7 +112,7 @@
 
 // --- funcs
 
-void gtkMessageBox( int type,gchar * str )
+void gtkMessageBox( int type,const gchar * str )
 {
  if ( !gtkInited ) return;
  ShowMessageBox( str );

Modified: trunk/Gui/mplayer/widgets.h
==============================================================================
--- trunk/Gui/mplayer/widgets.h	(original)
+++ trunk/Gui/mplayer/widgets.h	Fri Jul 14 18:57:24 2006
@@ -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-cvslog mailing list