Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] (PR#1227) is_real_tile -> is_real_map_pos
Home

[Freeciv-Dev] (PR#1227) is_real_tile -> is_real_map_pos

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#1227) is_real_tile -> is_real_map_pos
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 16 Feb 2003 16:29:16 -0800
Reply-to: rt@xxxxxxxxxxxxxx

[rfalke - Sat Feb 15 17:23:50 2003]:

> On Sat, Jan 12, 2002 at 07:21:54PM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx
> wrote:
> > Ross W. Wetmore wrote:
> >
> > >This should not be just a rename, but fix the definition and use as
> well.
> >
> > Many/most of the uses need fixing, but I'm not sure if this should
> all
> > be done in the same patch.  For one thing some of the
> implementations
> > are disagreed on.
> >
> > In reality, most of the "fixes" here can just get rid of the
> > is_real_map_pos check entirely.  Some can be replaced with
> > CHECK_MAP_POS, some with normalize_map_pos, and some just removed.
> But
> > there will be no agreement on how to do this, so I'll leave it be
> for now.
> 
> And the patch.

You have changed some assert(is_real_tile(x, y)) to CHECK_MAP_POS(x,y).
 This is not the same thing.  Are you sure it is correct?

If we 'fix' some usages by replacing them with CHECK_MAP_POS, shouldn't
we fix the others as well?  Many of the remaining calls are of the form

  assert(is_real_tile(x, y));
  normalize_map_pos(&x, &y);

which is better (faster, and easier for me to spot bugs in)

  if (!normalize_map_pos(&x, &y)) {
    assert(0);
  }

jason



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#1227) is_real_tile -> is_real_map_pos, Jason Short <=