PERFORCE change 19806 for review

Robert Watson rwatson at freebsd.org
Mon Oct 21 17:29:38 GMT 2002


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

Change 19806 by rwatson at rwatson_paprika on 2002/10/21 10:28:57

	Put parens around macro argument variables so that expressions
	can be safely passed in.  Remove odd whitespace.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.h#7 edit
.. //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.h#8 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.h#7 (text+ko) ====

@@ -94,9 +94,10 @@
  * Biba compartments bit test/set macros.
  * The range is 1 to MAC_BIBA_MAX_COMPARTMENTS.
  */
-#define	MAC_BIBA_BIT_TEST(b, w)	(w[((b - 1) >> 3)] & (1 << ((b - 1) & 7)))
-#define	MAC_BIBA_BIT_SET(b, w)	(w[((b - 1) >> 3)] |= (1 << ((b - 1) & 7)))
+#define	MAC_BIBA_BIT_TEST(b, w) \
+	((w)[(((b) - 1) >> 3)] & (1 << (((b) - 1) & 7)))
+#define	MAC_BIBA_BIT_SET(b, w) \
+	((w)[(((b) - 1) >> 3)] |= (1 << (((b) - 1) & 7)))
 #define MAC_BIBA_BIT_SET_EMPTY(set)	biba_bit_set_empty(set)
 
 #endif /* !_SYS_SECURITY_MAC_BIBA_H */
-

==== //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.h#8 (text+ko) ====

@@ -99,8 +99,10 @@
  * MLS compartments bit test/set macros.
  * The range is 1 to MAC_MLS_MAX_COMPARTMENTS.
  */
-#define	MAC_MLS_BIT_TEST(b, w)	(w[((b - 1) >> 3)] & (1 << ((b - 1) & 7)))
-#define	MAC_MLS_BIT_SET(b, w)	(w[((b - 1) >> 3)] |= (1 << ((b - 1) & 7)))
+#define	MAC_MLS_BIT_TEST(b, w) \
+	((w)[(((b) - 1) >> 3)] & (1 << (((b) - 1) & 7)))
+#define	MAC_MLS_BIT_SET(b, w) \
+	((w)[(((b) - 1) >> 3)] |= (1 << (((b) - 1) & 7)))
 #define MAC_MLS_BIT_SET_EMPTY(set)	mls_bit_set_empty(set)
 
 #endif /* !_SYS_SECURITY_MAC_MLS_H */
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list