lkml.org 
[lkml]   [2006]   [Aug]   [29]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 29 Aug 2006 07:58:57 +0200 (MEST)
FromJan Engelhardt <>
SubjectRe: Conversion to generic boolean
>> I was kinda planning on merging it ;)
>> 
>> I can't say that I'm in love with the patches, but they do improve the
>> situation.
>> 
>> At present we have >50 different definitions of TRUE and gawd knows how
>> many private implementations of various flavours of bool.
>> 
>> In that context, Richard's approach of giving the kernel a single
>> implementation of bool/true/false and then converting things over to use
>> it
>> makes sense.  The other approach would be to go through and nuke the lot,
>> convert them to open-coded 0/1.
>
> Well... we are programming in C here, aren't we ;)

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.)

Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-29 08:07    [from the cache]
©2003-2008