lkml.org 
[lkml]   [2006]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 1/1] consolidate TRUE and FALSE
Hi,

On Thu, 16 Mar 2006, akpm@osdl.org wrote:
> From: Andrew Morton <akpm@osdl.org>
>
> We have no less than 65 implementations of TRUE and FALSE in the tree, so the
> inevitable happened:
[snip
>
> The patch implements TRUE and FALSE in include/linux/kernel.h and removes all
> the private versions.

Great! That has really been long overdue.

> Various places are doing things like
>
> typedef {
> FALSE,
> TRUE
> } my_fave_name_for_a_bool;
>
> These are converted to
>
> typedef int my_fave_name_for_a_bool;

Given that the kernel now requires gcc 3.2 or later, that already includes
a native boolean type (_Bool)? Why not use that instead of "int"?

Also <stdbool.h> contains:

#define bool _Bool
#define true 1
#define false 0

So we could take the bool rather than _Bool, too given _Bool looks
rather ugly...

We could even go as far as removing all those typedefs and replacing all
their uses with the native boolean type (or the "bool" define or
whatever). Seems like the perfect janitorial task to me. (-;

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
-
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-03-16 11:33    [W:0.116 / U:0.560 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site