Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] Strange commit
Home

[Freeciv-Dev] Strange commit

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Strange commit
From: Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Thu, 11 Aug 2005 08:45:50 +0200

On Wed, Aug 10, 2005 at 10:05:00PM -0700, Raimar Falke wrote:
> Date: Thu Aug 11 04:51:09 2005-Thu Aug 11 04:51:09 2005
> Author: Jason Short
> Files:
>   common/tile.c:1.11
>   common/tile.h:1.12
> Message:
>   Add two new functions to the tile API. tile_add_special and
>   tile_remove_special change the specials on a tile and handle side
>   effects as well.
>   Patch by me in PR#13613.
> Lines: 171
> Diffstat:
>  tile.c |  111 
> +++++++++++++++++++++++++++++++++++++++++++++++++----------------
>  tile.h |    3 +
>  2 files changed, 88 insertions(+), 26 deletions(-)
> 
> Index: common/tile.c
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/common/tile.c,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- common/tile.c     1 Aug 2005 22:38:25 -0000       1.10
> +++ common/tile.c     11 Aug 2005 04:51:09 -0000      1.11
> @@ -238,25 +238,94 @@
>  }
>  
>  /****************************************************************************
> +  Add the special to the tile.  This does secondary tile updates to
> +  the tile.
> +****************************************************************************/
> +void tile_add_special(struct tile *ptile, enum tile_special_type special)
> +{
> +  tile_add_special(ptile, special);

Isn't this an unlimited recursion?

> +void tile_remove_special(struct tile *ptile, enum tile_special_type special)
> +{
> +  tile_remove_special(ptile, special);

Same here.

> +  case S_HUT:
> +  case S_FORTRESS:
> +  case S_SPECIAL_2:
> +  case S_RIVER:
> +  case S_FARMLAND:
> +  case S_AIRBASE:
> +  case S_FALLOUT:
> +  case S_LAST:
> +    break;

I think there should be a default branch with an assert.

        Raimar

-- 
 email: i-freeciv-lists@xxxxxxxxxxxxx
 "That's fundamental game play!  My main enemy is *ALWAYS* fighting 
  a 4-front war.  I make sure of it!"
    -- Tony Stuckey, freeciv-dev


----- End forwarded message -----

-- 
 email: i-freeciv-lists@xxxxxxxxxxxxx
  "Debugging is twice as hard as writing the code in the first place.
   Therefore, if you write the code as cleverly as possible, you are,
   by definition, not smart enough to debug it."
    -- Brian W. Kernighan



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