Much of this is lifted from the XFree86 CODING doc, which describes the xfree86 DDX and (to a lesser extent) the DIX layer as well.
- Four-space indents
- camelCase function names
- 78-column limit
Function return type (and any modifiers, eg static) on a line by itself
Keywords punctuated like if (x >= 0)
Functions punctuated like doSomethingClever(a, b, c);
Opening curly brace on the same line as the control construct: if (foo) {
Closing braces aligned with the keyword that opened them (K&R not GNU)
else on the same line as the closing } of the preceding if
- Opening curly brace for functions in column 0
case aligned in the same column as the switch
- Wrap structs in typedefs
ANSI prototypes for all new code; convert K&R declarations to ANSI with care
Notable objectionable things in the current coding style:
- Most structs have a typedef both for the struct and for a pointer to the struct.


