[Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#10
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, 13 Oct 2001, hawk@xxxxxxxxxxxxxxxxxxxxxxx wrote:
> But in the long term we want normalized map positions and the code
> IS ready to 99%. So we should go IMHO the full way and just say that
> function arguements have to be normalized and deal with rest (~1%)
> in the next weeks and be done with it.
Now, that's the most sensible thing that anyone has said on this
subject in the last week or so.
Before one falls over one self trying to work out clever ways to come
up with functions/macros/spells that catch dodgy coordinates and then
either abort or try to fix the situation, it is worth remembering that
pretty much the only way that you will ever see one of these is if
you manually do what one of the _iterate macros do, not use MAPSTEP
where you should or if you do something like
map_get_tile(pcity->x +cx-2, pcity->y + cy-2).
We have removed pretty much all such constructs from the code base,
and unless someone does something really stupid we are unlikely to see
much more of them.
This is why I think the best thing would be to add this sort of check
to map_inx(). That way, we:
* Get an easy way to turn on comprehensive checking for unnormalised
coordinates if you are working on changes to that part of the
code.
* Avoid splattering explicit checks all over the code.
* Avoid the need to explicitly add a check in every single place we
use a coordinate pair, or pass it to another function.
The flip side is that you have to add an explicit check to places
where you do more complicated stuff, e.g. same_pos(). Off course, if
you wanted an explicit test everywhere then you would have to add one
there anyway.
--
Big Gaute http://www.srcf.ucam.org/~gs234/
It's so OBVIOUS!!
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), (continued)
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Thue, 2001/10/12
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Ross W. Wetmore, 2001/10/12
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Jason Dorje Short, 2001/10/12
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Ross W. Wetmore, 2001/10/15
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocationsfromserver (PR#1003), Jason Dorje Short, 2001/10/15
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Raimar Falke, 2001/10/15
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Ross W. Wetmore, 2001/10/15
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Raimar Falke, 2001/10/16
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Ross W. Wetmore, 2001/10/17
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Raimar Falke, 2001/10/13
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003),
Gaute B Strokkenes <=
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Raimar Falke, 2001/10/22
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Gaute B Strokkenes, 2001/10/22
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Raimar Falke, 2001/10/23
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Gaute B Strokkenes, 2001/10/23
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Raimar Falke, 2001/10/24
|
|