Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: PATCH: remove map_adjust_[xy] invocations from server
Home

[Freeciv-Dev] Re: PATCH: remove map_adjust_[xy] invocations from server

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: PATCH: remove map_adjust_[xy] invocations from server (PR#989)
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Tue, 09 Oct 2001 02:58:28 -0400

I have lost context on these so you may be right that the x,y values
are always guaranteed to be real.

But the assert is useful to check this when you may still be passing
unreal coordinates (as in tilespec.c() and other places that still 
have (x+1,y-1) type code constructs).

Note that "real" is not always "normalized", so that normalize_map_pos
(i.e. normalization) is often still required. The code does not yet
guarantee that passed coordinates are always normalized as well as real.
You want to go slower in things like map.c changes elsewhere.

If there had been an if(normalized_map_pos()), then you would definitely
be right, all the time.

At 11:32 AM 01/10/05 +0200, Raimar Falke wrote:
>On Fri, Oct 05, 2001 at 01:43:57AM -0700, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
>> +  assert(is_real_tile(x, y));
>> +  normalize_map_pos(&x, &y);
>
>is_real_tile is unnecessary.
>
>> +  assert(is_real_tile(x, y));
>> +  normalize_map_pos(&x, &y);
>
>Same.
>
>> +  assert(is_real_tile(x, y));
>> +  normalize_map_pos(&x, &y); /* Should be handled by caller.  --JDS */
>
>Same.
>
>       Raimar
>
>-- 
> email: rf13@xxxxxxxxxxxxxxxxx
> "I was dead ... but I'm better now."
>    -- Capitain Sheridan in Babylon 5
>
>



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