bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FD_ISSET replacement


From: Simon Josefsson
Subject: FD_ISSET replacement
Date: Wed, 22 Oct 2008 18:09:09 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

The sys_socket module generates this warning:

../lgl/sys/socket.h: In function 'rpl_fd_isset':
../lgl/sys/socket.h:158: warning: comparison between signed and unsigned
../lgl/sys/socket.h:159: warning: comparison between signed and unsigned

I pushed the patch below.

However, is the code really appropriate?  I'm thinking of this comment:

 /* Re-define FD_ISSET to avoid a WSA call while we are not using
    network sockets.  */

Given the winsock-select.c code, it seems that we may be using network
sockets?

/Simon

diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h
index fcb4a22..91a6b33 100644
--- a/lib/sys_socket.in.h
+++ b/lib/sys_socket.in.h
@@ -120,9 +120,9 @@ extern "C" {
 /* Re-define FD_ISSET to avoid a WSA call while we are not using
    network sockets.  */
 static inline int
-rpl_fd_isset (int fd, fd_set * set)
+rpl_fd_isset (SOCKET fd, fd_set * set)
 {
-  int i;
+  u_int i;
   if (set == NULL)
     return 0;
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]