[U-Boot] [PATCH] Introduce a global bool type

Wolfgang Denk wd at denx.de
Mon Jan 7 23:39:42 CET 2013


Dear York Sun,

In message <1357596628-27501-1-git-send-email-yorksun at freescale.com> you wrote:
> 'bool' is defined in random places. This patch consolidates them into a
> single typedef.

Has this been actually compile tested?

...
> --- a/include/linux/types.h
> +++ b/include/linux/types.h
> @@ -113,6 +113,8 @@ typedef		__u64		u_int64_t;
>  typedef		__s64		int64_t;
>  #endif
>  
> +typedef _Bool bool;

And what exactly would "_Bool" be?

...
> --- a/include/xyzModem.h
> +++ b/include/xyzModem.h
> @@ -97,11 +97,6 @@ typedef struct {
>  #endif
>  } connection_info_t;
>  
> -#ifndef	BOOL_WAS_DEFINED
> -#define BOOL_WAS_DEFINED
> -typedef unsigned int bool;
> -#endif
> -
>  #define false 0
>  #define true 1

And don't these remaining definitions of "false" and "true" cause
nasty build errors somewhere?


This seems broken to me.  Can we rather try8 and get rid of all this
"bool" stuff instead?  It's just obfuscating the code...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Perl itself is  usually  pretty  good  about  telling  you  what  you
shouldn't do. :-)     - Larry Wall in <11091 at jpl-devvax.JPL.NASA.GOV>


More information about the U-Boot mailing list