From owner-p4-projects Mon Oct 21 10:30:11 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 938CF37B404; Mon, 21 Oct 2002 10:30:08 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41CCA37B401 for ; Mon, 21 Oct 2002 10:30:08 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC0DC43E6E for ; Mon, 21 Oct 2002 10:30:07 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9LHTcmV018085 for ; Mon, 21 Oct 2002 10:29:38 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9LHTcDN018081 for perforce@freebsd.org; Mon, 21 Oct 2002 10:29:38 -0700 (PDT) Date: Mon, 21 Oct 2002 10:29:38 -0700 (PDT) Message-Id: <200210211729.g9LHTcDN018081@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 19806 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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