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: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: buglet in normalization in init_new_game() (PR#1063)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Dec 2001 19:47:51 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Dec 05, 2001 at 10:06:13AM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> 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. 

I know. In the first version I added a comment which says so. Than I
removed it because of (2).

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

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 A life? Cool! Where can I download one?


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