Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)
Home

[Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Changing interface for generate_warmap (PR#1108)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 13 Dec 2001 20:04:19 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Thu, Dec 13, 2001 at 06:34:05PM +0000, Gregory Berkolaiko wrote:
>  --- Jason Short <vze2zq63@xxxxxxxxxxx> wrote: 
> > Gregory Berkolaiko wrote:
> > >>Nobody needs to know the internals of struct move_cost_map. You can
> > >>move this from gotohand.h to gotohand.c.
> > > 
> > > yes.
> > 
> > Only if you want to start passing around void* variables to refer to
> > the local move_cost_maps.
> 
> I can leave struct move_cost_map; in gotohand.h
> and actually define it only in gotohand.c (I just checked it works)

But only if you use pointers to this struct. See also struct Sprite
which uses the same scheme.

>> I don't understand what Raimar is saying.  Why will the current
>> interface Gregory has not be extensible?  Just pass in a local
>> warmap instead of NULL, and it'll use that variable instead.  Of
>> course, you'll have to initialize it separately - but that's
>> probably a good thing; 

>> if you have a warmap for each city you don't want to free and
>> re-malloc each time you generate a new one.

Good point.

> I agree completely (this is why I made it this way).
> 
> > This patch looks to me like a step in the right direction.  By 
> > encapsulating accesses to the global warmap structure, it allows local 
> > warmaps to be used later.  The only problem is it's so long...
> 
> If it is "provisionally" accepted (that is we agree on all details of the
> interface), I will invest as much effort as will be needed, including
> splitting the patch.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "At the beginning of the week, we sealed ten BSD programmers
  into a computer room with a single distribution of BSD Unix.
  Upon opening the room after seven days, we found all ten programmers 
  dead, clutching each other's throats, and thirteen new flavors of BSD."


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