From 2c8e8f8cecb16ce34c24ce4099b8ead7a7baea78 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 16 Jan 2014 12:58:06 +0700 Subject: [PATCH] Add switch statement to CodingStyle Requested-by: Thiago Macieira Signed-off-by: Dirk Hohndel --- CodingStyle | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CodingStyle b/CodingStyle index 9efd5f67a..82c86e59f 100644 --- a/CodingStyle +++ b/CodingStyle @@ -61,3 +61,17 @@ where the two meet, use your best judgment and go for best consistency (i.e., where does the variable "originate") + +- switch statements with blocks are a little bit special (to avoid indenting + too far) + + switch (foo) { + case FIRST: + whatever(); + break; + case SECOND: { + int i; + for (i = 0; i < 5; i++) + do_something(i); + } + } \ No newline at end of file