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: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Wed, 05 Dec 2001 20:07:19 -0500

At 10:06 AM 01/12/05 -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
>Raimar Falke wrote:
>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, 
[...]
>  So doing without 
>should be fine.
>
>jason

That's really a sensible coding practice - good thing its just a game :-).

Cheers,
RossW
=====




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