This page describes the X server's current coding style. While the server was recently reformatted to fit this style, most modules have varied and disparate coding styles. Above all, the cardinal rule is to fit in: make sure your changes reflect the coding style of the surrounding code.
We use the indent
command line in this script here: http://cgit.freedesktop.org/xorg/util/modular/tree/x-indent.sh with manual editing afterwards to fix the cases where indent gets hopelessly confused.
static
) on a line by itselfif (foo) {
else
on a new line from the closing } of the preceding if
(i.e. not cuddling)if (x >= 0)
doSomethingClever(a, b, c);
case
aligned in the same column as the switch
// foo
Notable objectionable things in the current coding style: