PERFORCE change 128220 for review

Kip Macy kmacy at FreeBSD.org
Sat Oct 27 18:43:19 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=128220

Change 128220 by kmacy at kmacy:storage:toestack on 2007/10/28 01:42:24

	fix bitmap macros to behave correctly when passed something
	other than a char *

Affected files ...

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

Differences ...

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

@@ -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


More information about the p4-projects mailing list