Date: Mon, 21 Oct 2002 10:29:38 -0700 (PDT) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 19806 for review Message-ID: <200210211729.g9LHTcDN018081@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=19806 Change 19806 by rwatson@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@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210211729.g9LHTcDN018081>