]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_setup_once: consistently use WHILE_FALSE in macros
authorDaniel Gustafsson <daniel@yesql.se>
Thu, 28 Nov 2019 15:02:13 +0000 (16:02 +0100)
committerDaniel Gustafsson <daniel@yesql.se>
Thu, 28 Nov 2019 15:02:13 +0000 (16:02 +0100)
The WHILE_FALSE construction is used to avoid compiler warnings in
macro constructions. This fixes a few instances where it was not
used in order to keep the code consistent.

Closes #4649
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
lib/cookie.c
lib/sha256.c
lib/vssh/libssh.c

index f56bd85a93cd9b1120e5d3c6cfb1b10568366901..7e68b0785cd4eb2a2bf5a9cb29c19cffc0a49ab3 100644 (file)
@@ -1226,7 +1226,7 @@ static int cookie_sort_ct(const void *p1, const void *p2)
       if(!d->field)                      \
         goto fail;                       \
     }                                    \
-  } while(0)
+  } WHILE_FALSE
 
 static struct Cookie *dup_cookie(struct Cookie *src)
 {
index f9287af2323a868b7617786b5994cc41eb29bbb1..0dcd24c08f911c2b0dab26feba67e0cf268f9e50 100644 (file)
@@ -58,7 +58,7 @@ do {                                                                \
   (a)[1] = (unsigned char)((((unsigned long) (val)) >> 16) & 0xff); \
   (a)[2] = (unsigned char)((((unsigned long) (val)) >> 8) & 0xff);  \
   (a)[3] = (unsigned char)(((unsigned long) (val)) & 0xff);         \
-} while(0)
+} WHILE_FALSE;
 
 #ifdef HAVE_LONGLONG
 #define WPA_PUT_BE64(a, val)                                    \
@@ -71,7 +71,7 @@ do {                                                            \
   (a)[5] = (unsigned char)(((unsigned long long)(val)) >> 16);  \
   (a)[6] = (unsigned char)(((unsigned long long)(val)) >> 8);   \
   (a)[7] = (unsigned char)(((unsigned long long)(val)) & 0xff); \
-} while(0)
+} WHILE_FALSE;
 #else
 #define WPA_PUT_BE64(a, val)                                  \
 do {                                                          \
index 070879d94631b9e824ac55c9a28ca0c839e0e605..ef874524654fadc9146846a88197cfa688ac3f4c 100644 (file)
@@ -98,7 +98,7 @@
 /* A recent macro provided by libssh. Or make our own. */
 #ifndef SSH_STRING_FREE_CHAR
 #define SSH_STRING_FREE_CHAR(x) \
-    do { if((x) != NULL) { ssh_string_free_char(x); x = NULL; } } while(0)
+    do { if((x) != NULL) { ssh_string_free_char(x); x = NULL; } } WHILE_FALSE
 #endif
 
 /* Local functions: */