gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29814 - in gnunet/src: include util


From: gnunet
Subject: [GNUnet-SVN] r29814 - in gnunet/src: include util
Date: Thu, 3 Oct 2013 13:16:07 +0200

Author: grothoff
Date: 2013-10-03 13:16:07 +0200 (Thu, 03 Oct 2013)
New Revision: 29814

Modified:
   gnunet/src/include/gnunet_configuration_lib.h
   gnunet/src/util/configuration.c
Log:
Andrew Cann wrote:

Here's a very small patch that changes one of the arguments to
GNUNET_CONFIGURATION_get_value_choice. C++ doesn't allow you to cast
from a (char **) to a (const char **) because that enables overwriting
read-only memory. This patch makes the argument "more const" (which is
always a good thing) and makes it possible to call it from C++ passing
in a (char **).

https://canndrew.org/misc/change_GNUNET_CONFIGURATION_get_value_choice_argument.diff



Modified: gnunet/src/include/gnunet_configuration_lib.h
===================================================================
--- gnunet/src/include/gnunet_configuration_lib.h       2013-10-03 10:01:15 UTC 
(rev 29813)
+++ gnunet/src/include/gnunet_configuration_lib.h       2013-10-03 11:16:07 UTC 
(rev 29814)
@@ -394,7 +394,7 @@
 int
 GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
                                        *cfg, const char *section,
-                                       const char *option, const char 
**choices,
+                                       const char *option, const char *const 
*choices,
                                        const char **value);
 
 /**

Modified: gnunet/src/util/configuration.c
===================================================================
--- gnunet/src/util/configuration.c     2013-10-03 10:01:15 UTC (rev 29813)
+++ gnunet/src/util/configuration.c     2013-10-03 11:16:07 UTC (rev 29814)
@@ -964,7 +964,7 @@
 int
 GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
                                        *cfg, const char *section,
-                                       const char *option, const char 
**choices,
+                                       const char *option, const char *const 
*choices,
                                        const char **value)
 {
   struct ConfigEntry *e;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]