Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: init_techs integrated patch (PR#999)
Home

[Freeciv-Dev] Re: init_techs integrated patch (PR#999)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: init_techs integrated patch (PR#999)
From: Arien Malec <arien_malec@xxxxxxxxx>
Date: Thu, 11 Oct 2001 09:37:22 -0700 (PDT)

Overall, looks improved: the memcpy change is a good one.

The bounds checking on array size may introduce bugs as well as save the code
from them. If, for some reason, the code fails to A_LAST terminate in some
circumstance, the code as it stands will fill up initial techs with some
garbage, rather than lots of garbage or a seg fault. I guess I'd rather see
something obviously wrong than subtly wrong.

The code below is necessary in that the game.ruleset now refers to techs, so
you need to load game.ruleset after techs.ruleset.

Arien

--- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, Oct 10, 2001 at 12:55:10PM -0700, Arien Malec wrote:
> > Updated patch attached. Commentary below
> 
> I changed the patch a bit (format, docu, memcpy instead of for loop,
> explcit limit on for loops) and attached it.
> 
> Why have you done this change?
> @@ -2514,7 +2531,6 @@
>    struct section_file cityfile, nationfile;
> 
>    freelog(LOG_NORMAL, _("Loading rulesets"));
> -  load_ruleset_game(game.ruleset.game);
> 
>    openload_ruleset_file(&techfile, game.ruleset.techs, "techs");
>    load_tech_names(&techfile);
> @@ -2544,6 +2560,7 @@
>    load_ruleset_terrain(&terrfile);
>    load_ruleset_buildings(&buildfile);
>    load_ruleset_nations(&nationfile);
> +  load_ruleset_game(game.ruleset.game);
>    translate_data_names();
>  }
> 
>  Raimar
> 
> -- 
>  email: rf13@xxxxxxxxxxxxxxxxx
>  "Like the ad says, at 300 dpi you can tell she's wearing a
>   swimsuit. At 600 dpi you can tell it's wet. At 1200 dpi you
>   can tell it's painted on. I suppose at 2400 dpi you can tell
>   if the paint is giving her a rash."
>     -- Joshua R. Poulson
> 

> ATTACHMENT part 2 application/x-gzip 


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com


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