Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)
Home

[Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv List <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)
From: vze2zq63@xxxxxxxxxxx
Date: Tue, 04 Dec 2001 16:02:13 -0500
Reply-to: jdorje@xxxxxxxxxxxx

Gregory Berkolaiko wrote:


No I want runtime info.  You see warmap is generated once and then used
all over and then once again generated and many times used...  I want to
know which access corresponds to which generation.

Is it feasible to make warmap a local variable rather than global? It would be necessary to create it where appropriate, pass it around, and get rid of it when done. It should then be obvious which warmap each access refers to, and we'd be sure not to overwrite somebody else's warmap in (for instance) air_can_move_between(). The problem is there may be some uses that you then just can't tie to invocations, but these probably shouldn't be there anyway :-).

A first step might be to have the warmap used be passed into [really]_generate_warmap. Then places like air_can_move_between can safely use their local copy while other places continue to use the global variant.

jason



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