Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: [PATCH] Use is_real_tile() everywhere.
Home

[Freeciv-Dev] Re: [PATCH] Use is_real_tile() everywhere.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gaute B Strokkenes <gs234@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Use is_real_tile() everywhere.
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 14 Oct 2001 22:52:01 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Oct 14, 2001 at 09:42:25PM +0100, Gaute B Strokkenes wrote:
> On Sun, 14 Oct 2001, hawk@xxxxxxxxxxxxxxxxxxxxxxx wrote:
> > On Sun, Oct 14, 2001 at 08:17:08PM +0100, Gaute B Strokkenes wrote:
> >> 
> >> I spotted some places where is_real_tile() is not being used.
> > 
> > The (now) correct patch is to use is_normal_map_pos. is_real_tile
> > will also allow wrapped map positions.
> 
> No.
> 
> Firstly, the client GUIs do their own coordinate normalisation magic,
> and I'm reluctant to change the semantics unless someone can assure me
> that the change is a good one.

Yes. I'm wrong. The function with the same sematic is is_real_tile and
not is_normal_map_pos.

> Secondly, no piece of code in Freeciv should ever produce
> un-normalised coordinates, ever.

Ack.

> Corollary: no piece of code in Freeciv should ever have to check if
> a given pair of coordinates is indeed normalised.  (The exception is
> off course consistency checks/asserts where this is precisely the
> right check.)

Ack.

> Thus nilly-willy replacement of is_real_tile() with a check for
> normalisation as well is definitely the wrong fix (and also a
> pessimising fix.)

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "The two rules for success in life are:
  1) Never tell them everything you know."


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