Re: C formatting conventions

2009-10-24 Thread Steve Cheng
Hmm, well I did some alchemy and throwing these lines into my .emacs seems
to do the right thing.

(setq c-basic-offset 4)
 (setq c-default-style '((java-mode . java)
  (awk-mode . awk)
  (other . linux)))



On Fri, Oct 23, 2009 at 6:23 PM, Patrick Hunt ph...@apache.org wrote:

 not quite that simple I'm afraid ;-) some good friday reading if you
 haven't seen before

 http://kerneltrap.org/node/11

 perhaps we should use lindent on our code? whoops ... ;-)

 Patrick


 Benjamin Reed wrote:

 i think we follow linux coding conventions. i think i wrote most of the
 code using the linux emacs style.

 ben

 Steve Cheng wrote:

 Hi,
 What are the C formatting conventions for ZooKeeper? Couldn't find
 anything
 on the HowToContribute page.

 Thank you,

 Steven






C formatting conventions

2009-10-23 Thread Steve Cheng
Hi,
What are the C formatting conventions for ZooKeeper? Couldn't find anything
on the HowToContribute page.

Thank you,

Steven


Re: C formatting conventions

2009-10-23 Thread Mahadev Konar
Hi Steven,
  The most important is 4 space indentation (no tabs). Other than that, we
really don't have any specific guidelines on c code. Now that you mention
it, it would be good to have one. But as of now, we do not have one.

Thanks
mahadev

On 10/23/09 5:01 PM, Steve Cheng steve...@gmail.com wrote:

 Hi,
 What are the C formatting conventions for ZooKeeper? Couldn't find anything
 on the HowToContribute page.
 
 Thank you,
 
 Steven



Re: C formatting conventions

2009-10-23 Thread Patrick Hunt
No gratuitous reformatting. Would be nice to try and keep it looking 
like the code we already have...


Patrick

Mahadev Konar wrote:

Hi Steven,
  The most important is 4 space indentation (no tabs). Other than that, we
really don't have any specific guidelines on c code. Now that you mention
it, it would be good to have one. But as of now, we do not have one.

Thanks
mahadev

On 10/23/09 5:01 PM, Steve Cheng steve...@gmail.com wrote:


Hi,
What are the C formatting conventions for ZooKeeper? Couldn't find anything
on the HowToContribute page.

Thank you,

Steven




Re: C formatting conventions

2009-10-23 Thread Benjamin Reed
i think we follow linux coding conventions. i think i wrote most of the 
code using the linux emacs style.


ben

Steve Cheng wrote:

Hi,
What are the C formatting conventions for ZooKeeper? Couldn't find anything
on the HowToContribute page.

Thank you,

Steven
  




Re: C formatting conventions

2009-10-23 Thread Patrick Hunt
Ben, emacs? If so can you post your .emacs settings to the 
howtocontribute page? Cuz by default my emacs seems to want to do 2 
spaces indent...


Patrick

Benjamin Reed wrote:
i think we follow linux coding conventions. i think i wrote most of the 
code using the linux emacs style.


ben

Steve Cheng wrote:

Hi,
What are the C formatting conventions for ZooKeeper? Couldn't find 
anything

on the HowToContribute page.

Thank you,

Steven
  




Re: C formatting conventions

2009-10-23 Thread Patrick Hunt
not quite that simple I'm afraid ;-) some good friday reading if you 
haven't seen before


http://kerneltrap.org/node/11

perhaps we should use lindent on our code? whoops ... ;-)

Patrick

Benjamin Reed wrote:
i think we follow linux coding conventions. i think i wrote most of the 
code using the linux emacs style.


ben

Steve Cheng wrote:

Hi,
What are the C formatting conventions for ZooKeeper? Couldn't find 
anything

on the HowToContribute page.

Thank you,

Steven