[Openais] openais coding style
Hans Feldt
Hans.Feldt at ericsson.com
Tue Apr 4 03:33:33 PDT 2006
(at least) two errors:
* one space before closing parenthesis
- Don't know what I thought about, remove!
* functions preferably named _
- ???
Regards,
Hans
Steven Dake wrote:
> Great work Hans
>
> On the web at
>
> http://developer.osdl.org/dev/openais/devstyle.html
>
> regards
> -steve
>
> On Fri, 2006-03-31 at 13:17 +0200, Hans Feldt wrote:
>
>>Here's the updated style guide. Comments?
>>
>>/Hans
>>
>>
>>Spacing:
>>==========
>>- indentation: one tab stop
>>- one space before opening parenthesis
>>- no space after opening parenthesis
>>- one space before closing parenthesis
>>- one space after a comma: foo (x, y) not foo (x,y)
>>- one space around operators (x == y, x && y, x != y, x = y, ...)
>>- no space around . and ->
>>
>>Bracing:
>>==========
>>- opening brace on the same line as if, else, for, switch, case & while
>>- else on the same line as if closing brace
>>- braces in case statements allowed (if new scope needed) but not required
>>- open and close braces for functions on own separate lines.
>>- opening and closing braces required even for single line if, for,
>>while statements
>>
>>Naming:
>>==========
>>- use low case
>>- use descriptive names
>>- words separated with underscore
>>- functions preferably named <object>_<verb>
>>
>>Misc:
>>==========
>>- Max 3 levels of indentation recommended
>>- Max line length 80 chars or less
>>- Functions should be short and do one thing
>>- Pointer comparisons with NULL not 0
>>- Comments, see example
>>- C++ comments not allowed
>>- No multiple statements on a single line
>>- gotos OK for centralized exit of functions
>>- When in doubt, check Steven's code and K&R C book
>>
>>
>>Dummy almost compilable example attached.
>>
>>
>>_______________________________________________
>>Openais mailing list
>>Openais at lists.osdl.org
>>https://lists.osdl.org/mailman/listinfo/openais
>
>
>
More information about the Openais
mailing list