[MPlayer-dev-eng] [patch] make some char* const in structs

Stefan Huehner stefan at huehner.org
Sun Jul 16 16:44:09 CEST 2006


Hi,

attached patch marks some apparently read-only 'char*' inside structs as const.

Regards,
Stefan

-------------- next part --------------
--- m_option.c	(revision 19117)
+++ m_option.c	(working copy)
@@ -996,7 +996,7 @@
 
 /* FIXME: snyc with img_format.h */
 static struct {
-  char* name;
+  const char* name;
   unsigned int fmt;
 } mp_imgfmt_list[] = {
   {"444p", IMGFMT_444P},
@@ -1090,7 +1090,7 @@
 
 /* FIXME: snyc with af_format.h */
 static struct {
-  char* name;
+  const char* name;
   unsigned int fmt;
 } mp_afmt_list[] = {
   // SPECIAL
--- libvo/gl_common.c	(revision 19117)
+++ libvo/gl_common.c	(working copy)
@@ -89,7 +89,7 @@
 
 struct gl_name_map_struct {
   GLint value;
-  char *name;
+  const char *name;
 };
 
 #undef MAP
@@ -253,8 +253,8 @@
 
 typedef struct {
   void **funcptr;
-  char *extstr;
-  char *funcnames[7];
+  const char *extstr;
+  const char *funcnames[7];
 } extfunc_desc_t;
 
 static const extfunc_desc_t extfuncs[] = {
@@ -883,7 +883,7 @@
 }
 
 static const struct {
-  char *name;
+  const char *name;
   GLenum cur;
   GLenum max;
 } progstats[] = {
--- subopt-helper.h	(revision 19117)
+++ subopt-helper.h	(working copy)
@@ -20,7 +20,7 @@
 /** simple structure for defining the option name, type and storage location */
 typedef struct opt_s
 {
-  char * name; ///< string that identifies the option
+  const char * name; ///< string that identifies the option
   int type;    ///< option type as defined in subopt-helper.h
   void * valp; ///< pointer to the mem where the value should be stored
   opt_test_f test; ///< argument test func ( optional )
--- m_struct.h	(revision 19117)
+++ m_struct.h	(working copy)
@@ -13,7 +13,7 @@
 /// Struct definition
 typedef struct m_struct_st {
   /// For error messages and debugging
-  char* name;
+  const char* name;
   /// size of the whole struct
   unsigned int size;
   /// Pointer to a struct filled with the default settings
--- libmpdemux/network.h	(revision 19117)
+++ libmpdemux/network.h	(working copy)
@@ -26,7 +26,7 @@
 #define BUFFER_SIZE		2048
 
 typedef struct {
-	char *mime_type;
+	const char *mime_type;
 	int demuxer_type;
 } mime_struct_t;
 


More information about the MPlayer-dev-eng mailing list