You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Steve Cheng <st...@gmail.com> on 2009/10/24 02:01:37 UTC

C formatting conventions

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

Thank you,

Steven

Re: C formatting conventions

Posted by Patrick Hunt <ph...@apache.org>.
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

Posted by Steve Cheng <st...@gmail.com>.
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
>>>
>>>
>>
>>

Re: C formatting conventions

Posted by Patrick Hunt <ph...@apache.org>.
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
>>   
> 

Re: C formatting conventions

Posted by Benjamin Reed <br...@yahoo-inc.com>.
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

Posted by Patrick Hunt <ph...@apache.org>.
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" <st...@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

Posted by Mahadev Konar <ma...@yahoo-inc.com>.
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" <st...@gmail.com> wrote:

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