Re: Conversion to generic boolean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> > I like it for the annotation we get.
> > 
> > 	int fluff;
> > 	if(fluff == 0)
> > 
> > This does not tell if fluff is an integer or a boolean (that is, what the
> > programmer intended to do -- not the 'int' the compiler sees).
> > If it had been if(!fluff), it would give a hint, but a lot of places also have
> > !x where x really is intended to be an integer (and should have been x==0 or
> > y==NULL resp.)
> >
> 
> Bool would not help much either unless declaration is immediately follows
> use. I like Alan Sterns proposal ofencode return value in function name
> better - actions should always return < 0/0 and predicates should always
> be boolean equivalent.

Sounds very reasonable. Even today, 90% of code follows that
convention. Perhaps adding it to codingstyle would help?

-- 
Thanks for all the (sleeping) penguins.

-- 
VGER BF report: H 0.254977
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux