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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11572) building targets for is_req_active
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Dec 2004 01:53:20 -0800
Reply-to: bugs@xxxxxxxxxxx

<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).

-jason





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11572) building targets for is_req_active, Jason Short <=