Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Oct 2007 02:00:38 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 128221 for review
Message-ID:  <200710280200.l9S20cvF096212@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=128221

Change 128221 by kmacy@kmacy:storage:toestack on 2007/10/28 02:00:27

	re-make the bitmap macros expression safe
	pointed out by Sam Leffler

Affected files ...

.. //depot/projects/toestack/sys/sys/param.h#7 edit

Differences ...

==== //depot/projects/toestack/sys/sys/param.h#7 (text+ko) ====

@@ -238,10 +238,10 @@
 #define MAXSYMLINKS	32
 
 /* Bit map related macros. */
-#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)
+#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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710280200.l9S20cvF096212>