[compiz] Re: compiz coding style

moppsy moppsy at comcast.net
Sun Oct 8 18:34:45 PDT 2006


On Thu  5.Oct'06 at 16:12:48 -0400, David Reveman wrote:
> 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
>

Thanks.

I fixed template.c to match existing plugins format.
The created source files format will still need a little attention.

http://home.comcast.net/~moppsy/compiz-template.tar.bz2



More information about the compiz mailing list