diff m_option.c @ 25229:4f611a555224

Option print functions may not and do not modify value
author reimar
date Sun, 02 Dec 2007 15:56:38 +0000
parents cc170348a763
children 52f6429a9ba7
line wrap: on
line diff
--- a/m_option.c	Sun Dec 02 15:53:33 2007 +0000
+++ b/m_option.c	Sun Dec 02 15:56:38 2007 +0000
@@ -114,7 +114,7 @@
   }
 }
 
-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 @@
   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 @@
   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 @@
     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 @@
   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 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 @@
   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;