count = 0;
va_start(ap, peer);
while (GNUNET_ATS_PREFERENCE_END !=
- (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind) ))
+ (kind = GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
{
switch (kind)
{
count = 0;
va_start(ap, peer);
while (GNUNET_ATS_PREFERENCE_END != (kind =
- va_arg (ap, enum GNUNET_ATS_PreferenceKind) ))
+ GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
{
pi[count].preference_kind = htonl (kind);
switch (kind)
count = 0;
va_start(ap, scope);
while (GNUNET_ATS_PREFERENCE_END !=
- (kind = va_arg (ap, enum GNUNET_ATS_PreferenceKind) ))
+ (kind = GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
{
switch (kind)
{
count = 0;
va_start(ap, scope);
while (GNUNET_ATS_PREFERENCE_END != (kind =
- va_arg (ap, enum GNUNET_ATS_PreferenceKind) ))
+ GNUNET_VA_ARG_ENUM (ap, GNUNET_ATS_PreferenceKind) ))
{
pi[count].preference_kind = htonl (kind);
switch (kind)
static void
GAS_proportional_address_add (void *solver,
struct ATS_Address *address,
- enum GNUNET_ATS_Network_Type network)
+ uint32_t network)
{
struct GAS_PROPORTIONAL_Handle *s = solver;
struct Network *net;
void *proc_cls)
{
struct Plugin *plugin = cls;
+ uint32_t type32 = type;
struct GNUNET_SQ_QueryParam params[] = {
GNUNET_SQ_query_param_uint64 (&next_uid),
- GNUNET_SQ_query_param_uint32 (&type),
+ GNUNET_SQ_query_param_uint32 (&type32),
GNUNET_SQ_query_param_end
};
ret->max_parallel_requests = DEFAULT_MAX_PARALLEL_REQUESTS;
ret->avg_block_latency = GNUNET_TIME_UNIT_MINUTES; /* conservative starting point */
va_start (ap, flags);
- while (GNUNET_FS_OPTIONS_END != (opt = va_arg (ap, enum GNUNET_FS_OPTIONS)))
+ while (GNUNET_FS_OPTIONS_END != (opt = GNUNET_VA_ARG_ENUM (ap,GNUNET_FS_OPTIONS)))
{
switch (opt)
{
*
* @author Christian Grothoff
* @author Nils Durner
+ * @author Martin Schanzenbach
*
* @defgroup logging Logging
* @see [Documentation](https://gnunet.org/logging)
#endif
#endif
+/**
+ * wrap va_arg for enums
+ */
+#define GNUNET_VA_ARG_ENUM(va,X) ((enum X) va_arg (va, int))
+
/**
* @ingroup logging
* define #GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source
}
do
{
- secondary_option = va_arg (va, enum GNUNET_TESTBED_TopologyOption);
+ secondary_option = GNUNET_VA_ARG_ENUM (va, GNUNET_TESTBED_TopologyOption);
switch (secondary_option)
{
tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY;
underlay = &tc.u.underlay;
va_start (vargs, cls);
- topology = va_arg (vargs, enum GNUNET_TESTBED_TopologyOption);
+ topology = GNUNET_VA_ARG_ENUM (vargs, GNUNET_TESTBED_TopologyOption);
switch (topology)
{
case GNUNET_TESTBED_TOPOLOGY_LINE: