From 255ad2bdf03c6fd76d82362459ba99707792e177 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 25 Oct 2011 15:15:09 -0700 Subject: [PATCH] add details for brace usage for one lineers to coding style recommendations --- docs/contributing.markdown | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/contributing.markdown b/docs/contributing.markdown index ea9da0cc6..f421bc368 100644 --- a/docs/contributing.markdown +++ b/docs/contributing.markdown @@ -80,9 +80,9 @@ If you see bits of code around that do not follow these please don't hesitate to #### Function definitions should not be separated from their arguments: - void foo(int a) { ... } // please + void foo(int a) // please - void foo (int a) { ... } // no + void foo (int a) // no #### Separate arguments by a single space: @@ -96,7 +96,18 @@ If you see bits of code around that do not follow these please don't hesitate to if(a==b) // no -#### Braces should ideally be on a separate line: +#### Braces should always be used: + + if (!file) + { + throw mapnik::datasource_exception("not found"); // please + } + + if (!file) + throw mapnik::datasource_exception("not found"); // no + + +#### Braces should be on a separate line: if (a == b) {