Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] more small directional cleanups
Home

[Freeciv-Dev] Re: [PATCH] more small directional cleanups

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Trent Piepho <xyzzy@xxxxxxxxxxxxx>, Freeciv-dev mailing list <freeciv-dev@xxxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [PATCH] more small directional cleanups
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Mon, 20 Aug 2001 20:36:55 -0400

While I stand corrected on the need for an is_normalized_map_pos(), it 
should be noted that is_real_tile() is almost always sufficient as a
simple check because if it passes you know you can normalize.

If you are checking to see if the coordinates are normalized so you 
don't have to call normalize_map_pos() this is false economy, as that
function doesn't do anything to the coordinates if they are normalized.

The only time you would need it is if you want to work on unnormalized
map positions for some reason. I can't think of a case in the code where
you need to guarantee that the coordinates are not normalized.

So, even if the function goes in, it should almost always never be used
in favour of the simpler existing ones.

A comment to this effect should be placed beside it.

Cheers,
RossW
=====

At 06:09 PM 01/08/20 +0200, Raimar Falke wrote:
>On Mon, Aug 20, 2001 at 08:56:22AM -0700, Trent Piepho wrote:
>> On Mon, 20 Aug 2001, Raimar Falke wrote:
>> > 
>> > Instead of replacing map_adjust_x/map_adjust_y with normalize_map_pos
>> > I would like to see in the medium term a call to
>> > ensure_real_and_normalized_position();
>> 
>> could_you_make_that_name_any_longer() ? "yes" : "no";
>
>It looks like the discussion about this topic just stopped without
>coming to a conclusion what to do. And a big part of the thread was
>just about definitions. So I made as as explicit as possible. So what
>about "is_normalized_pos" and "ensure_normalized_pos"? Where
>normalized is from my A,B,C definition.
>
>       Raimar
>-- 
> email: rf13@xxxxxxxxxxxxxxxxx




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