fix MSVC compiler warning 'conditional expression is constant'
authorYang Tse <yangsita@gmail.com>
Sun, 4 Sep 2011 15:23:39 +0000 (17:23 +0200)
committerYang Tse <yangsita@gmail.com>
Sun, 4 Sep 2011 15:23:39 +0000 (17:23 +0200)
acountry.c
ares_init.c
ares_private.h

index d9890182f8123286f3f04599cdd48ec2021659ed..e33e0f8359356555b384ee37c0e2aa660fa71b20 100644 (file)
@@ -89,7 +89,7 @@ static int         verbose    = 0;
 #define TRACE(fmt) do {               \
                      if (verbose > 0) \
                        printf fmt ;   \
-                   } while (0)
+                   } WHILE_FALSE
 
 static void wait_ares(ares_channel channel);
 static void callback(void *arg, int status, int timeouts, struct hostent *host);
index 44d4cf934f7a1b4663a7bfdf427856b0fb1834d7..dd59fed08328c59161cbc113b8cbdb3917bd90f4 100644 (file)
@@ -1216,7 +1216,7 @@ static int init_by_defaults(ares_channel channel)
         goto error;
       }
 
-    } while(0);
+    } WHILE_FALSE;
 
     dot = strchr(hostname, '.');
     if (dot) {
index ff45ba7e5ac10ee79cae4563ab0d0f66d2dcd8b6..3c56bbcf3b2128e99f372102b1d4680c8fcf7816 100644 (file)
@@ -342,7 +342,7 @@ long ares__tvdiff(struct timeval t1, struct timeval t2);
   do {                                                                  \
     if ((c)->sock_state_cb)                                             \
       (c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w));       \
-  } while (0)
+  } WHILE_FALSE
 
 #ifdef CURLDEBUG
 /* This is low-level hard-hacking memory leak tracking and similar. Using the