[compiz] compiz coding style

David Reveman davidr at novell.com
Thu Oct 5 13:12:48 PDT 2006


The coding style I use for compiz is very similar to what's used in the
xserver. This was the best I could get out of GNU indent.

indent -psl -saf  -sai -saw -sob -i4 -bbo -bls -lp -di1 -pcs -bs -cs -bl
-bli0 -cdb -sc -bad -bap -l78

The style in compiz is slightly different though. Function parameters
are aligned and I usually align function parameter names and variable
names too. I also cuddle up { in switch statements. Camel caps are used
and I'm pretty strict with keeping all lines less than 80 columns wide.
No extra whitespaces are allowed. Camel caps are not used for gtk code,
like in gtk-window-decorator.c, underscores are used here to match gtk
and cairo.

I don't necessarily prefer camel caps. I made the decision to use camel
caps in compiz core and it's plugins to match Xlib and OpenGL APIs.

Looking at the existing code is the easiest way to get what coding style
is used. It should be consistent.

For the code I'm maintaining I prefer patches with this coding style as
I'll otherwise have to reformat the them before I can apply them. 

-David



More information about the compiz mailing list