[MPlayer-cvslog] r25257 - in trunk: m_option.c m_option.h

reimar subversion at mplayerhq.hu
Sun Dec 2 16:56:38 CET 2007


Author: reimar
Date: Sun Dec  2 16:56:38 2007
New Revision: 25257

Log:
Option print functions may not and do not modify value


Modified:
   trunk/m_option.c
   trunk/m_option.h

Modified: trunk/m_option.c
==============================================================================
--- trunk/m_option.c	(original)
+++ trunk/m_option.c	Sun Dec  2 16:56:38 2007
@@ -114,7 +114,7 @@ static int parse_flag(const m_option_t* 
   }
 }
 
-static char* print_flag(const m_option_t* opt,  void* val) {
+static char* print_flag(const m_option_t* opt,  const void* val) {
   if(VAL(val) == opt->min)
     return strdup("no");
   else
@@ -167,7 +167,7 @@ static int parse_int(const m_option_t* o
   return 1;
 }
 
-static char* print_int(const m_option_t* opt,  void* val) {
+static char* print_int(const m_option_t* opt,  const void* val) {
   opt = NULL;
   return dup_printf("%d",VAL(val));
 }
@@ -239,7 +239,7 @@ static int parse_double(const m_option_t
   return 1;
 }
 
-static char* print_double(const m_option_t* opt,  void* val) {
+static char* print_double(const m_option_t* opt,  const void* val) {
   opt = NULL;
   return dup_printf("%f",VAL(val));
 }
@@ -267,7 +267,7 @@ static int parse_float(const m_option_t*
     return r;
 }
 
-static char* print_float(const m_option_t* opt,  void* val) {
+static char* print_float(const m_option_t* opt,  const void* val) {
   opt = NULL;
   return dup_printf("%f",VAL(val));
 }
@@ -322,7 +322,7 @@ static int parse_position(const m_option
   return 1;
 }
 
-static char* print_position(const m_option_t* opt,  void* val) {
+static char* print_position(const m_option_t* opt,  const void* val) {
   return dup_printf("%"PRId64,(int64_t)VAL(val));
 }
 
@@ -373,7 +373,7 @@ static int parse_str(const m_option_t* o
 
 }
 
-static char* print_str(const m_option_t* opt,  void* val) {
+static char* print_str(const m_option_t* opt,  const void* val) {
   return (val && VAL(val) && strlen(VAL(val)) > 0) ? strdup(VAL(val)) : NULL;
 }
 
@@ -636,7 +636,7 @@ static void copy_str_list(const m_option
   VAL(dst) = d;
 }
 
-static char* print_str_list(const m_option_t* opt, void* src) {
+static char* print_str_list(const m_option_t* opt, const void* src) {
   char **lst = NULL;
   char *ret = NULL,*last = NULL;
   int i;

Modified: trunk/m_option.h
==============================================================================
--- trunk/m_option.h	(original)
+++ trunk/m_option.h	Sun Dec  2 16:56:38 2007
@@ -204,7 +204,7 @@ struct m_option_type {
    *  \return An allocated string containing the text value or (void*)-1
    *          on error.
    */
-  char* (*print)(const m_option_t* opt,  void* val);
+  char* (*print)(const m_option_t* opt, const void* val);
 
   /** \name
    *  These functions are called to save/set/restore the status of the
@@ -461,7 +461,7 @@ m_option_parse(const m_option_t* opt,con
 
 /// Helper to print options, see \ref m_option_type::print.
 inline static  char*
-m_option_print(const m_option_t* opt,  void* val_ptr) {
+m_option_print(const m_option_t* opt, const void* val_ptr) {
   if(opt->type->print)
     return opt->type->print(opt,val_ptr);
   else



More information about the MPlayer-cvslog mailing list