Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: Coding Style Guidelines
Home

[Freeciv-Dev] Re: Coding Style Guidelines

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Mike Kaufman <mkaufman@xxxxxxxxxxxxxx>
Cc: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Coding Style Guidelines
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jan 2002 21:28:08 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Fri, Jan 11, 2002 at 01:42:37PM -0600, Mike Kaufman wrote:
> > > >>- Spaces should go before and after operators, and after commas:
> > > > 
> > > > indent takes care of this.
> > > 
> > > indent covers a lot of things, but some of them should perhaps be 
> > > explicitly mentioned anyway.
> > > 
> 
> I agree. not everybody looks up exactly what indent does.
> Not everybody uses it. The more important things should be explicitly
> mentioned.
> 
> >  
> > > >>- Always prototype global functions in the appropriate header file.
> > > >>  Local functions should always be declared as static.
> > > > 
> > > > Use "-Wmissing-prototypes -Wmissing-declarations" to catch these.
> > > 
> > > Shouldn't that then be "Local functions should always be declared as 
> > > static and prototyped at the top of the file"?
> 
> these should be added to the Makefile if necessary, not put into the
> style guide.
> 
> > I have no problem if only the needed prototypes are provided for
> > static functions.
> > 
> >     Raimar

> - If an empty block is needed you should put an explanatory comment:

- If an empty block is needed you should put an explanatory comment in
  an empty block (i.e. {}):

>   while(*i++) {
>     /* nothing */
>   }

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "There are three ways to get something done. Do it yourself, hire someone
  to do it for you or forbid your kids to do it."


[Prev in Thread] Current Thread [Next in Thread]