From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] [PATCH lttng-tools 3/4] Update coding style document for macro style
Date: Thu, 19 May 2016 11:57:44 -0400 [thread overview]
Message-ID: <1463673465-26888-4-git-send-email-mathieu.desnoyers@efficios.com> (raw)
In-Reply-To: <1463673465-26888-1-git-send-email-mathieu.desnoyers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
CodingStyle | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/CodingStyle b/CodingStyle
index 1d8bd9b..6ff931b 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.1.4
next prev parent reply other threads:[~2016-05-19 15:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-19 15:57 [lttng-dev] [PATCH lttng-tools 0/4] error.h message printing fixes Mathieu Desnoyers
2016-05-19 15:57 ` [lttng-dev] [PATCH lttng-tools 1/4] Fix: add missing semicolons after MSG, DBG, ERR print macros Mathieu Desnoyers
2016-05-19 18:02 ` Jérémie Galarneau
2016-05-19 15:57 ` [lttng-dev] [PATCH lttng-tools 2/4] Fix: coding style document has erroneous semicolon at end of macro Mathieu Desnoyers
2016-05-19 15:57 ` Mathieu Desnoyers [this message]
2016-05-19 15:57 ` [lttng-dev] [PATCH lttng-tools 4/4] Cleanup error.h __lttng_print() used for message printing Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463673465-26888-4-git-send-email-mathieu.desnoyers@efficios.com \
--to=mathieu.desnoyers@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox