From 264ede77f8835472105bb4c84c33c5d0dd12f619 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 19 May 2016 11:57:44 -0400 Subject: [PATCH] Update coding style document for macro style MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- CodingStyle | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/CodingStyle b/CodingStyle index 1d8bd9b43..6ff931b15 100644 --- a/CodingStyle +++ b/CodingStyle @@ -31,14 +31,22 @@ enum my_enum { #define DEFAULT_VALUE_OF_SOME_SORT 6 #define THE_ANSWER 42 -Use space to indent the '\' at the end but tabs at the beginning. +Use either a single space or tabs to indent the '\' at the end of lines. +Use tabs at the beginning of lines. -#define a_macro(x) \ - do { \ - fsync(); \ +Either: + +#define a_macro(x) \ + do { \ + fsync(); \ } while (0) -It's really the only time we use spaces. For everything else, there is TABS! :) +or + +#define a_macro(x) \ + do { \ + fsync(); \ + } while (0) Here is a pretty cool vim macro that will highlight your whitespaces and spaces before tab. This helps a *LOT* when coding. -- 2.34.1