Skip to Content.
Sympa Menu

ndt-dev - Re: [ndt-dev] c code style

Subject: NDT-DEV email list created

List archive

Re: [ndt-dev] c code style


Chronological Thread 
  • From: Dominic Hamon <>
  • To: Kavitha Kumar <>
  • Cc: , Aaron Brown <>
  • Subject: Re: [ndt-dev] c code style
  • Date: Tue, 30 Oct 2012 08:23:05 -0700

Hi Kavitha

I wonder if Eclipse is using some other definition of GNU style than the one I know[1] as it doesn't look much like GNU style. That has things like braces on column one for functions, structs, and enums, and the C code here has the braces in line with the first line of a block.

The existing code has quite a bit in common with Google standard[2] except for the indent being mostly 8 instead of 2. Let me know if changing the indent is something that you're passionate about as I know many people are.

I'm not sure if GNU indent can be persuaded to speak Google style, but it can definitely get part of the way there.

1. http://www.gnu.org/prep/standards/standards.html#Formatting
2. http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml


On Tue, Oct 30, 2012 at 4:21 AM, Kavitha Kumar <> wrote:
Hi Dominic,
 I used the GNU style formatting for the C code. I basically got lazy and used Eclipse to format my code.

 And when I did so, I made a separate commit for the formatted code alone so that it was easy to "number" it with svn.

HTH,
Kavitha

----- Original Message -----
> From: "Dominic Hamon" <>
> To: "Aaron Brown" <>
> Cc:
> Sent: Monday, October 29, 2012 3:36:09 PM
> Subject: Re: [ndt-dev] c code style
>
>
>
>
>
> On Mon, Oct 29, 2012 at 6:48 AM, Aaron Brown < >
> wrote:
>
>
>
> Hey Dominic,
>
>
>
>
> On Oct 26, 2012, at 4:10 PM, Dominic Hamon wrote:
>
>
>
> Is there an existing code style for the c code in ndt? I noticed that
> some of the files seem to have odd wrapping and indenting, but that
> might be a mistake due to merging in the past.

>
> I'd like to clean up the code formatting but I don't know what style
> to use.
>
> As long as it's standardized and easy to reproduce, I don't have a
> strong opinion on the matter. My only preference would be to use one
> that minimizes the amount of change from the existing scheme (to
> avoid unnecessary churn).
>
>
> I understand. My preference would be the Google C++ style (
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml )
> which is pretty much what ndt follows, except for the indentation.
>
>
> I'm happy to fix up the existing code to the style, but I understand
> that might be too much change 'just' for formatting. WDYT?
>
>
>
>
>
>
>
> Cheers,
> Aaron
>
>
> TIP2013, University of Hawaii Mānoa
> January 13 - January 17, 2013, Honolulu, HI
> http://events.internet2.edu/2013/tip/
>
>




Archive powered by MHonArc 2.6.16.

Top of Page