aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2004-11-19 14:38:02 +0000
committerGisle Vanem <gvanem@broadpark.no>2004-11-19 14:38:02 +0000
commit539e34b5df54817d67225e70e26d7a623476d8e4 (patch)
tree5d550a28b7c996969c8bc978aaf97f04a289904b /lib
parent765683403f27836d60bc7e210d22f93e8f63ace1 (diff)
Suppress signed vs. unsigned warnings on Win32
Diffstat (limited to 'lib')
-rw-r--r--lib/select.c10
-rw-r--r--lib/select.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/select.c b/lib/select.c
index ee0437342..3069a0c00 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -98,7 +98,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
fd_set fds_read;
fd_set fds_write;
fd_set fds_err;
- int maxfd;
+ curl_socket_t maxfd;
int r;
int ret;
@@ -176,7 +176,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
fd_set fds_read;
fd_set fds_write;
fd_set fds_err;
- int maxfd;
+ curl_socket_t maxfd;
int r;
unsigned int i;
@@ -186,12 +186,14 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
maxfd = -1;
for (i = 0; i < nfds; i++) {
- if (ufds[i].fd < 0)
+ if (ufds[i].fd == CURL_SOCKET_BAD)
continue;
+#ifndef WIN32 /* This is harmless and wrong on Win32 */
if (ufds[i].fd >= FD_SETSIZE) {
errno = EINVAL;
return -1;
}
+#endif
if (ufds[i].fd > maxfd)
maxfd = ufds[i].fd;
if (ufds[i].events & POLLIN)
@@ -220,7 +222,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
r = 0;
for (i = 0; i < nfds; i++) {
ufds[i].revents = 0;
- if (ufds[i].fd < 0)
+ if (ufds[i].fd == CURL_SOCKET_BAD)
continue;
if (FD_ISSET(ufds[i].fd, &fds_read))
ufds[i].revents |= POLLIN;
diff --git a/lib/select.h b/lib/select.h
index b3d9ce3ae..c3cb22057 100644
--- a/lib/select.h
+++ b/lib/select.h
@@ -36,7 +36,7 @@
struct pollfd
{
- int fd;
+ curl_socket_t fd;
short events;
short revents;
};