From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mgi47-0002hV-Lk for qemu-devel@nongnu.org; Thu, 27 Aug 2009 12:43:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mgi43-0002UA-46 for qemu-devel@nongnu.org; Thu, 27 Aug 2009 12:43:11 -0400 Received: from [199.232.76.173] (port=46047 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mgi42-0002Tv-Qn for qemu-devel@nongnu.org; Thu, 27 Aug 2009 12:43:06 -0400 Received: from mail.gmx.net ([213.165.64.20]:49438) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Mgi42-0007c6-58 for qemu-devel@nongnu.org; Thu, 27 Aug 2009 12:43:06 -0400 Date: Thu, 27 Aug 2009 18:43:00 +0200 From: Reimar =?iso-8859-1?Q?D=F6ffinger?= Subject: Re: [Qemu-devel] [PATCH] Remove typedef for bool from eepro100.c Message-ID: <20090827164300.GA4185@1und1.de> References: <1251376284-22426-1-git-send-email-amit.shah@redhat.com> <20090827124546.GA5912@1und1.de> <4A96B388.1070309@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4A96B388.1070309@mail.berlios.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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.