Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 2002 10:15:48 -0700
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Tony Finch <fanf@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/uudecode uudecode.c
Message-ID:  <20020911101548.A46043@FreeBSD.org>
In-Reply-To: <20020911205548.E1092-100000@gamplex.bde.org>; from bde@zeta.org.au on Wed, Sep 11, 2002 at 09:01:50PM %2B1000
References:  <20020910145812.B78992@FreeBSD.org> <20020911205548.E1092-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* De: Bruce Evans <bde@zeta.org.au> [ Data: 2002-09-11 ]
	[ Subjecte: Re: cvs commit: src/usr.bin/uudecode uudecode.c ]
> On Tue, 10 Sep 2002, Juli Mallett wrote:
> 
> > * De: Tony Finch <fanf@FreeBSD.org> [ 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.

If you have bit overlap, you may get false positive/negative, though sometimes
that may be what is intended.
-- 
Juli Mallett <jmallett@FreeBSD.org>       | FreeBSD: The Power To Serve
Will break world for fulltime employment. | finger jmallett@FreeBSD.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020911101548.A46043>