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
Hi David, Sounds good to document coding style and stuff, however I think this and other development documentation should be kept somewhere in the net. I think it's a problem that compiz has no real webpage atm, information is splitted on the opensuse-wiki (which shouldn't be the central place for a distribution-independent project) and some lines on fdo. I'd suggest creating a webpage with a wiki connected that collects information like this (and also stuff like packages for various distros etc.) -- Hanno B?ck Blog: http://www.hboeck.de/ GPG: 3DBD3B20 Jabber: jabber@hboeck.de -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.freedesktop.org/archives/compiz/attachments/20061006/93d3ba63/attachment.pgp
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
Reasonably Related Threads
- restricted coefficient and factor in linear regression.
- {ARM} IfConversion does not detect BX instruction as a branch
- BBO doesnt work properly
- restricted coefficient and factor for linear regression.
- Invalid memory access / read stack overflow when reading config with zero bytes