Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: buglet in normalization in init_new_game() (PR#1063)
Home

[Freeciv-Dev] Re: buglet in normalization in init_new_game() (PR#1063)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: buglet in normalization in init_new_game() (PR#1063)
From: jdorje@xxxxxxxxxxxxxxxxxxxxx
Date: Wed, 5 Dec 2001 10:06:13 -0800 (PST)

Raimar Falke wrote:

<snip: circle_iterate patch>


Attached is an updated version which contains mostly style and comment
changes.
All of this looks good.



One point, though: the use of code like


int _center_x = (center_x), _center_y = (center_y);

in

#define blah_blah_blah(center_x, center_y, ...)
{
  int _center_x = (center_x), _center_y = (center_y);
  /* ... */

isn't just style. The purpose is to prevent center_x/center_y from being evaluated more than once, in case they're expressions with side effects. However, note: (1) there is no such usage anywhere in the code (nor should there be), (2) most other macros don't make this safety guarantee, and (3) in the case of wrapper macros, these names can sometimes conflict with each other (with bad results). So doing without should be fine.

jason





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