[U-Boot] [Patch v2] Introduce a global bool type

Allen Martin amartin at nvidia.com
Sat Jan 19 05:47:40 CET 2013


On Mon, Jan 07, 2013 at 03:55:48PM -0800, York Sun wrote:
> 'bool' is defined in random places. This patch consolidates them into a
> single typedef, using _Bool introduced in C99.
> 
> Signed-off-by: York Sun <yorksun at freescale.com>
> ---
> Change since v1:
>  Move 'false' and 'true' to the common header file.
> 
> Need help from other arch maintainers to test it. I could only test powerpc.
> 

Thank you for taking this on, it's definately in need of cleanup. 

There are also many duplicate definitions of the upper case variants
(BOOL/TRUE/FALSE).  Those should get fixed too.


> +typedef _Bool bool;
> +#define false 0
> +#define true 1
> +

Linux defines true/false as an enum type in stddef.h, since u-boot
already has a copy of this Linux header, shouldn't it go in there?

-Allen
-- 
nvpublic


More information about the U-Boot mailing list