From owner-cvs-all Wed Sep 11 3:54:10 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 576CB37B400; Wed, 11 Sep 2002 03:54:05 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id E195843E4A; Wed, 11 Sep 2002 03:54:03 -0700 (PDT) (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 UAA26123; Wed, 11 Sep 2002 20:54:02 +1000 Date: Wed, 11 Sep 2002 21:01:50 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Juli Mallett Cc: Tony Finch , , Subject: Re: cvs commit: src/usr.bin/uudecode uudecode.c In-Reply-To: <20020910145812.B78992@FreeBSD.org> Message-ID: <20020911205548.E1092-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, 10 Sep 2002, Juli Mallett wrote: > * De: Tony Finch [ Data: 2002-09-10 ] > > ... > > Log: > > Style: Don't treat pointers as booleans. > > Do we have a firm style(9) ruling on that? There's like two cases I know > of where it's justified, both are code that return pointers, and use 0 / false > internally. I loathe if(ptr) almost as much as if(foo &bitmask) and if(!strcmp) What's wrong with "if(foo &bitmask)" (except for its whitespace of course)? It is a multi-boolean test if bitmask is essentially an array of booleans. It seems to be Normal KNF too. But !(foo & bitmask) seems to be abNormal -- (foo & bitmask) == 0 seems to be normal. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message