Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: fusl/include/sys/select.h

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fusl/include/sys/select.h
diff --git a/fusl/include/sys/select.h b/fusl/include/sys/select.h
index e25257d2f33b9232fb4c171a932c41427c224e71..356433c3337bff398aafa66d702939d2ffc2592d 100644
--- a/fusl/include/sys/select.h
+++ b/fusl/include/sys/select.h
@@ -19,21 +19,41 @@ extern "C" {
typedef unsigned long fd_mask;
-typedef struct
-{
- unsigned long fds_bits[FD_SETSIZE / 8 / sizeof(long)];
+typedef struct {
+ unsigned long fds_bits[FD_SETSIZE / 8 / sizeof(long)];
} fd_set;
-#define FD_ZERO(s) do { int __i; unsigned long *__b=(s)->fds_bits; for(__i=sizeof (fd_set)/sizeof (long); __i; __i--) *__b++=0; } while(0)
-#define FD_SET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1UL<<((d)%(8*sizeof(long)))))
-#define FD_CLR(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1UL<<((d)%(8*sizeof(long)))))
-#define FD_ISSET(d, s) !!((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*sizeof(long)))))
-
-int select (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict);
-int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, const struct timespec *__restrict, const sigset_t *__restrict);
+#define FD_ZERO(s) \
+ do { \
+ int __i; \
+ unsigned long* __b = (s)->fds_bits; \
+ for (__i = sizeof(fd_set) / sizeof(long); __i; __i--) \
+ *__b++ = 0; \
+ } while (0)
+#define FD_SET(d, s) \
+ ((s)->fds_bits[(d) / (8 * sizeof(long))] |= \
+ (1UL << ((d) % (8 * sizeof(long)))))
+#define FD_CLR(d, s) \
+ ((s)->fds_bits[(d) / (8 * sizeof(long))] &= \
+ ~(1UL << ((d) % (8 * sizeof(long)))))
+#define FD_ISSET(d, s) \
+ !!((s)->fds_bits[(d) / (8 * sizeof(long))] & \
+ (1UL << ((d) % (8 * sizeof(long)))))
+
+int select(int,
+ fd_set* __restrict,
+ fd_set* __restrict,
+ fd_set* __restrict,
+ struct timeval* __restrict);
+int pselect(int,
+ fd_set* __restrict,
+ fd_set* __restrict,
+ fd_set* __restrict,
+ const struct timespec* __restrict,
+ const sigset_t* __restrict);
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-#define NFDBITS (8*(int)sizeof(long))
+#define NFDBITS (8 * (int)sizeof(long))
#endif
#ifdef __cplusplus

Powered by Google App Engine
This is Rietveld 408576698