[U-Boot] [PATCH 2/2] musb: sunxi: Implement dfu_usb_get_reset()

Ian Campbell ijc+uboot at hellion.org.uk
Sun Oct 25 20:22:00 CET 2015


On Sun, 2015-10-25 at 14:22 +0100, Albert ARIBAUD wrote:
> On Sun, 25 Oct 2015 12:40:45 +0000, Ian Campbell
> > Doesn't the bool return type already cause that to happen? (from the
> > PoV of the caller at least)
> 
> When all is said and done, a C bool is a C int,

Not if it is a _Bool (via stdbool.h or some other way).

A _Bool is always either 0 or 1, and scalar value which is converted to
a _Bool is converted to either 0 or 1.

> So no, types, bool or otherwise, do not cause any implicit '!!' to
> happen.

I believe this is not correct when _Bool is used.

In u-boot a bool is indeed a _Bool (or at least I don't see any other
typedef's and I can see various includes on stdbool.h, I therefore
didn't feel the need to check how bool is arrived at in this particular
file).

Ian.


More information about the U-Boot mailing list