Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again)
Home

[Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Mike Kaufman <mkaufman@xxxxxxxxxxxxxx>
Cc: Freeciv-Dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again)
From: Paul Zastoupil <paulz@xxxxxxxxxxxx>
Date: Thu, 2 Aug 2001 10:34:23 -0700

On Thu, Aug 02, 2001 at 12:36:45PM -0500, Mike Kaufman wrote:
> > 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.

While we are discussing all this map stuff, will someone please make a
patch to allow for maps to _not_ wrap?

-- 
Paul Zastoupil


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