[gnome-devel-docs] programming-guidelines: Section on whitespace



commit 8b90a22ec95bb5f66b634248d48987a0df6436a4
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Aug 6 17:20:40 2013 +0200

    programming-guidelines: Section on whitespace

 programming-guidelines/C/c-coding-style.page |   28 ++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/programming-guidelines/C/c-coding-style.page b/programming-guidelines/C/c-coding-style.page
index 3f7e002..003d6e3 100644
--- a/programming-guidelines/C/c-coding-style.page
+++ b/programming-guidelines/C/c-coding-style.page
@@ -461,4 +461,32 @@ align_function_arguments (first_argument,
     </code>
   </section>
 
+  <section id="whitespace">
+    <title>Whitespace</title>
+
+    <p>
+      Always put a space before an opening parenthesis but never after:
+    </p>
+
+    <code>
+/* valid */
+if (condition)
+        do_my_things ();
+
+/* valid */
+switch (condition) {
+}
+
+/* invalid */
+if(condition)
+        do_my_things();
+
+/* invalid */
+if ( condition )
+        do_my_things ( );
+    </code>
+  </section>
+
+
+
 </page>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]