From: Yang Tse Date: Tue, 24 May 2011 18:39:58 +0000 (+0200) Subject: compiler warning: fix X-Git-Tag: curl-7_21_7~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b7357176063256a44b4a5a20c6b9bbe92bdda713;p=thirdparty%2Fcurl.git compiler warning: fix Fix compiler warning: variable was set but never used Fix compiler warning: clobber ignored --- diff --git a/lib/easy.c b/lib/easy.c index 9cb275b1a2..ac037d266b 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -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 diff --git a/lib/select.c b/lib/select.c index 65682f134d..86af1dda92 100644 --- a/lib/select.c +++ b/lib/select.c @@ -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] */ diff --git a/lib/warnless.c b/lib/warnless.c index bc29d28df6..89abd14bcc 100644 --- a/lib/warnless.c +++ b/lib/warnless.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , 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__ */ diff --git a/lib/warnless.h b/lib/warnless.h index 7b9bd3c7f4..a27c7d32c3 100644 --- a/lib/warnless.h +++ b/lib/warnless.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , 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 */