Loading lib/warnless.c +23 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, 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 Loading Loading @@ -378,6 +378,28 @@ size_t curlx_sitouz(int sinum) #endif } #ifdef USE_WINSOCK /* ** curl_socket_t to signed int */ int curlx_sktosi(curl_socket_t s) { return (int)((ssize_t) s); } /* ** signed int to curl_socket_t */ curl_socket_t curlx_sitosk(int i) { return (curl_socket_t)((ssize_t) i); } #endif /* USE_WINSOCK */ #if defined(__INTEL_COMPILER) && defined(__unix__) int curlx_FD_ISSET(int fd, fd_set *fdset) Loading lib/warnless.h +13 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, 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 Loading @@ -22,6 +22,10 @@ * ***************************************************************************/ #ifdef USE_WINSOCK #include <curl/curl.h> /* for curl_socket_t */ #endif unsigned short curlx_ultous(unsigned long ulnum); unsigned char curlx_ultouc(unsigned long ulnum); Loading @@ -48,6 +52,14 @@ int curlx_sztosi(ssize_t sznum); size_t curlx_sitouz(int sinum); #ifdef USE_WINSOCK int curlx_sktosi(curl_socket_t s); curl_socket_t curlx_sitosk(int i); #endif /* USE_WINSOCK */ #if defined(__INTEL_COMPILER) && defined(__unix__) int curlx_FD_ISSET(int fd, fd_set *fdset); Loading tests/server/sockfilt.c +5 −4 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ #include "inet_pton.h" #include "util.h" #include "server_sockaddr.h" #include "warnless.h" /* include memdebug.h last */ #include "memdebug.h" Loading Loading @@ -488,7 +489,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, /* only wait for events for which we actually care */ if(networkevents) { fdarr[nfd] = (curl_socket_t) LongToHandle(fds); fdarr[nfd] = curlx_sitosk(fds); if(fds == fileno(stdin)) { handles[nfd] = GetStdHandle(STD_INPUT_HANDLE); } Loading @@ -504,12 +505,12 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, error = WSAEventSelect(fds, wsaevent, networkevents); if(error != SOCKET_ERROR) { handles[nfd] = wsaevent; wsasocks[wsa] = (curl_socket_t) LongToHandle(fds); wsasocks[wsa] = curlx_sitosk(fds); wsaevents[wsa] = wsaevent; wsa++; } else { handles[nfd] = LongToHandle(fds); handles[nfd] = (HANDLE) curlx_sitosk(fds); WSACloseEvent(wsaevent); } } Loading @@ -533,7 +534,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, for(idx = 0; idx < nfd; idx++) { handle = handles[idx]; sock = fdarr[idx]; fds = HandleToLong(sock); fds = curlx_sktosi(sock); /* check if the current internal handle was triggered */ if(wait != WAIT_FAILED && (wait - WAIT_OBJECT_0) >= idx && Loading Loading
lib/warnless.c +23 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, 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 Loading Loading @@ -378,6 +378,28 @@ size_t curlx_sitouz(int sinum) #endif } #ifdef USE_WINSOCK /* ** curl_socket_t to signed int */ int curlx_sktosi(curl_socket_t s) { return (int)((ssize_t) s); } /* ** signed int to curl_socket_t */ curl_socket_t curlx_sitosk(int i) { return (curl_socket_t)((ssize_t) i); } #endif /* USE_WINSOCK */ #if defined(__INTEL_COMPILER) && defined(__unix__) int curlx_FD_ISSET(int fd, fd_set *fdset) Loading
lib/warnless.h +13 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, 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 Loading @@ -22,6 +22,10 @@ * ***************************************************************************/ #ifdef USE_WINSOCK #include <curl/curl.h> /* for curl_socket_t */ #endif unsigned short curlx_ultous(unsigned long ulnum); unsigned char curlx_ultouc(unsigned long ulnum); Loading @@ -48,6 +52,14 @@ int curlx_sztosi(ssize_t sznum); size_t curlx_sitouz(int sinum); #ifdef USE_WINSOCK int curlx_sktosi(curl_socket_t s); curl_socket_t curlx_sitosk(int i); #endif /* USE_WINSOCK */ #if defined(__INTEL_COMPILER) && defined(__unix__) int curlx_FD_ISSET(int fd, fd_set *fdset); Loading
tests/server/sockfilt.c +5 −4 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ #include "inet_pton.h" #include "util.h" #include "server_sockaddr.h" #include "warnless.h" /* include memdebug.h last */ #include "memdebug.h" Loading Loading @@ -488,7 +489,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, /* only wait for events for which we actually care */ if(networkevents) { fdarr[nfd] = (curl_socket_t) LongToHandle(fds); fdarr[nfd] = curlx_sitosk(fds); if(fds == fileno(stdin)) { handles[nfd] = GetStdHandle(STD_INPUT_HANDLE); } Loading @@ -504,12 +505,12 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, error = WSAEventSelect(fds, wsaevent, networkevents); if(error != SOCKET_ERROR) { handles[nfd] = wsaevent; wsasocks[wsa] = (curl_socket_t) LongToHandle(fds); wsasocks[wsa] = curlx_sitosk(fds); wsaevents[wsa] = wsaevent; wsa++; } else { handles[nfd] = LongToHandle(fds); handles[nfd] = (HANDLE) curlx_sitosk(fds); WSACloseEvent(wsaevent); } } Loading @@ -533,7 +534,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, for(idx = 0; idx < nfd; idx++) { handle = handles[idx]; sock = fdarr[idx]; fds = HandleToLong(sock); fds = curlx_sktosi(sock); /* check if the current internal handle was triggered */ if(wait != WAIT_FAILED && (wait - WAIT_OBJECT_0) >= idx && Loading