[Freeciv-Dev] Re: (PR#8982) City.c cleanup
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<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
- [Freeciv-Dev] Re: (PR#8982) City.c cleanup,
Jason Short <=
|
|