[Freeciv-Dev] Re: [PATCH] city_map_iterate cleanup
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
"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
|
|