aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ats/ats_api_performance.c8
-rw-r--r--src/ats/plugin_ats_proportional.c2
-rw-r--r--src/datastore/plugin_datastore_sqlite.c3
-rw-r--r--src/fs/fs_api.c2
-rw-r--r--src/include/gnunet_common.h6
-rw-r--r--src/testbed/testbed_api_topology.c4
6 files changed, 16 insertions, 9 deletions
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index caa1da034..0c196ea43 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -849,7 +849,7 @@ GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *p
849 count = 0; 849 count = 0;
850 va_start(ap, peer); 850 va_start(ap, peer);
851 while (GNUNET_ATS_PREFERENCE_END != 851 while (GNUNET_ATS_PREFERENCE_END !=
852 (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) 852 (kind = GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
853 { 853 {
854 switch (kind) 854 switch (kind)
855 { 855 {
@@ -875,7 +875,7 @@ GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *p
875 count = 0; 875 count = 0;
876 va_start(ap, peer); 876 va_start(ap, peer);
877 while (GNUNET_ATS_PREFERENCE_END != (kind = 877 while (GNUNET_ATS_PREFERENCE_END != (kind =
878 va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) 878 GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
879 { 879 {
880 pi[count].preference_kind = htonl (kind); 880 pi[count].preference_kind = htonl (kind);
881 switch (kind) 881 switch (kind)
@@ -927,7 +927,7 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
927 count = 0; 927 count = 0;
928 va_start(ap, scope); 928 va_start(ap, scope);
929 while (GNUNET_ATS_PREFERENCE_END != 929 while (GNUNET_ATS_PREFERENCE_END !=
930 (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) 930 (kind = GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
931 { 931 {
932 switch (kind) 932 switch (kind)
933 { 933 {
@@ -954,7 +954,7 @@ GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
954 count = 0; 954 count = 0;
955 va_start(ap, scope); 955 va_start(ap, scope);
956 while (GNUNET_ATS_PREFERENCE_END != (kind = 956 while (GNUNET_ATS_PREFERENCE_END != (kind =
957 va_arg (ap, enum GNUNET_ATS_PreferenceKind) )) 957 GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
958 { 958 {
959 pi[count].preference_kind = htonl (kind); 959 pi[count].preference_kind = htonl (kind);
960 switch (kind) 960 switch (kind)
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c
index b4ca70dc7..08fb7a9a7 100644
--- a/src/ats/plugin_ats_proportional.c
+++ b/src/ats/plugin_ats_proportional.c
@@ -1005,7 +1005,7 @@ GAS_proportional_address_property_changed (void *solver,
1005static void 1005static void
1006GAS_proportional_address_add (void *solver, 1006GAS_proportional_address_add (void *solver,
1007 struct ATS_Address *address, 1007 struct ATS_Address *address,
1008 enum GNUNET_ATS_Network_Type network) 1008 uint32_t network)
1009{ 1009{
1010 struct GAS_PROPORTIONAL_Handle *s = solver; 1010 struct GAS_PROPORTIONAL_Handle *s = solver;
1011 struct Network *net; 1011 struct Network *net;
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c
index 80960c676..fc1706400 100644
--- a/src/datastore/plugin_datastore_sqlite.c
+++ b/src/datastore/plugin_datastore_sqlite.c
@@ -855,9 +855,10 @@ sqlite_plugin_get_zero_anonymity (void *cls,
855 void *proc_cls) 855 void *proc_cls)
856{ 856{
857 struct Plugin *plugin = cls; 857 struct Plugin *plugin = cls;
858 uint32_t type32 = type;
858 struct GNUNET_SQ_QueryParam params[] = { 859 struct GNUNET_SQ_QueryParam params[] = {
859 GNUNET_SQ_query_param_uint64 (&next_uid), 860 GNUNET_SQ_query_param_uint64 (&next_uid),
860 GNUNET_SQ_query_param_uint32 (&type), 861 GNUNET_SQ_query_param_uint32 (&type32),
861 GNUNET_SQ_query_param_end 862 GNUNET_SQ_query_param_end
862 }; 863 };
863 864
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index 0857110b1..9b783ba93 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -3112,7 +3112,7 @@ GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
3112 ret->max_parallel_requests = DEFAULT_MAX_PARALLEL_REQUESTS; 3112 ret->max_parallel_requests = DEFAULT_MAX_PARALLEL_REQUESTS;
3113 ret->avg_block_latency = GNUNET_TIME_UNIT_MINUTES; /* conservative starting point */ 3113 ret->avg_block_latency = GNUNET_TIME_UNIT_MINUTES; /* conservative starting point */
3114 va_start (ap, flags); 3114 va_start (ap, flags);
3115 while (GNUNET_FS_OPTIONS_END != (opt = va_arg (ap, enum GNUNET_FS_OPTIONS))) 3115 while (GNUNET_FS_OPTIONS_END != (opt = GNUNET_VA_ARG_ENUM (ap,GNUNET_FS_OPTIONS)))
3116 { 3116 {
3117 switch (opt) 3117 switch (opt)
3118 { 3118 {
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index ec91b35ad..b4bf5b0aa 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -24,6 +24,7 @@
24 * 24 *
25 * @author Christian Grothoff 25 * @author Christian Grothoff
26 * @author Nils Durner 26 * @author Nils Durner
27 * @author Martin Schanzenbach
27 * 28 *
28 * @defgroup logging Logging 29 * @defgroup logging Logging
29 * @see [Documentation](https://gnunet.org/logging) 30 * @see [Documentation](https://gnunet.org/logging)
@@ -112,6 +113,11 @@ extern "C"
112#endif 113#endif
113 114
114/** 115/**
116 * wrap va_arg for enums
117 */
118#define GNUNET_VA_ARG_ENUM(va,X) ((enum X) va_arg (va, int))
119
120/**
115 * @ingroup logging 121 * @ingroup logging
116 * define #GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source 122 * define #GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source
117 * tree where gnunet_config.h is unavailable 123 * tree where gnunet_config.h is unavailable
diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c
index 51a8b979a..114055a07 100644
--- a/src/testbed/testbed_api_topology.c
+++ b/src/testbed/testbed_api_topology.c
@@ -1391,7 +1391,7 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls,
1391 } 1391 }
1392 do 1392 do
1393 { 1393 {
1394 secondary_option = va_arg (va, enum GNUNET_TESTBED_TopologyOption); 1394 secondary_option = GNUNET_VA_ARG_ENUM (va, GNUNET_TESTBED_TopologyOption);
1395 1395
1396 switch (secondary_option) 1396 switch (secondary_option)
1397 { 1397 {
@@ -1552,7 +1552,7 @@ GNUNET_TESTBED_underlay_construct_ (int num_peers,
1552 tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY; 1552 tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY;
1553 underlay = &tc.u.underlay; 1553 underlay = &tc.u.underlay;
1554 va_start (vargs, cls); 1554 va_start (vargs, cls);
1555 topology = va_arg (vargs, enum GNUNET_TESTBED_TopologyOption); 1555 topology = GNUNET_VA_ARG_ENUM (vargs, GNUNET_TESTBED_TopologyOption);
1556 switch (topology) 1556 switch (topology)
1557 { 1557 {
1558 case GNUNET_TESTBED_TOPOLOGY_LINE: 1558 case GNUNET_TESTBED_TOPOLOGY_LINE: