<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Coding Style</title><link>https://sourceforge.net/p/twocan/wiki/Coding%2520Style/</link><description>Recent changes to Coding Style</description><atom:link href="https://sourceforge.net/p/twocan/wiki/Coding%20Style/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 05 Mar 2012 06:24:46 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/twocan/wiki/Coding%20Style/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Coding Style modified by Dmitri Becker</title><link>https://sourceforge.net/p/twocan/wiki/Coding%2520Style/</link><description>&lt;pre&gt;--- v5 
+++ v6 
@@ -94,26 +94,65 @@
 
 The braces of function bodies should be on their own lines.
 
+    :::C
+    /* Brace opening struct body is NOT on a new line */
+    struct SomeStruct {
+      int   mbrA;
+      int   mbrB;
+    };
+
+    /* Brace opening array initializer is also not on a new line */
+    /* Note that in this example, the left-side comments are indented
+     * by the usual amount, rather than the actual element values -- we
+     * indent for readability, so its the visual effect that matters. */
+    int anArray[0x20] = {
+      /*            0/8   1/9   2/A   3/B   4/C   5/D   6/E   7/F */
+      /* 00-07 */  1234, 2345, 3456, 4567, 5678, 6789, 7890, 8901,
+      /* 08-0F */  9012,  123, 1234, 2345, 3456, 4567, 5678, 6789,
+      /* 10-17 */  7890, 8901, 9012,  123, 1234, 2345, 3456, 4567,
+      /* 18-1F */  5678, 6789, 7890, 8901, 9012,  123, 1234, 2345
+    };
+
+    int someFunc(int x)
+    {
+      /* For function bodies, opening brace is on a new line. */
+      /* Braces are not indented, but the contents are. */
+      int y,z;
+
+      if (x &gt; 0) {
+        /* Braces stay with adjacent 
+         * branch/control structure keywords */
+        y = x;
+        z = 2 * x;
+      } else {
+        /* braces stay with 'else' too */
+        y = 0;
+        z = 2 * x;
+      }
+
+      return y + z;
+    }
+
 ### Parentheses
 
 Parentheses should not have spaces added on the inner side unless it aids clarity (for example, to make the grouping clearer with nested parentheses).
 
 A large expression with many nested sets of parentheses may be split onto multiple lines so that the different nesting levels can be shown with indentation, provided that all the additional lines are noticeably indented.
 
     :::C
     /* no spaces around parentheses normally */
     x = ((y + 7) * (32 * x + 1));
     
     /* An exception can be made for deeply nested sets.. */
     qrs = ( ((x + y) / 2) * (3 - ((y + 42) / z)) ) + 8;
 
     /* ...or if it gets really complex, you might indent.  Note that although
      * the lines don't wrap at any particular nesting level, the indentation
      * of the start of each line matches the nesting level. */
     if ( ( (x + y + foobar(52, x + 4) * 17 &gt; 302) &amp;&amp;
            (x + y + z + t + u + v &lt; 77) ) ||
          ( (x &gt; y) &amp;&amp; (y &gt; z) &amp;&amp; (z &gt; t) ) ) {
-      ...
+      /* ... */
     }
     
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dmitri Becker</dc:creator><pubDate>Mon, 05 Mar 2012 06:24:46 -0000</pubDate><guid>https://sourceforge.net719396d89a1947676cf37fc7a3adb9f281d5995e</guid></item><item><title>WikiPage Coding Style modified by Dmitri Becker</title><link>https://sourceforge.net/p/twocan/wiki/Coding%2520Style/</link><description>&lt;pre&gt;--- v4 
+++ v5 
@@ -98,13 +98,33 @@
 
 Parentheses should not have spaces added on the inner side unless it aids clarity (for example, to make the grouping clearer with nested parentheses).
 
-No spaces should be added between a function name and the parentheses of its parameter list.
-
 A large expression with many nested sets of parentheses may be split onto multiple lines so that the different nesting levels can be shown with indentation, provided that all the additional lines are noticeably indented.
 
+    :::C
+    /* no spaces around parentheses normally */
+    x = ((y + 7) * (32 * x + 1));
+    
+    /* An exception can be made for deeply nested sets.. */
+    qrs = ( ((x + y) / 2) * (3 - ((y + 42) / z)) ) + 8;
+
+    /* ...or if it gets really complex, you might indent.  Note that although
+     * the lines don't wrap at any particular nesting level, the indentation
+     * of the start of each line matches the nesting level. */
+    if ( ( (x + y + foobar(52, x + 4) * 17 &gt; 302) &amp;&amp;
+           (x + y + z + t + u + v &lt; 77) ) ||
+         ( (x &gt; y) &amp;&amp; (y &gt; z) &amp;&amp; (z &gt; t) ) ) {
+      ...
+    }
+    
+
+No spaces should be added between a function name and the parentheses of its parameter list: So use `someFunction(5);` and not `someFunction (5);`.
+
 ### Square Brackets
 
-Do not add spaces around square brackets, inside or outside.
+Do not add spaces between square brackets and their contents, between brackets and the identifier or expression they index, or between adjacent sets of square brackets.  For example:
+
+    :::C
+    arr[i][j] = (ptr + i)[j % 10];
 
 ## Miscellaneous &lt;a name="misc"&gt;&lt;/a&gt;
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dmitri Becker</dc:creator><pubDate>Mon, 05 Mar 2012 05:00:13 -0000</pubDate><guid>https://sourceforge.netdac2a4fa3c70cd514ee9998ecf2335613ed233cd</guid></item></channel></rss>