From owner-cvs-all Tue Sep 10 18: 9:39 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 C206D37B400; Tue, 10 Sep 2002 18:09:35 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB67B43E42; Tue, 10 Sep 2002 18:09:34 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g8B19Y9R021629; Tue, 10 Sep 2002 19:09:34 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 10 Sep 2002 19:09:26 -0600 (MDT) Message-Id: <20020910.190926.94553760.imp@bsdimp.com> To: jmallett@FreeBSD.org Cc: fanf@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/uudecode uudecode.c From: "M. Warner Losh" In-Reply-To: <20020910145812.B78992@FreeBSD.org> References: <200209102053.g8AKrkvc055026@freefall.freebsd.org> <20020910145812.B78992@FreeBSD.org> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 In message: <20020910145812.B78992@FreeBSD.org> Juli Mallett writes: : * De: Tony Finch [ Data: 2002-09-10 ] : [ Subjecte: cvs commit: src/usr.bin/uudecode uudecode.c ] : > fanf 2002/09/10 13:53:46 PDT : > : > Modified files: : > usr.bin/uudecode uudecode.c : > 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) That's lots of places in the kernel that use 'if (ptr)' or 'if (!ptr)' but a lot of that code is new. Style(9) does say, however: Test pointers against NULL, e.g., use: (p = f()) == NULL not: !(p = f()) So the documented, preferred style is to use if (p != NULL) rather than if (p). Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message