[Freeciv-Dev] map_adjust_x (was: Profiling Civserver again)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> How about this from gui-gtk/mapview.c:311
> map_adjust_x(map_view_x0+map_canvas_store_twidth)
> it is perfectly possible for map_canvas_store_twidth to be > map.xsize.
>
Yes, I agree that the stuff in mapview, etc is the problem, but, should it be
perfectly possible? (see my response to Reinier)
> True, you could check all uses. But to limit map_adjust_x like this
> would just make it into a minefield for programmers. Then rather have
> freeciv run a little bit slower IMO.
I can agree with the possible end result: if the general consensus is that
safer is better, then no problem. But I don't agree with the particular
reasoning. map_adjust_x() is like any other function or macro. If a programmer
wants to use it, then he had better know what it's going to do. If that takes
documenting the code, so be it. map_adjust_x() is not a safety net. It ought to
exist primarily because our game happens to wrap around in the x direction.
Input, by design, will go a bit out of bounds.
-mike
- [Freeciv-Dev] Re: Profiling Civserver again, (continued)
- [Freeciv-Dev] Re: Profiling Civserver again, Gaute B Strokkenes, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Paul Zastoupil, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Trent Piepho, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Mike Kaufman, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Mike Kaufman, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Raimar Falke, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again, Raimar Falke, 2001/08/06
- [Freeciv-Dev] Re: Profiling Civserver again, Thue, 2001/08/02
- [Freeciv-Dev] map_adjust_x (was: Profiling Civserver again),
Mike Kaufman <=
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Jason Dorje Short, 2001/08/02
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Thue, 2001/08/02
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Ross W. Wetmore, 2001/08/02
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Paul Zastoupil, 2001/08/02
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Gaute B Strokkenes, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again, Reinier Post, 2001/08/02
- [Freeciv-Dev] map_adjust_x (was: Profiling Civserver again), Mike Kaufman, 2001/08/02
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Reinier Post, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again, Vasco Alexandre Da Silva Costa, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/08/01
|
|