From: Dave Hart Date: Sat, 7 Feb 2009 00:00:15 +0000 (-0500) Subject: ntp_debug.h: X-Git-Tag: NTP_4_2_5P160~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3d10caff7062cca2855a859ea116358b17e9487;p=thirdparty%2Fntp.git ntp_debug.h: DPRINTF won't eat following else, always evaluates to a statement ntp_io.c: DPRINTF_INTERFACE always evaluates to a statement fix DPRINTF use with misplaced semicolon bk: 498ccf0fpM568NVbMN_q8Wclta3UVg --- diff --git a/include/ntp_debug.h b/include/ntp_debug.h index 376b24b95..55b2e1a76 100644 --- a/include/ntp_debug.h +++ b/include/ntp_debug.h @@ -13,11 +13,13 @@ */ #ifdef DEBUG -#define DPRINTF(_lvl_, _arg_) \ - if (debug >= (_lvl_)) \ - printf _arg_; +#define DPRINTF(_lvl_, _arg_) \ + do { \ + if (debug >= (_lvl_)) \ + printf _arg_; \ + } while (0) #else -#define DPRINTF(_lvl_, _arg_) +#define DPRINTF(_lvl_, _arg_) do {} while (0) #endif #endif diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index faa46461f..a13b6747e 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -194,7 +194,7 @@ static isc_boolean_t socket_multicast_disable P((struct interface *, struct sock static void print_interface P((struct interface *, char *, char *)); #define DPRINT_INTERFACE(_LVL_, _ARGS_) do { if (debug >= (_LVL_)) { print_interface _ARGS_; } } while (0) #else -#define DPRINT_INTERFACE(_LVL_, _ARGS_) +#define DPRINT_INTERFACE(_LVL_, _ARGS_) do {} while (0) #endif typedef struct vsock vsock_t; @@ -3207,7 +3207,7 @@ findlocalinterface( struct interface *iface; DPRINTF(4, ("Finding interface for addr %s in list of addresses\n", - stoa(addr));) + stoa(addr))); memset(&saddr, 0, sizeof(saddr)); saddr.ss_family = addr->ss_family;