From owner-freebsd-hackers Tue Mar 5 23:38:18 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mired.org (dsl-64-192-6-133.telocity.com [64.192.6.133]) by hub.freebsd.org (Postfix) with SMTP id 9004037B416 for ; Tue, 5 Mar 2002 23:38:08 -0800 (PST) Received: (qmail 68876 invoked by uid 100); 6 Mar 2002 07:38:07 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15493.51038.957711.450030@guru.mired.org> Date: Wed, 6 Mar 2002 01:38:06 -0600 To: Poul-Henning Kamp Cc: "Mike Meyer" , obrien@FreeBSD.ORG, Giorgos Keramidas , hackers@FreeBSD.ORG Subject: Re: RFC: style(9) isn't explicit about booleans for testing. In-Reply-To: <88752.1015400044@critter.freebsd.dk> References: <15493.49923.458997.98416@guru.mired.org> <88752.1015400044@critter.freebsd.dk> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.48 (Python 2.2 on freebsd4) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Poul-Henning Kamp types: > In message <15493.49923.458997.98416@guru.mired.org>, "Mike Meyer" writes: > >David O'Brien types: > >> On Wed, Mar 06, 2002 at 02:08:07AM +0200, Giorgos Keramidas wrote: > Now, IFF the C language had a type called "boolean" that would make > a lot of sense. So you're advocating that the rule be dropped. > I belive the overall purpose of style(9) is to make the code readable, > and I happen to think that > > if (somerandomfunction(argthis, functionthat(something), onemore)) { > chugchugchug(argthisa; > } > > is just a tiny bit more readable than > > if ((somerandomfunction(argthis, functionthat(something), onemore) > != 0) { > chugchugchug(argthisa; > } I agree with you. Under the rules as they exist now, the first form would only be valid if somerandomfunctoin returned either 0 or . http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message