Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] city_map_iterate cleanup
Home

[Freeciv-Dev] Re: [PATCH] city_map_iterate cleanup

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Cc: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] city_map_iterate cleanup
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Wed, 22 Aug 2001 20:39:25 -0400

My apologies. 

You have. I wasn't watching the +/-'s very carefully (says he sheepishly).

Cheers,
RossW
=====

At 06:33 PM 01/08/22 -0400, Jason Dorje Short wrote:
>"Ross W. Wetmore" wrote:
>> 
>> PLEASE don't use normal user variables in iteration macros. Even with
>> the proliferation of weird and wonderful uniqueness prefixes and
>> suffixes this is very bad coding form.
>
>I thought that's exactly what I did...?
>
>What's wrong with the following?
>
>#define map_city_radius_iterate(city_x, city_y, x_itr,
>y_itr)                 \
>{                                                                            
>\
>  int _city_x = (city_x), _city_y =
>(city_y);                                 \
>  city_map_iterate(_city_x_itr, _city_y_itr)
>{                                \
>    int x_itr = _city_x + _city_x_itr -
>CITY_MAP_SIZE/2;                      \
>    int y_itr = _city_y + _city_y_itr -
>CITY_MAP_SIZE/2;                      \
>    if (!normalize_map_pos(&x_itr, &y_itr)) continue;
> 
>
>#define
>map_city_radius_iterate_end                                           \
>  }
>city_map_iterate_end;                                                    
>\
>}
>
>
>jason
>



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