Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11572) building targets for is_req_active
Home

[Freeciv-Dev] Re: (PR#11572) building targets for is_req_active

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#11572) building targets for is_req_active
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Fri, 17 Dec 2004 10:32:05 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11572 >

On Fri, 17 Dec 2004, Jason Short wrote:

>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=11572 >
>
> The building target passed in to is_req_active really needs to be a
> pointer rather than an integer value.  The problem with an integer value
> is it's not typesafe.  It will be very easy for a caller to pass in 0
> for the integer value (as one would pass in 0 for the pointer values)
> thinking that this means there is no building target.  But in fact it
> means the opposite: you have to pass in B_LAST to get no building target.
>
> The only impediment to changing this is that there is no impr->index
> value in the impr_type struct.  Since most functions require an
> improvement index there is no way to call them from a pointer value.
> This should be changed (simply by adding an index field).

This will make the code even slower...

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa







[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#11572) building targets for is_req_active, Vasco Alexandre da Silva Costa <=