[Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Opinions about this?
>
> * init vars
> int foo(struct city *punit)
> {
> int x=punit->x;
> }
> or
> int foo(struct city *punit)
> {
> int x;
>
> x=punit->x;
> }
initialization at the time of declaring var can sometimes help very much
to understand the code. E.g.
struct *pplayer = unit_owner(punit);
is nice and clear. Some rules can be made wrt the ordering, like "first
come pure declarations then declarations + initializations"
So I vote 1 here.
> * empty line after vars
> int x;
> x=3;
> or
> int x;
>
> x=3;
empty line helps.
vote 2.
> * comments
> x=3; /* assign 3 to x */
>
> or
> /* assign 3 to x */
> x=3;
either way, unless commentary is very long in which case 2.
>
> * extra {} on iterates
extra {} do not hurt but I don't really care.
G.
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
- [Freeciv-Dev] Re: [UPDATE] Corecleanup_08 patch to cvs-Sep28, (continued)
- [Freeciv-Dev] AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Gregory Berkolaiko, 2001/10/05
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Ross W. Wetmore, 2001/10/09
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Raimar Falke, 2001/10/09
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Gregory Berkolaiko, 2001/10/09
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Raimar Falke, 2001/10/09
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Reinier Post, 2001/10/09
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Raimar Falke, 2001/10/09
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch),
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Raahul Kumar, 2001/10/10
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Ross W. Wetmore, 2001/10/09
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Raimar Falke, 2001/10/10
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Gregory Berkolaiko, 2001/10/09
- [Freeciv-Dev] Re: AI - cleaning (Was: Re: [UPDATE] Corecleanup_08 patch), Ross W. Wetmore, 2001/10/09
- [Freeciv-Dev] Re: AI - cleaning, Gregory Berkolaiko, 2001/10/10
- [Freeciv-Dev] Re: AI - cleaning, Ross W. Wetmore, 2001/10/12
[Freeciv-Dev] Re: [UPDATE] Corecleanup_08 patch to cvs-Sep28, Gaute B Strokkenes, 2001/10/14
|
|