From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mva0T-0008Ul-TN for qemu-devel@nongnu.org; Wed, 07 Oct 2009 13:08:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mva0O-0008Pt-Te for qemu-devel@nongnu.org; Wed, 07 Oct 2009 13:08:53 -0400 Received: from [199.232.76.173] (port=39123 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mva0O-0008PY-Lv for qemu-devel@nongnu.org; Wed, 07 Oct 2009 13:08:48 -0400 Received: from mtaout03-winn.ispmail.ntl.com ([81.103.221.49]:23822) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mva0O-0001KK-4P for qemu-devel@nongnu.org; Wed, 07 Oct 2009 13:08:48 -0400 Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091007170837.BZGJ17277.mtaout03-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Wed, 7 Oct 2009 18:08:37 +0100 Received: from miranda.arrow ([213.107.24.213]) by aamtaout02-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20091007170837.JKYM21638.aamtaout02-winn.ispmail.ntl.com@miranda.arrow> for ; Wed, 7 Oct 2009 18:08:37 +0100 Received: from sdb by miranda.arrow with local (Exim 4.63) (envelope-from ) id 1Mva1Q-0000Fk-RZ for qemu-devel@nongnu.org; Wed, 07 Oct 2009 18:09:53 +0100 Date: Wed, 7 Oct 2009 18:09:52 +0100 From: Stuart Brady Subject: Re: [Qemu-devel] [PATCH] CODING_STYLE: {} as in linux kernel Message-ID: <20091007170952.GA938@miranda.arrow> References: <20091006190115.GA4768@redhat.com> <4ACCA1EA.4090509@redhat.com> <4ACCABA0.8080001@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ACCABA0.8080001@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, Oct 07, 2009 at 04:54:24PM +0200, Gerd Hoffmann wrote: > I somehow dislike the unneeded branches because it looks a bit > irritating to my eyes. I felt the same way at first, but I've become used to them, now. > They have advantages though. Making patches more readable is one, as > kevin and the nice example above clearly points out ;) Strictly, the example should be this: - if (a == 5) + if (a == 5) { printf("a was 5.\n"); - else if (a == 6) + } else if (a == 6) { printf("a was 6.\n"); + printf("multiply by 7 to get the answer.\n"); - else + } else { printf("a was something else entirely.\n"); + } versus: if (a == 5) { printf("a was 5.\n"); } else if (a == 6) { printf("a was 6.\n"); + printf("multiply by 7 to get the answer.\n"); } else { printf("a was something else entirely.\n"); } I know which one I prefer. :-) Cheers, -- Stuart Brady