[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]
<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 <=
|
|