[Freeciv-Dev] Re: (PR#3450) square_iterate and unreal positions
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, Feb 17, 2003 at 02:51:27AM -0800, Jason Short wrote:
> Raimar Falke wrote:
> > On Mon, Feb 17, 2003 at 12:08:37AM -0800, Jason Short wrote:
> >
> >>For some reason square_iterate calls CHECK_MAP_POS on its center tile.
> >>This is a problem since it only shows up in debug mode and is not
> >>obvious to the programmer. And I really don't know why it does that (I
> >>wrote the code for it, some time ago).
> >>
> >>This CHECK_MAP_POS should probably be removed.
> >
> >
> > Why? It is a check which tests if the args given to square_iterate are
> > valid. We have the same checks in other functions/macros likesame_pos.
>
> The definition of 'valid' may change.
All map positions used should be normal. Non-normal map position
should be normalized immediately after they creation. MAPSTEP does
this for the most cases.
The only exception I know of in the current code is mapview. Because
here canvas positions are translated to and from map positions. This
can be avoided if we agree that the canvas only shows a tile at most
one time.
Nevertheless if such new macros are needed please put them into
client/mapview_common.h
> In one situation, it is okay for
> the center of the square to be an unreal position. In this case it is
> the (center_x+1,center_y+1) tile that determines the location of the square.
> This is an untraditional usage of square_iterate; it is also
> reasonable to say square_iterate should not be used in this way.
> But in that case we have the problem that developers are likely to
> misuse square_iterate.
With the assert we catch the misuses.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Real Users find the one combination of bizarre
input values that shuts down the system for days."
- [Freeciv-Dev] (PR#3450) square_iterate and unreal positions, Jason Short, 2003/02/23
- Message not available
- [Freeciv-Dev] Re: (PR#3450) square_iterate and unreal positions, Raimar Falke, 2003/02/24
- Message not available
- [Freeciv-Dev] Re: (PR#3450) square_iterate and unreal positions, Jason Short, 2003/02/24
- Message not available
- [Freeciv-Dev] Re: (PR#3450) square_iterate and unreal positions, Raimar Falke, 2003/02/24
- Message not available
- [Freeciv-Dev] Re: (PR#3450) square_iterate and unreal positions, Jason Short, 2003/02/24
- Message not available
- [Freeciv-Dev] Re: (PR#3450) square_iterate and unreal positions, Raimar Falke, 2003/02/24
- Message not available
- [Freeciv-Dev] Re: (PR#3450) square_iterate and unreal positions, Jason Short, 2003/02/24
- Message not available
- [Freeciv-Dev] Re: (PR#3450) square_iterate and unreal positions, Raimar Falke, 2003/02/24
- Message not available
- [Freeciv-Dev] Re: (PR#3450) square_iterate and unreal positions, rwetmore@xxxxxxxxxxxx, 2003/02/24
|
|