diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-10-29 02:44:53 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-10-29 02:44:53 +0000 |
commit | b857308dd92789ac5dee3ad25a416ed967f02426 (patch) | |
tree | dfc66e5867d08da46fed54d8ef11cddb5e4da382 /sys | |
parent | 984143ffd1c764cec73362a5a341c34372d5e3f3 (diff) |
__fd_mask should be unsigned, and let's shift an unsigned bit. Why
has this never mattered before??
ok guenther millert
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/select.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/sys/select.h b/sys/sys/select.h index 9a5bd31dbab..d608633bc08 100644 --- a/sys/sys/select.h +++ b/sys/sys/select.h @@ -1,4 +1,4 @@ -/* $OpenBSD: select.h,v 1.12 2013/10/22 06:51:54 deraadt Exp $ */ +/* $OpenBSD: select.h,v 1.13 2013/10/29 02:44:52 deraadt Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -62,7 +62,7 @@ struct timespec; * Non-underscore versions are exposed later #if __BSD_VISIBLE */ #define __NBBY 8 /* number of bits in a byte */ -typedef int32_t __fd_mask; +typedef uint32_t __fd_mask; #define __NFDBITS ((unsigned)(sizeof(__fd_mask) * __NBBY)) /* bits per mask */ #define __howmany(x, y) (((x) + ((y) - 1)) / (y)) @@ -71,11 +71,11 @@ typedef struct fd_set { } fd_set; #define FD_SET(n, p) \ - ((p)->fds_bits[(n) / __NFDBITS] |= (1 << ((n) % __NFDBITS))) + ((p)->fds_bits[(n) / __NFDBITS] |= (1U << ((n) % __NFDBITS))) #define FD_CLR(n, p) \ - ((p)->fds_bits[(n) / __NFDBITS] &= ~(1 << ((n) % __NFDBITS))) + ((p)->fds_bits[(n) / __NFDBITS] &= ~(1U << ((n) % __NFDBITS))) #define FD_ISSET(n, p) \ - ((p)->fds_bits[(n) / __NFDBITS] & (1 << ((n) % __NFDBITS))) + ((p)->fds_bits[(n) / __NFDBITS] & (1U << ((n) % __NFDBITS))) #define FD_COPY(f, t) memcpy(t, f, sizeof(*(f))) #define FD_ZERO(p) memset(p, 0, sizeof(*(p))) |