compiler warning: fix
authorYang Tse <yangsita@gmail.com>
Tue, 24 May 2011 18:39:58 +0000 (20:39 +0200)
committerYang Tse <yangsita@gmail.com>
Tue, 24 May 2011 18:39:58 +0000 (20:39 +0200)
Fix compiler warning: variable was set but never used

Fix compiler warning: clobber ignored

lib/easy.c
lib/select.c
lib/warnless.c
lib/warnless.h

index 9cb275b1a2d1ede43a047cdbbc7527e72e4ac85b..ac037d266bdaf81adff765607c6387f75c79cb41 100644 (file)
@@ -86,6 +86,7 @@
 #include "slist.h"
 #include "curl_rand.h"
 #include "non-ascii.h"
+#include "warnless.h"
 
 #define _MPRINTF_REPLACE /* use our functions only */
 #include <curl/mprintf.h>
index 65682f134db9c5daf766311e075386ba508c8877..86af1dda924a53137c82069f21a4109bf4bdee35 100644 (file)
@@ -47,6 +47,7 @@
 #include "urldata.h"
 #include "connect.h"
 #include "select.h"
+#include "warnless.h"
 
 /* Winsock and TPF sockets are not in range [0..FD_SETSIZE-1] */
 
index bc29d28df6a60e4e58afc23e2f118911ee4271d9..89abd14bcce364e0870622a8bca0c34d4a904b83 100644 (file)
@@ -5,7 +5,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
@@ -22,6 +22,8 @@
 
 #include "setup.h"
 
+#define BUILDING_WARNLESS_C 1
+
 #include "warnless.h"
 
 #define CURL_MASK_SCHAR  0x7F
@@ -251,3 +253,31 @@ size_t curlx_sotouz(curl_off_t sonum)
 #  pragma warning(pop)
 #endif
 }
+
+#if defined(__INTEL_COMPILER) && defined(__unix__)
+
+int curlx_FD_ISSET(int fd, fd_set *fdset)
+{
+  #pragma warning(push)
+  #pragma warning(disable:1469) /* clobber ignored */
+  return FD_ISSET(fd, fdset);
+  #pragma warning(pop)
+}
+
+void curlx_FD_SET(int fd, fd_set *fdset)
+{
+  #pragma warning(push)
+  #pragma warning(disable:1469) /* clobber ignored */
+  FD_SET(fd, fdset);
+  #pragma warning(pop)
+}
+
+void curlx_FD_ZERO(fd_set *fdset)
+{
+  #pragma warning(push)
+  #pragma warning(disable:593) /* variable was set but never used */
+  FD_ZERO(fdset);
+  #pragma warning(pop)
+}
+
+#endif /* __INTEL_COMPILER && __unix__ */
index 7b9bd3c7f4d7a90991650c72aef5a5b3a155ea48..a27c7d32c317b6962bac484f9f39d0c49be3bec9 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
@@ -38,4 +38,20 @@ ssize_t curlx_uztosz(size_t uznum);
 
 size_t curlx_sotouz(curl_off_t sonum);
 
+#if defined(__INTEL_COMPILER) && defined(__unix__)
+
+int curlx_FD_ISSET(int fd, fd_set *fdset);
+
+void curlx_FD_SET(int fd, fd_set *fdset);
+
+void curlx_FD_ZERO(fd_set *fdset);
+
+#ifndef BUILDING_WARNLESS_C
+#  define FD_ISSET(a,b) curlx_FD_ISSET((a),(b))
+#  define FD_SET(a,b)   curlx_FD_SET((a),(b))
+#  define FD_ZERO(a)    curlx_FD_ZERO((a))
+#endif
+
+#endif /* __INTEL_COMPILER && __unix__ */
+
 #endif /* HEADER_CURL_WARNLESS_H */