diff options
author | kmacy <kmacy@FreeBSD.org> | 2007-12-05 23:48:03 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2007-12-05 23:48:03 +0000 |
commit | e9665dcb0a25e85f22330fc96f8e07dc01796154 (patch) | |
tree | 349bf649b45bf61a432505228da281625a0b091b /sys | |
parent | f6fdf45e349b11ad9b304a3fc758497a2920a4bf (diff) | |
download | FreeBSD-src-e9665dcb0a25e85f22330fc96f8e07dc01796154.zip FreeBSD-src-e9665dcb0a25e85f22330fc96f8e07dc01796154.tar.gz |
Fix bit macros to work on multi-byte types
MFC after: 1 day
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/param.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/sys/param.h b/sys/sys/param.h index 20e087a..a591446 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -238,10 +238,10 @@ #define MAXSYMLINKS 32 /* Bit map related macros. */ -#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) -#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) -#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) -#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) +#define setbit(a,i) (((uint8_t *)(a))[(i)/NBBY] |= 1<<((i)%NBBY)) +#define clrbit(a,i) (((uint8_t *)(a))[(i)/NBBY] &= ~(1<<((i)%NBBY))) +#define isset(a,i) (((uint8_t *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) +#define isclr(a,i) ((((uint8_t *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0) /* Macros for counting and rounding. */ #ifndef howmany |