Merge branch 'jk/doc-coding-guideline'
Elaborate on a style niggle that has been part of "mimic existing code". * jk/doc-coding-guideline: CodingGuidelines: mention C whitespace rules
This commit is contained in:
@ -126,6 +126,17 @@ For C programs:
|
|||||||
"char * string". This makes it easier to understand code
|
"char * string". This makes it easier to understand code
|
||||||
like "char *string, c;".
|
like "char *string, c;".
|
||||||
|
|
||||||
|
- Use whitespace around operators and keywords, but not inside
|
||||||
|
parentheses and not around functions. So:
|
||||||
|
|
||||||
|
while (condition)
|
||||||
|
func(bar + 1);
|
||||||
|
|
||||||
|
and not:
|
||||||
|
|
||||||
|
while( condition )
|
||||||
|
func (bar+1);
|
||||||
|
|
||||||
- We avoid using braces unnecessarily. I.e.
|
- We avoid using braces unnecessarily. I.e.
|
||||||
|
|
||||||
if (bla) {
|
if (bla) {
|
||||||
|
Reference in New Issue
Block a user