Re: [patch 1/1] consolidate TRUE and FALSE

Anton Altaparmakov
2006-03-16T10:29:17Z

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/