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

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


Hi,

attached patch marks some char* variables as const.

Regards,
Stefan

-------------- next part --------------
diff -u codec-cfg.c codec-cfg.c
--- codec-cfg.c	(working copy)
+++ codec-cfg.c	(working copy)
@@ -322,7 +322,7 @@
 static int validate_codec(codecs_t *c, int type)
 {
 	unsigned int i;
-	char *tmp_name = c->name;
+	const char *tmp_name = c->name;
 
 	for (i = 0; i < strlen(tmp_name) && isalnum(tmp_name[i]); i++)
 		/* NOTHING */;
@@ -864,7 +864,7 @@
 		}
 		if(!i) return;
 		for (/* NOTHING */; i--; c++) {
-			char* s="unknown ";
+			const char* s="unknown ";
 			switch(c->status){
 			  case CODECS_STATUS_WORKING:     s="working ";break;
 			  case CODECS_STATUS_PROBLEMS:    s="problems";break;
diff -u mplayer.c mplayer.c
--- mplayer.c	(working copy)
+++ mplayer.c	(working copy)
@@ -370,7 +370,7 @@
 static demux_stream_t *d_video=NULL;
 static demux_stream_t *d_dvdsub=NULL;
 
-char* current_module=NULL; // for debugging
+const char* current_module=NULL; // for debugging
 
 extern int vo_gamma_gamma;
 extern int vo_gamma_brightness;
@@ -1886,7 +1886,7 @@
         }
 #ifdef HAVE_OGGVORBIS
         if (demuxer->type == DEMUXER_TYPE_OGG && d_dvdsub && dvdsub_id >= 0) {
-            char *lang = demux_ogg_sub_lang(demuxer, dvdsub_id);
+            const char *lang = demux_ogg_sub_lang(demuxer, dvdsub_id);
             if (!lang) lang = MSGTR_Unknown;
             snprintf(*(char**)arg, 63, "(%d) %s",
                      dvdsub_id, lang);
--- libmpcodecs/ad_liba52.c	(revision 19117)
+++ libmpcodecs/ad_liba52.c	(working copy)
@@ -91,7 +91,7 @@
 /* returns: number of available channels*/
 static int a52_printinfo(sh_audio_t *sh_audio){
 int flags, sample_rate, bit_rate;
-char* mode="unknown";
+const char* mode="unknown";
 int channels=0;
   a52_syncinfo (sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate);
   switch(flags&A52_CHANNEL_MASK){
--- mplayer.h	(revision 19117)
+++ mplayer.h	(working copy)
@@ -6,7 +6,7 @@
 #include "subreader.h"
 
 extern int use_gui;
-extern char* current_module;
+extern const char* current_module;
 
 extern char * dvd_device;
 extern char * cdrom_device;
--- libmpdemux/aviheader.c	(revision 19117)
+++ libmpdemux/aviheader.c	(working copy)
@@ -67,7 +67,7 @@
   int id=stream_read_dword_le(demuxer->stream);
   unsigned chunksize,size2;
   static int last_fccType=0;
-  char* hdr=NULL;
+  const char* hdr=NULL;
   //
   if(stream_eof(demuxer->stream)) break;
   // Imply -forceidx if -saveidx is specified


More information about the MPlayer-dev-eng mailing list