[Freeciv-Dev] Re: (PR#13474) a city_production struct
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13474 >
Benoit Hudson wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=13474 >
>
>>Wastes less memory, makes it more obvious there can only be one item at a
>>time, etc.
>
>
> where "etc" maps to "more likely to call unit_type functions on a
> impr_type and crash in mysterious ways. Unions are dangerous; unless
> we're extremely pinched on space (which for city structs we aren't)
> they are to be avoided.
>
> Of course, currently we're likely to occasionally use an
> improvement-type index as a unit-type.
Yes, it would still be better than the current situation. We have (or
should have) lots of sanity checks like
assert(&improvements[b->index] == b);
that will catch an error here.
However memory isn't an issue here (the city struct is 2000 bytes, 4
more won't matter). A union requires more typing
(pcity->production.value.impr versus pcity->production.impr) but
otherwise I don't really care.
-jason
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Benoit Hudson, 2005/07/14
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Jason Short, 2005/07/14
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Vasco Alexandre da Silva Costa, 2005/07/15
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Vasco Alexandre da Silva Costa, 2005/07/15
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Benoit Hudson, 2005/07/15
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Jason Short, 2005/07/15
- [Freeciv-Dev] Re: (PR#13474) a city_production struct,
Jason Short <=
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Vasco Alexandre da Silva Costa, 2005/07/16
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Jason Short, 2005/07/17
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Vasco Alexandre da Silva Costa, 2005/07/18
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Jason Short, 2005/07/18
- [Freeciv-Dev] (PR#13474) a city_production struct, Jason Short, 2005/07/23
|
|