diff --git a/Source/NSRunLoop.m b/Source/NSRunLoop.m index e429de2c0..acb90a3c5 100644 --- a/Source/NSRunLoop.m +++ b/Source/NSRunLoop.m @@ -72,10 +72,6 @@ #include #include /* for memset() */ -/* On some systems FD_ZERO is a macro that uses bzero(). - Just define it to use memset(). */ -#define bzero(PTR, LEN) memset (PTR, 0, LEN) - static int debug_run_loop = 0; /* @@ -1089,8 +1085,8 @@ static int debug_run_loop = 0; Initialize the set of FDS we'll pass to select(), and create an empty map for keeping track of which object is associated with which file descriptor. */ - FD_ZERO (&fds); - FD_ZERO (&write_fds); + memset(&fds, '\0', sizeof(fds)); + memset(&write_fds, '\0', sizeof(write_fds)); rfd_2_object = NSCreateMapTable (NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 0); wfd_2_object = NSCreateMapTable (NSIntMapKeyCallBacks, diff --git a/Source/TcpPort.m b/Source/TcpPort.m index 2012632ec..949252486 100644 --- a/Source/TcpPort.m +++ b/Source/TcpPort.m @@ -83,10 +83,6 @@ #include #endif /* !__WIN32__ */ -/* On some systems FD_ZERO is a macro that uses bzero(). - Just define it to use GCC's builtin memset(). */ -#define bzero(PTR, LEN) memset (PTR, 0, LEN) - static int debug_tcp_port = 0; @@ -204,7 +200,7 @@ tryRead(int desc, int tim, unsigned char* dat, int len) for (;;) { to = &timeout; - FD_ZERO(&fds); + memset(&fds, '\0', sizeof(fds)); FD_SET(desc, &fds); rval = select(FD_SETSIZE, &fds, 0, 0, to); @@ -289,7 +285,7 @@ tryWrite(int desc, int tim, unsigned char* dat, int len) for (;;) { to = &timeout; - FD_ZERO(&fds); + memset(&fds, '\0', sizeof(fds)); FD_SET(desc, &fds); rval = select(FD_SETSIZE, 0, &fds, 0, to); diff --git a/Source/UdpPort.m b/Source/UdpPort.m index 8e19af658..36cb338f8 100644 --- a/Source/UdpPort.m +++ b/Source/UdpPort.m @@ -224,7 +224,7 @@ static NSMapTable *port_number_2_in_port = NULL; timeout.tv_sec = milliseconds / 1000; timeout.tv_usec = (milliseconds % 1000) * 1000; - FD_ZERO(&ready); + memset(&ready, '\0', sizeof(ready)); FD_SET(_port_socket, &ready); if ((r = select(_port_socket + 1, &ready, 0, 0, &timeout)) < 0) {