All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Reimar Döffinger" <Reimar.Doeffinger@gmx.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Remove typedef for bool from eepro100.c
Date: Thu, 27 Aug 2009 18:43:00 +0200	[thread overview]
Message-ID: <20090827164300.GA4185@1und1.de> (raw)
In-Reply-To: <4A96B388.1070309@mail.berlios.de>

On Thu, Aug 27, 2009 at 06:25:44PM +0200, Stefan Weil wrote:
> Reimar Döffinger schrieb:
> > 2) all assignments to bool variable are converted to 0/1 which could
> > make a speed difference (not here since the code actually does that
> > explicitly).
> >   
> 
> Only C++ compilers do convert bool assignments to false / true.

Better learn the language you use.
>From the C99 spec:
  6.3.1.2 Boolean type
  1 When any scalar value is converted to _Bool, the result is 0 if the value compares equal
    to 0; otherwise, the result is 1.

stdbool.h defines bool to _Bool. As such the typedef is a horrible idea
since it behaves wrong.

      reply	other threads:[~2009-08-27 16:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27 12:31 [Qemu-devel] [PATCH] Remove typedef for bool from eepro100.c Amit Shah
2009-08-27 12:45 ` Reimar Döffinger
2009-08-27 14:00   ` Laurent Desnogues
2009-08-27 14:42     ` Reimar Döffinger
2009-08-27 14:59       ` Jamie Lokier
2009-08-27 16:25   ` Stefan Weil
2009-08-27 16:43     ` Reimar Döffinger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090827164300.GA4185@1und1.de \
    --to=reimar.doeffinger@gmx.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.