X coding style

Keith Packard keithp at keithp.com
Mon May 8 07:58:55 PDT 2006


On Mon, 2006-05-08 at 10:04 -0400, Adam Jackson wrote:

> But if you want the brief summary, it's K&R, and the rationale is that it's 
> _the_ common style.

No, it's not K&R; at a minimum, we use a mixture of spaces and tabs to
achieve 4-character cell indentation almost everywhere. Plus, in the X
server, the general format is:

    if (foo)
    {
	indented body
    }
    else
    {
	indented else
    }

while K&R uses

	if (foo) {
		indented body
	} else {
		indented else
	}

I don't care which you use in your own code, but do try to precisely
match the code in which you are working when making changes.
-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20060508/4496cdd7/attachment.pgp>


More information about the xorg mailing list