Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] Re: (PR#8982) City.c cleanup
Home

[Freeciv-Dev] Re: (PR#8982) City.c cleanup

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: pim@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8982) City.c cleanup
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Mon, 14 Jun 2004 07:33:21 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8982 >

On Mon, 14 Jun 2004, Jason Short wrote:

>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8982 >
>
> Per Inge Mathisen wrote:
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=8982 >
> >
> > This patch makes some static to static inline, makes most struct city into
> > consts, cleans up some style issues and adds some comments. The primary
> > reason for the patch is to document what functions that change city
> > contents and which do not.
> >
> > The aim is to eventually separate out the calculation parts from the
> > modify-city code, so that the former can be used in AI code without
> > actually altering any city state.
>
> I'm not sure that changing arbitrary static functions to inline is a
> good idea.  It's extra clutter that will probably not be helpful for a
> good compiler.  A compiler that does good optimization (e.g., gcc -O3)
> should automatically inline static functions if it deems it to be better.

But -O3 is not the default. -O2 -g is.

> With static functions in headers, on the other hand, it's a different
> story.  The only reason you'd want a static function in the header is to
> inline it, and here adding the "inline" tag prevents gcc from giving a
> compile-time warning.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa






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