From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N2J2P-0001Ln-Me for qemu-devel@nongnu.org; Mon, 26 Oct 2009 02:26:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N2J2O-0001LT-Ka for qemu-devel@nongnu.org; Mon, 26 Oct 2009 02:26:40 -0400 Received: from [199.232.76.173] (port=33922 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2J2O-0001LQ-Ew for qemu-devel@nongnu.org; Mon, 26 Oct 2009 02:26:40 -0400 Received: from hall.aurel32.net ([88.191.82.174]:48131) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N2J2O-0005bA-4c for qemu-devel@nongnu.org; Mon, 26 Oct 2009 02:26:40 -0400 Received: from [2002:52e8:2fb:1:21e:8cff:feb0:693b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1N2J2M-0003gS-CO for qemu-devel@nongnu.org; Mon, 26 Oct 2009 07:26:38 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.69) (envelope-from ) id 1N2J2L-0005eI-HU for qemu-devel@nongnu.org; Mon, 26 Oct 2009 07:26:37 +0100 Date: Mon, 26 Oct 2009 07:26:37 +0100 From: Aurelien Jarno Message-ID: <20091026062637.GA21562@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Subject: [Qemu-devel] [PATCH] CODING_STYLE: don't allow non-indented statements after if/else blocks List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Rationale: The following code is difficult to read, but allowed by the current coding style. if (a == 5) printf("a was 5.\n"); else if (a == 6) printf("a was 6.\n"); else printf("a was something else entirely.\n"); Signed-off-by: Aurelien Jarno --- CODING_STYLE | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CODING_STYLE b/CODING_STYLE index a579cb1..3ffbc3d 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -51,11 +51,11 @@ QEMU coding style. 4. Block structure -Every indented statement is braced; even if the block contains just one -statement. The opening brace is on the line that contains the control -flow statement that introduces the new block; the closing brace is on the -same line as the else keyword, or on a line by itself if there is no else -keyword. Example: +Every control flow statement is followed by a new indented and braced +block; even if the block contains just one statement. The opening brace +is on the line that contains the control flow statement that introduces +the new block; the closing brace is on the same line as the else keyword, +or on a line by itself if there is no else keyword. Example: if (a == 5) { printf("a was 5.\n"); -- 1.6.1.3