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: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 14 Jun 2004 03:12:44 -0700
Reply-to: rt@xxxxxxxxxxx

<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.

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.

jason




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