From owner-cvs-all Mon Nov 25 22:45:57 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59C8937B404; Mon, 25 Nov 2002 22:45:55 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id C168E43E88; Mon, 25 Nov 2002 22:45:53 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id RAA26454; Tue, 26 Nov 2002 17:45:47 +1100 Date: Tue, 26 Nov 2002 17:59:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "Greg 'groggy' Lehey" Cc: Julian Elischer , , Subject: Re: cvs commit: src/sbin/fsck_ffs pass5.c In-Reply-To: <20021126002007.GZ41068@wantadilla.lemis.com> Message-ID: <20021126173629.E3086-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 26 Nov 2002, Greg 'groggy' Lehey wrote: > On Monday, 25 November 2002 at 17:00:03 +1100, Bruce Evans wrote: > > On Sun, 24 Nov 2002, Julian Elischer wrote: > > > >> julian 2002/11/24 13:41:42 PST > >> > >> Modified files: > >> sbin/fsck_ffs pass5.c > >> ... > > Please fix the style bugs (excessive parentheses) in this before merging. > > I thought there was consensus that additional parentheses were not > necessarily a Bad Thing if they served to demonstrate operator > precedence, as here. Here is a patch to fix these style bugs. %%% Index: pass5.c =================================================================== RCS file: /home/ncvs/src/sbin/fsck_ffs/pass5.c,v retrieving revision 1.34 diff -u -0 -r1.34 pass5.c --- pass5.c 24 Nov 2002 23:54:29 -0000 1.34 +++ pass5.c 25 Nov 2002 05:12:02 -0000 @@ -187 +188 @@ - if ((cg->cg_rotor >= 0) && (cg->cg_rotor < newcg->cg_ndblk)) + if (cg->cg_rotor >= 0 && cg->cg_rotor < newcg->cg_ndblk) @@ -191 +192 @@ - if ((cg->cg_frotor >= 0) && (cg->cg_frotor < newcg->cg_ndblk)) + if (cg->cg_frotor >= 0 && cg->cg_frotor < newcg->cg_ndblk) @@ -195 +196 @@ - if ((cg->cg_irotor >= 0) && (cg->cg_irotor < fs->fs_ipg)) + if (cg->cg_irotor >= 0 && cg->cg_irotor < fs->fs_ipg) %%% To me, parenthesizing almost eveything demonstrates that the author is not fluent in C. Parentheses are a necessary evil in some contexts, but the above is not such a context. The style of parenthesizing almost everything doesn't seem to be used anywhere else in fsck_ffs/*.c. It is used in 0 of 3 other lines matching the regexp ">=.*&&" and in 0 of 40 lines matching "==.*&&". Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message