[email protected] writes:
> On (06/02/09 10:20), James Carlson wrote:
> > 
> > It'd be nice to be doing bit tests with "!" rather than "== 0".  The
> > former seems much more legible to me.
> > 
> 
> Do you mean this:
> 
>   if (!(nce->nce_flags & NCE_F_PERMANENT)) {

Yes.  The above reads as "not permanent" to me.  The equality test
version reads as "permanent is zero."

> (I have seen both styles used in the code, in different places)

Yep.  I just dislike using "==" and "!=" for bit tests unless doing
something tricky, such as testing multiple bits at once under a mask.
Simple booleans (no matter how implemented) should read right.

-- 
James Carlson, Solaris Networking              <[email protected]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to