Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: cartesian_adjacent_iterate in map.h
Home

[Freeciv-Dev] Re: cartesian_adjacent_iterate in map.h

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: cartesian_adjacent_iterate in map.h
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 6 Feb 2002 11:07:21 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Feb 05, 2002 at 10:20:53PM +0000, Vasco Alexandre Da Silva Costa wrote:
> Anyone objects if i change that to:
> 
> #define cartesian_adjacent_iterate(x, y, IAC_x, IAC_y) \
> {                                                      \
>   int IAC_i;                                           \
>   int IAC_x, IAC_y;                                    \
>   CHECK_MAP_POS(x, y);                                 \
>   for (IAC_i = 0; IAC_i < 4; IAC_i++) {                \
>     IAC_x = CAR_DIR_DX[IAC_i];                       \
>     IAC_y = CAR_DIR_DY[IAC_i];                       \
>                                                              \
>     if (!normalize_map_pos(&IAC_x, &IAC_y))            \
>       continue;
> 
> #define cartesian_adjacent_iterate_end                 \
>   }                                                    \
> }

No. But splint has an option where it warns about constructs like
this:
 for(...)
 {
   for(...)
   {
     continue or break
   }
 }

with "are you sure that you didn't mean to continue/break the outer
loop"? I don't think it is a good idea to change freeciv to get no
such warning at all but in the above case in can be avoided without
cost.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "I heard if you play the NT-4.0-CD backwards, you get a satanic message."
 "That's nothing, if you play it forward, it installs NT-4.0"


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