www.nico.schottelius.org/software/cinit/browse_source/cinit-0.3pre4/doc/braindumps/coding-style
Nico Schottelius 423ba10303 import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-09-16 12:53:45 +02:00

49 lines
713 B
Text

Coding style
============
Nico Schottelius <nico-cinit]at[schottelius.org>
0.1, for cinit, Initial version from 2006-11-13
:Author Initials: NS
This document describes the coding style used in cinit.
Indent
------
Indent the code by 3 spaces for each level.
Unsorted
---------
Linebreaks:
if(...) {
} else {
}
do {
} while();
no spaces
- within braces and code "(!test)",
- before braces "if(code)"
spaces
- after braces "if(test) return 0;"
- spaces before and after '=' (a = b);
curly braces:
functions:
int func(int params)
{
body
}
comments:
where necessery, do not state the obvious in comments:
/* this code increments tmp */
++tmp;