From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Sun, 25 Oct 2015 22:16:01 +0100 Subject: [U-Boot] [PATCH 2/2] musb: sunxi: Implement dfu_usb_get_reset() In-Reply-To: <1445800920.28851.12.camel@hellion.org.uk> References: <1445748287-12421-1-git-send-email-siarhei.siamashka@gmail.com> <1445748287-12421-3-git-send-email-siarhei.siamashka@gmail.com> <201510251200.09867.marex@denx.de> <20151025124630.68a2f2e6@lilith> <1445776845.28851.5.camel@hellion.org.uk> <20151025142253.0641bc5f@lilith> <1445800920.28851.12.camel@hellion.org.uk> Message-ID: <20151025221601.79e05ae8@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Ian, On Sun, 25 Oct 2015 19:22:00 +0000, Ian Campbell wrote: > 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). What you write is possibly correct for C++, but certainly not for C, for which booleans are integers, with no compiler-enforced constraint on their value domains. Amicalement, -- Albert.1