Browse Source

CodingGuidelines: mention C whitespace rules

We are fairly consistent about these, so most are covered by
"follow existing style", but it doesn't hurt to be explicit.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Jeff King 11 years ago committed by Junio C Hamano
parent
commit
f57b6cfdf7
  1. 11
      Documentation/CodingGuidelines

11
Documentation/CodingGuidelines

@ -126,6 +126,17 @@ For C programs: @@ -126,6 +126,17 @@ For C programs:
"char * string". This makes it easier to understand code
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.

if (bla) {

Loading…
Cancel
Save