]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_debug.h:
authorDave Hart <hart@ntp.org>
Sat, 7 Feb 2009 00:00:15 +0000 (19:00 -0500)
committerDave Hart <hart@ntp.org>
Sat, 7 Feb 2009 00:00:15 +0000 (19:00 -0500)
  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

include/ntp_debug.h
ntpd/ntp_io.c

index 376b24b957db53cde5745cd62d8b4a66f8c5b3d6..55b2e1a76d8e6317ff18bb404f94bd9da0272a6d 100644 (file)
  */
 
 #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
index faa46461f484e2f34b1329dc3d953ca1b41acfcb..a13b6747e9914a6d59f737ed267c631420aa072b 100644 (file)
@@ -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;