From owner-freebsd-current Wed Jan 27 21:03:33 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA11853 for freebsd-current-outgoing; Wed, 27 Jan 1999 21:03:33 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA11842 for ; Wed, 27 Jan 1999 21:03:29 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id QAA05872; Thu, 28 Jan 1999 16:03:25 +1100 Date: Thu, 28 Jan 1999 16:03:25 +1100 From: Bruce Evans Message-Id: <199901280503.QAA05872@godzilla.zeta.org.au> To: dillon@apollo.backplane.com, jdp@polstra.com Subject: Re: btokup() macro in sys/malloc.h Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> Is this parenthesization correct ? >> >> OLD >> >> #define btokup(addr) (&kmemusage[(caddr_t)(addr) - kmembase >> PAGE_SHIFT]) >> >> NEW >> >> #define btokup(addr) (&kmemusage[((caddr_t)(addr) - kmembase) >> PAGE_SHIFT]) Yes. It is the same as before the "cleanup" in rev.1.13. >The added parentheses don't make any difference, semantically. This >change probably wouldn't meet the criteria spelled out in style(9): > > Unary operators don't require spaces, binary operators do. Don't use > parentheses unless they're required for precedence, or the statement is > really confusing without them. > > a = b->c[0] + ~d == (e || f) || g && h ? i : j >> 1; > k = !(l & FLAGS); Nah, style(9), not to mention the example of btokup() in Lite1 and Lite2, requires paretheses here (in btokup(), and probably in the bad example in style(9), because the expression would be really confusing without them :-). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message