From: Hallvard Furuseth Date: Thu, 12 Apr 2012 05:34:13 +0000 (+0200) Subject: Fix MDB_DEBUG in last ITS#7299 commit. X-Git-Tag: OPENLDAP_REL_ENG_2_4_32~125^2~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d1738c3e6b8260d4036ddd17b4f4194407d5ab38;p=openldap Fix MDB_DEBUG in last ITS#7299 commit. Make DPRINTF usable in if-else. Silence signed vs unsigned warning. --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 482bb6243d..ba6ded3226 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -260,11 +260,12 @@ typedef ID txnid_t; # define DPRINTF (void) /* Vararg macros may be unsupported */ #elif MDB_DEBUG static int mdb_debug; -static int mdb_debug_start; +static txnid_t mdb_debug_start; /** Print a debug message with printf formatting. */ # define DPRINTF(fmt, ...) /**< Requires 2 or more args */ \ - if (mdb_debug) fprintf(stderr, "%s:%d " fmt "\n", __func__, __LINE__, __VA_ARGS__) + ((void) ((mdb_debug) && \ + fprintf(stderr, "%s:%d " fmt "\n", __func__, __LINE__, __VA_ARGS__))) #else # define DPRINTF(fmt, ...) ((void) 0) #endif