Don't use ugly casts to access array.
authordrepper <drepper>
Tue, 16 Sep 1997 00:34:14 +0000 (00:34 +0000)
committerdrepper <drepper>
Tue, 16 Sep 1997 00:34:14 +0000 (00:34 +0000)
bits/select.h
sysdeps/generic/bits/select.h

index 7803335..8487e21 100644 (file)
 #endif
 
 
-/* This line MUST be split!  Otherwise m4 will not change it.
-
-   We don't use `memset' because this would require a prototype and
+/* We don't use `memset' because this would require a prototype and
    the array isn't too big.  */
 #define __FD_ZERO(set) \
   do {                                                                       \
     unsigned int __i;                                                        \
+    __fd_mask *__arr = (set);                                                \
     for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i)       \
-      ((__fd_mask *) set)[__i] = '\0';                                       \
+      __arr->fds_bits[__i] = '\0';                                           \
   } while (0)
 #define __FD_SET(d, set)       ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
 #define __FD_CLR(d, set)       ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
index 7803335..8487e21 100644 (file)
 #endif
 
 
-/* This line MUST be split!  Otherwise m4 will not change it.
-
-   We don't use `memset' because this would require a prototype and
+/* We don't use `memset' because this would require a prototype and
    the array isn't too big.  */
 #define __FD_ZERO(set) \
   do {                                                                       \
     unsigned int __i;                                                        \
+    __fd_mask *__arr = (set);                                                \
     for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i)       \
-      ((__fd_mask *) set)[__i] = '\0';                                       \
+      __arr->fds_bits[__i] = '\0';                                           \
   } while (0)
 #define __FD_SET(d, set)       ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
 #define __FD_CLR(d, set)       ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))