Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2002:
[Freeciv-Dev] Re: settlers.c cleanup
Home

[Freeciv-Dev] Re: settlers.c cleanup

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: settlers.c cleanup
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Wed, 3 Apr 2002 22:10:07 +0200

Dear diary, on Tue, Apr 02, 2002 at 10:40:47PM CEST, I got a letter,
where "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx> told me, that...
> This patch adds some comment headers to functions, adds some more comments
> in such headers, removes some more dead code, and generally improves
> things. Does not change any behaviour. Adds a lot of fixmes.
> 
> Please take a look at it and give your comments.

Not much time for freeciv now, but been there, was cleaning that.. (my changes
[few of them buggy, though] accessible thru CVS/cvsweb, see my TODO for
description how to access them ;).  So few random thoughts.

> @@ -171,8 +175,7 @@
>    int d = 0;
>    int a, i0, j0; /* need some temp variables */
>    int temp=0, tmp=0;
> -  bool debug = FALSE;

> -  int g = 1;

I think this is not a good idea. IIRC there was some generic equation around in
few copies accross whole settlers.c, and this is to keep it in such a way.
Should be unified instead. Or I may be wrong :).

> +  bool debug = FALSE; /* turn on extra LOG_DEBUG output */
>    struct tile *ptile;
>    int con, con2;
>    bool har;
> @@ -421,16 +416,8 @@
>    return TEST_BIT(map_get_tile(x, y)->assigned, pplayer->player_no);
>  }
>  
> -/*************************************************************************/
> -
> -/* all of the benefit and ai_calc routines rewritten by Syela */
> -/* to conform with city_tile_value and related calculations elsewhere */
> -/* all of these functions are VERY CPU-inefficient and are being cached */
> -/* I don't really want to rewrite them and possibly screw them up. */
> -/* The cache should keep the CPU increase linear instead of quadratic. -- 
> Syela */
> -

Is this not true anymore?

>  /**************************************************************************
> -...
> +  Calculates the value of removing pollution.
>  **************************************************************************/
>  static int ai_calc_pollution(struct city *pcity, int cx, int cy, int best,
>                            int mx, int my)

-- 

                                Petr "Pasky" Baudis

* ELinks maintainer                * IPv6 guy (XS26 co-coordinator)
* IRCnet operator                  * FreeCiv AI hacker
.
Teamwork is essential -- it allows you to blame someone else.
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/


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