[MPlayer-dev-eng] [patch] more const

Stefan Huehner stefan at huehner.org
Sun Jul 16 19:16:26 CEST 2006


On Sun, Jul 16, 2006 at 07:15:22PM +0200, Stefan Huehner wrote:
> Hi,
> 
> attached patch marks some read-only string parameters as const.

now with patch

-------------- next part --------------
--- Gui/cfg.c	(revision 19117)
+++ Gui/cfg.c	(working copy)
@@ -79,7 +79,7 @@
 extern int    flip;
 extern int    frame_dropping;
 extern int    stop_xscreensaver;
-extern int    m_config_parse_config_file(m_config_t* config, char *conffile);
+extern int    m_config_parse_config_file(m_config_t* config, const char *conffile);
 
 static m_config_t * gui_conf;
 static m_option_t gui_opts[] =
--- Gui/win32/wincfg.c	(revision 19117)
+++ Gui/win32/wincfg.c	(working copy)
@@ -53,7 +53,7 @@
 /* External functions */
 extern int frame_dropping;
 extern char *proc_priority;
-extern int m_config_parse_config_file(m_config_t *config, char *conffile);
+extern int m_config_parse_config_file(m_config_t *config, const char *conffile);
 
 static m_config_t *gui_conf;
 static m_option_t gui_opts[] =
--- Gui/mplayer/gtk/fs.c	(revision 19117)
+++ Gui/mplayer/gtk/fs.c	(working copy)
@@ -133,7 +133,7 @@
 GdkBitmap   * dmask;
 GdkBitmap   * fmask;
 
-static char * Filter( char * name )
+static char * Filter( const char * name )
 {
  static char tmp[32];
  int  i,c;
--- codec-cfg.c	(revision 19117)
+++ codec-cfg.c	(working copy)
@@ -817,7 +817,7 @@
 	return NULL;
 }
 
-void select_codec(char* codecname,int audioflag){
+void select_codec(const char* codecname,int audioflag){
 	int i;
 	codecs_t *c;
 //	printf("select_codec('%s')\n",codecname);
--- codec-cfg.h	(revision 19117)
+++ codec-cfg.h	(working copy)
@@ -65,7 +65,7 @@
                            codecs_t *start, int force);
 codecs_t* find_codec(unsigned int fourcc, unsigned int *fourccmap,
                      codecs_t *start, int audioflag, int force);
-void select_codec(char* codecname,int audioflag);
+void select_codec(const char* codecname,int audioflag);
 void list_codecs(int audioflag);
 void codecs_reset_selection(int audioflag);
 void codecs_uninit_free(void);
--- asxparser.c	(revision 19117)
+++ asxparser.c	(working copy)
@@ -106,7 +106,7 @@
 }
 
 static void
-asx_warning_attrib_invalid(ASX_Parser_t* parser, char* elem, char* attrib,
+asx_warning_attrib_invalid(ASX_Parser_t* parser, const char* elem, const char* attrib,
 			   char** valid_vals,const char* val) {
   char *str,*vals,**ptr;
   int len;
--- parser-cfg.c	(revision 19117)
+++ parser-cfg.c	(working copy)
@@ -34,7 +34,7 @@
  *  \param conffile Path to the config file.
  *  \return 1 on sucess, -1 on error.
  */
-int m_config_parse_config_file(m_config_t* config, char *conffile)
+int m_config_parse_config_file(m_config_t* config, const char *conffile)
 {
 #define PRINT_LINENUM	mp_msg(MSGT_CFGPARSER,MSGL_V,"%s(%d): ", conffile, line_num)
 #define MAX_LINE_LEN	10000
--- mplayer.c	(revision 19117)
+++ mplayer.c	(working copy)
@@ -146,7 +146,7 @@
 extern play_tree_t*
 m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv);
 extern int
-m_config_parse_config_file(m_config_t* config, char *conffile);
+m_config_parse_config_file(m_config_t* config, const char *conffile);
 
 //**************************************************************************//
 //             Config file
--- m_config.c	(revision 19117)
+++ m_config.c	(working copy)
@@ -262,7 +262,7 @@
 }
 
 static m_config_option_t* 
-m_config_get_co(m_config_t *config, char* arg) {
+m_config_get_co(m_config_t *config, const char* arg) {
   m_config_option_t *co;
 
   for(co = config->opts ; co ; co = co->next ) {
--- mencoder.c	(revision 19117)
+++ mencoder.c	(working copy)
@@ -241,7 +241,7 @@
 
 m_config_t* mconfig;
 
-extern int m_config_parse_config_file(m_config_t* config, char *conffile);
+extern int m_config_parse_config_file(m_config_t* config, const char *conffile);
 
 static int cfg_inc_verbose(m_option_t *conf){ ++verbose; return 0;}
 


More information about the MPlayer-dev-eng mailing list