mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 20:32:13 +00:00
Mark several string parameters that are not modified in the function as const.
patch by Stefan Huehner, stefan at huehner org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19086 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
812a300c26
commit
cb2e693d22
@ -54,7 +54,7 @@ extern mixer_t mixer; // mixer from mplayer.c
|
||||
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 @@ char * gstrcat( char ** dest,char * src )
|
||||
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 @@ void gfree( void ** p )
|
||||
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 @@ void gset( char ** str,char * what )
|
||||
/**
|
||||
* \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 @@ void gaddlist( char *** list,char * entry )
|
||||
* \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;
|
||||
|
@ -208,10 +208,10 @@ extern float gtkEquChannels[6][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 ); }
|
||||
|
@ -23,7 +23,7 @@ GtkWidget * AddDialogFrame( GtkWidget * parent )
|
||||
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 @@ GtkWidget * AddFrame( char * title,int type,GtkWidget * parent,int add )
|
||||
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 @@ GtkWidget * AddHBox( GtkWidget * parent,int type )
|
||||
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 @@ GtkWidget * AddCheckButton( char * title, GtkWidget * parent )
|
||||
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 @@ GtkWidget * AddRadioButton( char * title,GSList ** group,GtkWidget * parent )
|
||||
return RB;
|
||||
}
|
||||
|
||||
GtkWidget * AddButton( char * title,GtkWidget * parent )
|
||||
GtkWidget * AddButton( const char * title,GtkWidget * parent )
|
||||
{
|
||||
GtkWidget * B;
|
||||
B=gtk_button_new_with_label( title );
|
||||
|
@ -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 );
|
||||
|
@ -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 );
|
||||
|
@ -8,6 +8,6 @@ extern GtkWidget * gtkMessageBoxText;
|
||||
extern GtkWidget * MessageBox;
|
||||
|
||||
extern GtkWidget * create_MessageBox( int type );
|
||||
extern void ShowMessageBox( char * msg );
|
||||
extern void ShowMessageBox( const char * msg );
|
||||
|
||||
#endif
|
||||
|
@ -70,7 +70,7 @@ void ActivateMenuItem( int Item )
|
||||
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 @@ GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkW
|
||||
|
||||
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 * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidg
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -112,7 +112,7 @@ void gtkEventHandling( void )
|
||||
|
||||
// --- funcs
|
||||
|
||||
void gtkMessageBox( int type,gchar * str )
|
||||
void gtkMessageBox( int type,const gchar * str )
|
||||
{
|
||||
if ( !gtkInited ) return;
|
||||
ShowMessageBox( str );
|
||||
|
@ -54,7 +54,7 @@ extern int gtkFindCList( GtkWidget * list,char * item );
|
||||
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 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user