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

[Freeciv-Dev] Re: Profiling Civserver again

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Profiling Civserver again
From: Thue <thue@xxxxxxx>
Date: Thu, 2 Aug 2001 12:42:49 +0200

On Thursday 02 August 2001 01:31, Mike Kaufman wrote:
> Perhaps someone could answer this for me: why do we _have_ to assume
> possible X values outside [-map.xsize,2*map.xsize] ? When would this
> (legitimately) happen?
>
> If a function is (naughtily) setting X too big or small, let's
> correct the function. Grepping through the code, I don't see a
> massive number of places where map_adjust_x() is called. Ought not be
> that hard to track down. Someone please correct my naivete
>
> -mike

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.

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.

(Isn't this all because C89 is not powerfull enough? If we had inline 
functions we could replace the "%" with a "while" as in 
normalize_map_pos() and it would run fast enough)

-Thue


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