lkml.org 
[lkml]   [2006]   [Jul]   [23]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 23 Jul 2006 14:13:19 -0700
FromPaul Jackson <>
SubjectRe: [RFC][PATCH] A generic boolean (version 4)
The defines of false and true to be themselves are going to cause a
thousand code readers to say "wtf?".  How about a comment, as in:

 enum {
 	false	= 0,
 	true	= 1
 };
+
+/* Let any other #if[n]def's on false/true presume they're defined */
 #define false false
 #define true true 

===

On second thought, I just grep'd the entire kernel with:
	grep -E '#ifn*def.*(false|true)'
and only found exactly one other such #ifdef construct:
  drivers/media/video/cpia2/cpia2.h:
    #ifndef true
    #define true 1
    #define false 0
    #endif

Perhaps we should just drop the cpia2.h defines, and drop
the defines of false/true to be themselves.  And drop my
comment ;).

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401
-
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-07-23 23:19    [from the cache]
©2003-2008