Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: [PATCH] check_map_pos change (PR#1031)
Home

[Freeciv-Dev] Re: [PATCH] check_map_pos change (PR#1031)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gaute B Strokkenes <gs234@xxxxxxxxx>
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [PATCH] check_map_pos change (PR#1031)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Oct 2001 10:42:33 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Oct 30, 2001 at 02:45:01AM +0000, Gaute B Strokkenes wrote:
> On Mon, 29 Oct 2001, vze2zq63@xxxxxxxxxxx wrote:
> 
> I propose the following:

Ok, but

>  signed short map_get_continent(int x, int y)
>  {
> -  if (!normalize_map_pos(&x, &y))
> +  if (!normalize_map_pos(&x, &y)) /* XXX */

??

>  enum tile_terrain_type map_get_terrain(int x, int y)
>  {
> -  if (!normalize_map_pos(&x, &y))
> +  if (!normalize_map_pos(&x, &y)) /* XXX */

??

>  enum tile_special_type map_get_special(int x, int y)
>  {
> -  if (!normalize_map_pos(&x, &y))
> +  if (!normalize_map_pos(&x, &y)) /* XXX */

??

>  enum known_type tile_is_known(int x, int y)
>  {
> -  if (!normalize_map_pos(&x, &y))
> +  if (!normalize_map_pos(&x, &y)) /* XXX */

??

As stated, we want normal map positions in all cases.

> +#ifndef NDEBUG
> +#define CHECK_POS(x,y) \
> +  (assert(is_normal_map_pos((x),(y))), TRUE)
> +#else
> +#define CHECK_POS(x,y) TRUE
> +#endif

Replace with 
#define CHECK_POS(x,y) (assert(is_normal_map_pos((x),(y))), TRUE)

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Many of my assistants were fans of Tolkien, who wrote 'Lord of the Rings'
  and a number of other children's stories for adults.  The first character
  alphabet that was programmed for my plotter was Elvish rather than Latin."
    -- from SAIs "life as a computer for a quarter of a century"


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