]> granicus.if.org Git - curl/commitdiff
fix a bunch of MSVC compiler warnings
authorYang Tse <yangsita@gmail.com>
Sat, 3 Sep 2011 14:06:10 +0000 (16:06 +0200)
committerYang Tse <yangsita@gmail.com>
Sat, 3 Sep 2011 14:07:09 +0000 (16:07 +0200)
41 files changed:
lib/asyn.h
lib/connect.c
lib/connect.h
lib/content_encoding.h
lib/cookie.h
lib/curl_ntlm.c
lib/curl_ntlm.h
lib/curl_ntlm_msgs.c
lib/curl_ntlm_wb.c
lib/cyassl.h
lib/ftp.c
lib/hostip6.c
lib/http_digest.h
lib/imap.c
lib/krb5.c
lib/ldap.c
lib/memdebug.c
lib/memdebug.h
lib/non-ascii.h
lib/nss.c
lib/nssg.h
lib/polarssl.h
lib/pop3.c
lib/qssl.h
lib/select.c
lib/sendf.h
lib/setup.h
lib/setup_once.h
lib/smtp.c
lib/splay.h
lib/ssh.c
lib/sslgen.h
lib/ssluse.c
lib/telnet.c
lib/url.h
src/main.c
src/setup.h
tests/libtest/first.c
tests/libtest/lib500.c
tests/server/getpart.c
tests/unit/curlcheck.h

index 34f9c14c577e791900020a9d3f4978afe8cca226..e7c1b886d91baf40c088980d4dec61efffc4ed64 100644 (file)
@@ -146,15 +146,15 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
 
 #ifndef CURLRES_ASYNCH
 /* convert these functions if an asynch resolver isn't used */
-#define Curl_resolver_cancel(x)
+#define Curl_resolver_cancel(x) Curl_nop_stmt
 #define Curl_resolver_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST
 #define Curl_resolver_wait_resolv(x,y) CURLE_COULDNT_RESOLVE_HOST
 #define Curl_resolver_getsock(x,y,z) 0
 #define Curl_resolver_duphandle(x,y) CURLE_OK
 #define Curl_resolver_init(x) CURLE_OK
 #define Curl_resolver_global_init() CURLE_OK
-#define Curl_resolver_global_cleanup()
-#define Curl_resolver_cleanup(x)
+#define Curl_resolver_global_cleanup() Curl_nop_stmt
+#define Curl_resolver_cleanup(x) Curl_nop_stmt
 #endif
 
 #ifdef CURLRES_ASYNCH
index 7f7e16794571e4e1221bfa812c4ac6262e542b16..df304fc62800f1140480faf615db2c9e56445808 100644 (file)
@@ -790,7 +790,7 @@ static void nosigpipe(struct connectdata *conn,
           Curl_strerror(conn, SOCKERRNO));
 }
 #else
-#define nosigpipe(x,y)
+#define nosigpipe(x,y) Curl_nop_stmt
 #endif
 
 #ifdef USE_WINSOCK
index 299233d4fd65fc0f8cb1944274ce8fde5b4e0b11..052549368ae2dbb4d5eeccce2ff727e35e68c421 100644 (file)
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 #include "nonblock.h" /* for curlx_nonblock(), formerly Curl_nonblock() */
 
@@ -64,7 +65,7 @@ curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
 */
 void Curl_sndbufset(curl_socket_t sockfd);
 #else
-#define Curl_sndbufset(y)
+#define Curl_sndbufset(y) Curl_nop_stmt
 #endif
 
 void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd);
index 3aff9d3c0ba882770cb09b331e1985f73021ffc1..372da4a3bbfee130914dc3ff9798cc5b1d9b7a61 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __CURL_CONTENT_ENCODING_H
-#define __CURL_CONTENT_ENCODING_H
+#ifndef HEADER_CURL_CONTENT_ENCODING_H
+#define HEADER_CURL_CONTENT_ENCODING_H
 /***************************************************************************
  *                                  _   _ ____  _
  *  Project                     ___| | | |  _ \| |
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -32,7 +32,7 @@
 void Curl_unencode_cleanup(struct connectdata *conn);
 #else
 #define ALL_CONTENT_ENCODINGS "identity"
-#define Curl_unencode_cleanup(x)
+#define Curl_unencode_cleanup(x) Curl_nop_stmt
 #endif
 
 CURLcode Curl_unencode_deflate_write(struct connectdata *conn,
@@ -45,4 +45,4 @@ Curl_unencode_gzip_write(struct connectdata *conn,
                          ssize_t nread);
 
 
-#endif
+#endif /* HEADER_CURL_CONTENT_ENCODING_H */
index c9d397934a0598a4b5b0a805e3c2dab88b5e265e..5997e4680fad4b95b17228b13b35cf182b23734e 100644 (file)
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 #include <curl/curl.h>
 
@@ -86,10 +87,10 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies);
 
 #if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
 #define Curl_cookie_list(x) NULL
-#define Curl_cookie_loadfiles(x) do { } while (0)
+#define Curl_cookie_loadfiles(x) Curl_nop_stmt
 #define Curl_cookie_init(x,y,z,w) NULL
-#define Curl_cookie_cleanup(x) do { } while (0)
-#define Curl_flush_cookies(x,y)
+#define Curl_cookie_cleanup(x) Curl_nop_stmt
+#define Curl_flush_cookies(x,y) Curl_nop_stmt
 #else
 void Curl_flush_cookies(struct SessionHandle *data, int cleanup);
 void Curl_cookie_cleanup(struct CookieInfo *);
index bdf74053ceebbb8e605ddd28fdd60b643b008f82..0e492d707a039356d0b54bc9728b462f787401a6 100644 (file)
@@ -57,7 +57,7 @@
 #if DEBUG_ME
 # define DEBUG_OUT(x) x
 #else
-# define DEBUG_OUT(x)
+# define DEBUG_OUT(x) Curl_nop_stmt
 #endif
 
 CURLcode Curl_input_ntlm(struct connectdata *conn,
index e84ba3f6b567d138d39ae6cad7f42b388e1d6dbd..b2783778b36fb94924e7291bc7c1a3e2ef1c6dd3 100644 (file)
@@ -37,7 +37,7 @@ void Curl_http_ntlm_cleanup(struct connectdata *conn);
 
 #else
 
-#define Curl_http_ntlm_cleanup(a)
+#define Curl_http_ntlm_cleanup(a) Curl_nop_stmt
 
 #endif
 
index e27e947dd0fddcb062ed7377d805b2eaa06ad011..0c8d2e961a476e30cb77d3948c62b6b0ba007c19 100644 (file)
@@ -182,7 +182,7 @@ static void ntlm_print_hex(FILE *handle, const char *buf, size_t len)
     fprintf(stderr, "%02.2x", (unsigned int)*p++);
 }
 #else
-# define DEBUG_OUT(x)
+# define DEBUG_OUT(x) Curl_nop_stmt
 #endif
 
 #ifndef USE_WINDOWS_SSPI
index ff7339373bafc0302db97de64643ab888d57321b..18d0d13f8c80733c42f660b036c9d72fea0134d6 100644 (file)
 #if DEBUG_ME
 # define DEBUG_OUT(x) x
 #else
-# define DEBUG_OUT(x)
+# define DEBUG_OUT(x) Curl_nop_stmt
+#endif
+
+/* Portable 'sclose_nolog' used only in child process instead of 'sclose'
+   to avoid fooling the socket leak detector */
+#if defined(HAVE_CLOSESOCKET)
+#  define sclose_nolog(x)  closesocket((x))
+#elif defined(HAVE_CLOSESOCKET_CAMEL)
+#  define sclose_nolog(x)  CloseSocket((x))
+#else
+#  define sclose_nolog(x)  close((x))
 #endif
 
 void Curl_ntlm_wb_cleanup(struct connectdata *conn)
@@ -167,7 +177,7 @@ static CURLcode ntlm_wb_init(struct connectdata *conn, const char *userp)
      */
 
     /* Don't use sclose in the child since it fools the socket leak detector */
-    close(sockfds[0]);
+    sclose_nolog(sockfds[0]);
     if(dup2(sockfds[1], STDIN_FILENO) == -1) {
       error = ERRNO;
       failf(conn->data, "Could not redirect child stdin. errno %d: %s",
@@ -197,7 +207,7 @@ static CURLcode ntlm_wb_init(struct connectdata *conn, const char *userp)
             NULL);
 
     error = ERRNO;
-    close(sockfds[1]);
+    sclose_nolog(sockfds[1]);
     failf(conn->data, "Could not execl(). errno %d: %s",
           error, Curl_strerror(conn, error));
     exit(1);
index a21592a28856a9bda82f7ae0cd29aaa0ac1393c9..56d68066f99385d7c0071dbe983aad7f9ab2bc70 100644 (file)
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 #ifdef USE_CYASSL
 
@@ -45,7 +46,7 @@ CURLcode Curl_cyassl_connect_nonblocking(struct connectdata *conn,
 
 /* API setup for CyaSSL */
 #define curlssl_init Curl_cyassl_init
-#define curlssl_cleanup()
+#define curlssl_cleanup() Curl_nop_stmt
 #define curlssl_connect Curl_cyassl_connect
 #define curlssl_connect_nonblocking Curl_cyassl_connect_nonblocking
 #define curlssl_session_free(x)  Curl_cyassl_session_free(x)
index 18fa8cfcd19262e1eda6985516f3f76ecbe9aa31..a4a7bd1a26a985827c02eee570ec9c8a82e8c7bb 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
 #endif
 
 #ifdef CURL_DISABLE_VERBOSE_STRINGS
-#define ftp_pasv_verbose(a,b,c,d)  do { } while(0)
+#define ftp_pasv_verbose(a,b,c,d)  Curl_nop_stmt
 #endif
 
 /* Local API functions */
index dae41e97f5b60c9f5ed46532dba7818ea027b93b..8241cb4bcac4cb8b43d61d5467e2bbaa1555ef16 100644 (file)
@@ -154,7 +154,7 @@ static void dump_addrinfo(struct connectdata *conn, const Curl_addrinfo *ai)
   }
 }
 #else
-#define dump_addrinfo(x,y)
+#define dump_addrinfo(x,y) Curl_nop_stmt
 #endif
 
 /*
index 75fcba9293170b2f6939369ec24ca40fb3ce69f5..3b22ce10eaf2801c591f4a78368bb4d76018f7fc 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __HTTP_DIGEST_H
-#define __HTTP_DIGEST_H
+#ifndef HEADER_CURL_HTTP_DIGEST_H
+#define HEADER_CURL_HTTP_DIGEST_H
 /***************************************************************************
  *                                  _   _ ____  _
  *  Project                     ___| | | |  _ \| |
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 typedef enum {
   CURLDIGEST_NONE, /* not a digest */
@@ -50,7 +51,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
 #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH)
 void Curl_digest_cleanup(struct SessionHandle *data);
 #else
-#define Curl_digest_cleanup(x) do {} while(0)
+#define Curl_digest_cleanup(x) Curl_nop_stmt
 #endif
 
-#endif
+#endif /* HEADER_CURL_HTTP_DIGEST_H */
index 4f2ee4ee3d05ce77f5785a2eec9cd4895a88161e..9aa9ae98d7e795e12d478272724f04002adae696 100644 (file)
@@ -335,7 +335,7 @@ static void imap_to_imaps(struct connectdata *conn)
   conn->handler = &Curl_handler_imaps;
 }
 #else
-#define imap_to_imaps(x)
+#define imap_to_imaps(x) Curl_nop_stmt
 #endif
 
 /* for STARTTLS responses */
index 3491354dbcb38c7e4c9747cce2ce4c00f8d75bb4..96938dd6e1f94fad3e4b665a5991ea02b85d4991 100644 (file)
@@ -190,7 +190,7 @@ krb5_auth(void *app_data, struct connectdata *conn)
   chan.application_data.value = NULL;
 
   /* this loop will execute twice (once for service, once for host) */
-  while(1) {
+  for(;;) {
     /* this really shouldn't be repeated here, but can't help it */
     if(service == srv_host) {
       result = Curl_ftpsendf(conn, "AUTH GSSAPI");
index 0fcbc22e05079afba5abc9f0ddcf6b30280664f9..11b9beeb79a400f2d28f19f6a15320aceed71906 100644 (file)
@@ -105,11 +105,11 @@ static void _ldap_free_urldesc (LDAPURLDesc *ludp);
   #define LDAP_TRACE(x)   do { \
                             _ldap_trace ("%u: ", __LINE__); \
                             _ldap_trace x; \
-                          } while(0)
+                          } WHILE_FALSE
 
   static void _ldap_trace (const char *fmt, ...);
 #else
-  #define LDAP_TRACE(x)   ((void)0)
+  #define LDAP_TRACE(x)   Curl_nop_stmt
 #endif
 
 
index 1a0a485a885e4705834c431242e02c874bbe3642..0b81621cb25258d1b29b2dff836b66b701c22ac6 100644 (file)
@@ -42,7 +42,7 @@
 #include "memdebug.h"
 
 #ifndef HAVE_ASSERT_H
-#  define assert(x) do { } while (0)
+#  define assert(x) Curl_nop_stmt
 #endif
 
 /*
 #ifdef CURL_MT_MALLOC_FILL
 #  define mt_malloc_fill(buf,len) memset((buf), CURL_MT_MALLOC_FILL, (len))
 #else
-#  define mt_malloc_fill(buf,len)
+#  define mt_malloc_fill(buf,len) Curl_nop_stmt
 #endif
 
 #ifdef CURL_MT_FREE_FILL
 #  define mt_free_fill(buf,len) memset((buf), CURL_MT_FREE_FILL, (len))
 #else
-#  define mt_free_fill(buf,len)
+#  define mt_free_fill(buf,len) Curl_nop_stmt
 #endif
 
 struct memdebug {
index a042bb474459626383bed30df6658079716036de..6e778b4da5feb7e50f42c3d2d6605edcd133cfab 100644 (file)
@@ -146,7 +146,7 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
 */
 
 #ifndef fake_sclose
-#define fake_sclose(x)  do { } WHILE_FALSE
+#define fake_sclose(x)  Curl_nop_stmt
 #endif
 
 /*
index 4e303dff8d3be698ca024bd02c6d0dc5bbb3f4a8..6dcbe00449dc6f6124eeb41a65532bf66db89c9e 100644 (file)
@@ -51,9 +51,9 @@ CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
 CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form);
 #else
 #define Curl_convert_clone(a,b,c,d) ((void)a, CURLE_OK)
-#define Curl_convert_init(x)
-#define Curl_convert_setup(x)
-#define Curl_convert_close(x)
+#define Curl_convert_init(x) Curl_nop_stmt
+#define Curl_convert_setup(x) Curl_nop_stmt
+#define Curl_convert_close(x) Curl_nop_stmt
 #define Curl_convert_to_network(a,b,c) ((void)a, CURLE_OK)
 #define Curl_convert_from_network(a,b,c) ((void)a, CURLE_OK)
 #define Curl_convert_from_utf8(a,b,c) ((void)a, CURLE_OK)
index b853b7a3afe729956e34902d9bd81b5a36aaf3e9..fb52402a9eafe14a76ec2362872f416f0607ee11 100644 (file)
--- a/lib/nss.c
+++ b/lib/nss.c
@@ -92,7 +92,7 @@ typedef struct {
   ptr->type = (_type);                                      \
   ptr->pValue = (_val);                                     \
   ptr->ulValueLen = (_len);                                 \
-} while(0)
+} WHILE_FALSE
 
 #define CERT_NewTempCertificate __CERT_NewTempCertificate
 
index 5f557c8d7cc7615e9d2e998c490026bf87901f57..4d7df5efa2680db39897edbb56aeb553cd1015f3 100644 (file)
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 #ifdef USE_NSS
 /*
@@ -56,7 +57,7 @@ CURLcode Curl_nss_force_init(struct SessionHandle *data);
 #define curlssl_connect Curl_nss_connect
 
 /* NSS has its own session ID cache */
-#define curlssl_session_free(x)
+#define curlssl_session_free(x) Curl_nop_stmt
 #define curlssl_close_all Curl_nss_close_all
 #define curlssl_close Curl_nss_close
 /* NSS has no shutdown function provided and thus always fail */
index 92234e20e499ee2ad900edee3f3cd8b7cc8de17b..91f63afbf0c3326d37789b873027c46a846ea2fc 100644 (file)
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 #ifdef USE_POLARSSL
 
@@ -39,7 +40,7 @@ int Curl_polarssl_shutdown(struct connectdata *conn, int sockindex);
 
 /* API setup for PolarSSL */
 #define curlssl_init() (1)
-#define curlssl_cleanup()
+#define curlssl_cleanup() Curl_nop_stmt
 #define curlssl_connect Curl_polarssl_connect
 #define curlssl_session_free(x)  Curl_polarssl_session_free(x)
 #define curlssl_close_all Curl_polarssl_close_all
index 42f6c1dbf22c9ffcd8f0c7035af0171f035c2682..ff71ed663694d8b03772fc989648d0220212451d 100644 (file)
@@ -280,7 +280,7 @@ static void pop3_to_pop3s(struct connectdata *conn)
   conn->handler = &Curl_handler_pop3s;
 }
 #else
-#define pop3_to_pop3s(x)
+#define pop3_to_pop3s(x) Curl_nop_stmt
 #endif
 
 /* for STARTTLS responses */
index bd195ff7b62422edb74b3930c27560e5ae1b547c..a523cb1f30ab4e9b384468730864602d3927de78 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __QSSL_H
-#define __QSSL_H
+#ifndef HEADER_CURL_QSSL_H
+#define HEADER_CURL_QSSL_H
 /***************************************************************************
  *                                  _   _ ____  _
  *  Project                     ___| | | |  _ \| |
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 /*
  * This header should only be needed to get included by sslgen.c and qssl.c
@@ -45,7 +46,7 @@ int Curl_qsossl_check_cxn(struct connectdata * cxn);
 #define curlssl_connect Curl_qsossl_connect
 
 /*  No session handling for QsoSSL */
-#define curlssl_session_free(x)
+#define curlssl_session_free(x) Curl_nop_stmt
 #define curlssl_close_all Curl_qsossl_close_all
 #define curlssl_close Curl_qsossl_close
 #define curlssl_shutdown(x,y) Curl_qsossl_shutdown(x,y)
@@ -56,4 +57,5 @@ int Curl_qsossl_check_cxn(struct connectdata * cxn);
 #define curlssl_check_cxn(x) Curl_qsossl_check_cxn(x)
 #define curlssl_data_pending(x,y) 0
 #endif /* USE_QSOSSL */
-#endif
+
+#endif /* HEADER_CURL_QSSL_H */
index bd5fa075dc0d38b9a792a5f68f27ebf9adeabd94..79475d539964ee452b875e0af676239c90178c8d 100644 (file)
@@ -49,7 +49,7 @@
 /* Winsock and TPF sockets are not in range [0..FD_SETSIZE-1] */
 
 #if defined(USE_WINSOCK) || defined(TPF)
-#define VERIFY_SOCK(x) do { } WHILE_FALSE
+#define VERIFY_SOCK(x) Curl_nop_stmt
 #else
 #define VALID_SOCK(s) (((s) >= 0) && ((s) < FD_SETSIZE))
 #define VERIFY_SOCK(x) do { \
index 8f0ea24d7886890373082eca88f4654577628d63..39911d016edc67baf2fb9307c77b9afb689ea401 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -32,9 +32,9 @@ void Curl_failf(struct SessionHandle *, const char *fmt, ...);
 #if defined(CURL_DISABLE_VERBOSE_STRINGS)
 
 #if defined(HAVE_VARIADIC_MACROS_C99)
-#define infof(...)  do { } while (0)
+#define infof(...)  Curl_nop_stmt
 #elif defined(HAVE_VARIADIC_MACROS_GCC)
-#define infof(x...)  do { } while (0)
+#define infof(x...)  Curl_nop_stmt
 #else
 #define infof (void)
 #endif
index c821bc6b48952895268f631e482ee4b86fbd74a2..69cc6d3d957a3426a2e6b4e3e1a3c582ca8d3da9 100644 (file)
@@ -599,7 +599,7 @@ int netware_init(void);
  * Include macros and defines that should only be processed once.
  */
 
-#ifndef __SETUP_ONCE_H
+#ifndef HEADER_CURL_SETUP_ONCE_H
 #include "setup_once.h"
 #endif
 
index 63a3698de964233735a000768bdf2c561c1bde36..64cfeeaac74caf2b617f13c3a9d5df210cfd5309 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __SETUP_ONCE_H
-#define __SETUP_ONCE_H
+#ifndef HEADER_CURL_SETUP_ONCE_H
+#define HEADER_CURL_SETUP_ONCE_H
 /***************************************************************************
  *                                  _   _ ____  _
  *  Project                     ___| | | |  _ \| |
@@ -323,6 +323,13 @@ __pragma(warning(pop))
 #endif
 
 
+/*
+ * Definition of our NOP statement Object-like macro
+ */
+
+#define Curl_nop_stmt  do { } WHILE_FALSE
+
+
 /*
  * Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type.
  */
@@ -360,7 +367,7 @@ typedef int sig_atomic_t;
 #ifdef DEBUGBUILD
 #define DEBUGF(x) x
 #else
-#define DEBUGF(x) do { } WHILE_FALSE
+#define DEBUGF(x) Curl_nop_stmt
 #endif
 
 
@@ -371,7 +378,7 @@ typedef int sig_atomic_t;
 #if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H)
 #define DEBUGASSERT(x) assert(x)
 #else
-#define DEBUGASSERT(x) do { } WHILE_FALSE
+#define DEBUGASSERT(x) Curl_nop_stmt
 #endif
 
 
@@ -527,5 +534,4 @@ typedef int sig_atomic_t;
 #  endif
 #endif
 
-#endif /* __SETUP_ONCE_H */
-
+#endif /* HEADER_CURL_SETUP_ONCE_H */
index 2df8c0950ffed4c61078c7ad79e1b3e779c959a0..bd37619a3e5bf7762e5d9a43aa78509c9cdd556e 100644 (file)
@@ -465,7 +465,7 @@ static void smtp_to_smtps(struct connectdata *conn)
   conn->handler = &Curl_handler_smtps;
 }
 #else
-#define smtp_to_smtps(x)
+#define smtp_to_smtps(x) Curl_nop_stmt
 #endif
 
 /* for STARTTLS responses */
index 832e4e2bbf7f337396c7f3d021795d45cc660d04..49a6dec41dfb2b4b24175b3531e56628f16c6f46 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __SPLAY_H
-#define __SPLAY_H
+#ifndef HEADER_CURL_SPLAY_H
+#define HEADER_CURL_SPLAY_H
 /***************************************************************************
  *                                  _   _ ____  _
  *  Project                     ___| | | |  _ \| |
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1997 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1997 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 struct Curl_tree {
   struct Curl_tree *smaller; /* smaller node */
@@ -59,7 +60,7 @@ int Curl_splayremovebyaddr(struct Curl_tree *t,
 #ifdef DEBUGBUILD
 void Curl_splayprint(struct Curl_tree * t, int d, char output);
 #else
-#define Curl_splayprint(x,y,z)
+#define Curl_splayprint(x,y,z) Curl_nop_stmt
 #endif
 
-#endif
+#endif /* HEADER_CURL_SPLAY_H */
index 3537f54ad6a2736e36bfc1aa327b488dec19f17e..69ff975b6f7dabdf84e72ab772d903f70369ddee 100644 (file)
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -2488,7 +2488,7 @@ static void ssh_block2waitfor(struct connectdata *conn, bool block)
 }
 #else
   /* no libssh2 directional support so we simply don't know */
-#define ssh_block2waitfor(x,y)
+#define ssh_block2waitfor(x,y) Curl_nop_stmt
 #endif
 
 /* called repeatedly until done from multi.c */
index b0a0fab12fec42d0e621a041cd3ee540a531cbad..ec8fe50bbc8f9ea89bbb6fd04caa7b7ab1ab7032 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __SSLGEN_H
-#define __SSLGEN_H
+#ifndef HEADER_CURL_SSLGEN_H
+#define HEADER_CURL_SSLGEN_H
 /***************************************************************************
  *                                  _   _ ____  _
  *  Project                     ___| | | |  _ \| |
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 bool Curl_ssl_config_matches(struct ssl_config_data* data,
                              struct ssl_config_data* needle);
@@ -71,10 +72,10 @@ void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid);
 #else
 /* When SSL support is not present, just define away these function calls */
 #define Curl_ssl_init() 1
-#define Curl_ssl_cleanup() do { } while (0)
+#define Curl_ssl_cleanup() Curl_nop_stmt
 #define Curl_ssl_connect(x,y) CURLE_NOT_BUILT_IN
-#define Curl_ssl_close_all(x)
-#define Curl_ssl_close(x,y)
+#define Curl_ssl_close_all(x) Curl_nop_stmt
+#define Curl_ssl_close(x,y) Curl_nop_stmt
 #define Curl_ssl_shutdown(x,y) CURLE_NOT_BUILT_IN
 #define Curl_ssl_set_engine(x,y) CURLE_NOT_BUILT_IN
 #define Curl_ssl_set_engine_default(x) CURLE_NOT_BUILT_IN
@@ -85,8 +86,8 @@ void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid);
 #define Curl_ssl_version(x,y) 0
 #define Curl_ssl_data_pending(x,y) 0
 #define Curl_ssl_check_cxn(x) 0
-#define Curl_ssl_free_certinfo(x)
+#define Curl_ssl_free_certinfo(x) Curl_nop_stmt
 #define Curl_ssl_connect_nonblocking(x,y,z) CURLE_NOT_BUILT_IN
 #endif
 
-#endif /* USE_SSL */
+#endif /* HEADER_CURL_SSLGEN_H */
index 924a37df46ce6e9a5f51c4b0643840111f52a915..d0840169638462fd4360c0c1630d749f00ec4c9a 100644 (file)
 /* 0.9.6 didn't have X509_STORE_set_flags() */
 #define HAVE_X509_STORE_SET_FLAGS 1
 #else
-#define X509_STORE_set_flags(x,y)
+#define X509_STORE_set_flags(x,y) Curl_nop_stmt
 #endif
 
 /*
@@ -1407,7 +1407,7 @@ static void ssl_tls_trace(int direction, int ssl_ver, int content_type,
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
 #  define use_sni(x)  sni = (x)
 #else
-#  define use_sni(x)  do { } while (0)
+#  define use_sni(x)  Curl_nop_stmt
 #endif
 
 static CURLcode
@@ -1919,7 +1919,7 @@ do {                              \
       pubkey_show(data, _num, #_type, #_name, (unsigned char*)bufp, len); \
     } \
   } \
-} while(0)
+} WHILE_FALSE
 
 static int X509V3_ext(struct SessionHandle *data,
                       int certnum,
index ebd47ebaee2beda1790fcd79b3d25e173d4e1cd8..4cefc7e44c77427285e4ae6fc45fc2d18ed2eaa5 100644 (file)
@@ -88,7 +88,7 @@
 #define  CURL_SB_LEN(x) (x->subend - x->subpointer)
 
 #ifdef CURL_DISABLE_VERBOSE_STRINGS
-#define printoption(a,b,c,d)  do { } while(0)
+#define printoption(a,b,c,d)  Curl_nop_stmt
 #endif
 
 #ifdef USE_WINSOCK
index 62e3ef3ef33394f6be896b67206ee3c64239af37..8947627d5eee5cd7f4e337b4431a3f4e9e3434eb 100644 (file)
--- a/lib/url.h
+++ b/lib/url.h
@@ -21,6 +21,7 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
+#include "setup.h"
 
 /*
  * Prototypes for library-wide functions provided by url.c
@@ -85,7 +86,7 @@ void Curl_reset_reqproto(struct connectdata *conn);
 CURLcode Curl_connected_proxy(struct connectdata *conn);
 
 #ifdef CURL_DISABLE_VERBOSE_STRINGS
-#define Curl_verboseconnect(x)  do { } while (0)
+#define Curl_verboseconnect(x)  Curl_nop_stmt
 #else
 void Curl_verboseconnect(struct connectdata *conn);
 #endif
index 86a0c4389f225744af4ffa5b6ebafa408422257c..c22b733501895a700f5e2681d1062143029d8f26 100644 (file)
@@ -4646,7 +4646,7 @@ static void memory_tracking_init(void)
   }
 }
 #else
-#  define memory_tracking_init()
+#  define memory_tracking_init() Curl_nop_stmt
 #endif
 
 static int
index d2562a24403e5b0c426ac95e7546d74087c9153d..58ca0efee53041f2f74d368579bc9c88fa3c09b0 100644 (file)
@@ -222,7 +222,7 @@ int fileno( FILE *stream);
  * Include macros and defines that should only be processed once.
  */
 
-#ifndef __SETUP_ONCE_H
+#ifndef HEADER_CURL_SETUP_ONCE_H
 #include "setup_once.h"
 #endif
 
index f35528f71027b064067fe97abcfaabf2eff4e80c..d6b486003f52056cdf53cb86029bc917fdffeb75 100644 (file)
@@ -83,7 +83,7 @@ static void memory_tracking_init(void)
   }
 }
 #else
-#  define memory_tracking_init()
+#  define memory_tracking_init() Curl_nop_stmt
 #endif
 
 int main(int argc, char **argv)
index 8ebeb1292f5371933ab86b5db1c6f40c6aa42c5f..51680fc31200bf91bd8351498f0df3f06c69b0b3 100644 (file)
@@ -52,7 +52,7 @@ static void setupcallbacks(CURL *curl)
 }
 
 #else
-#define setupcallbacks(x)
+#define setupcallbacks(x) Curl_nop_stmt
 #endif
 
 
index 2351e1cc3a1409dbfdc24bf940c7dea8bd80e9bd..9384d0cb0572861a4cfde072bf3fd77b09c5a9c1 100644 (file)
@@ -49,7 +49,7 @@ struct SessionHandle {
 #ifdef DEBUG_GETPART
 #define show(x) printf x
 #else
-#define show(x)
+#define show(x) Curl_nop_stmt
 #endif
 
 #if defined(_MSC_VER) && defined(_DLL)
index 4b4d32c8d418a42ea3ad9b2f63163fe18e9e551a..96203e075667b9cf8d843155fa9c46f3ee5dd823 100644 (file)
@@ -49,7 +49,7 @@
     fprintf(stderr, "%s:%d test failed: '%s'\n",                       \
             __FILE__, __LINE__, msg);                                  \
     unitfail++;                                                        \
-  } while(0)
+  } WHILE_FALSE
 
 
 /* The abort macros mark the current test step as failed, and exit the test */
@@ -74,7 +74,7 @@
             __FILE__, __LINE__, msg);                         \
     unitfail++;                                               \
     goto unit_test_abort;                                     \
-  } while(0)
+  } WHILE_FALSE