[Freeciv-Dev] Re: generalized unit capabilities
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Vasco Alexandre Da Silva Costa wrote:
On Wed, 5 Dec 2001, Raimar Falke wrote:
About running out of space for bits for the flags: I agree that this
is a problem, but a problem which can be solved in a 100 lines patch.
Well i have this old code i made lying around for bit flag arrays. I have
sent it attached. It has 26 LOC.
Nice and simple - a cleaner and more extensible variant of Raimar's
solution.
/* structure for bitvectors */
typedef struct bv_set
{
uint_8 bits[_BV_DELT(BV_SETSIZE)];
}bv_set;
Consider the case where BV_SETSIZE is not a multiple of 8. I think the
line should say
uint_8 bits[_BV_DELT(BV_SETSIZE+7)];
Then you can get rid of the "this number MUST be >= 8!" comment as well.
Alternately, you can just change that comment to "this number MUST be a
multiple of 8!".
jason
- [Freeciv-Dev] Re: generalized unit capabilities, (continued)
- [Freeciv-Dev] Re: generalized unit capabilities, Andrew Sutton, 2001/12/05
- [Freeciv-Dev] Re: generalized unit capabilities, Raimar Falke, 2001/12/05
- [Freeciv-Dev] Re: generalized unit capabilities, Andrew Sutton, 2001/12/05
- [Freeciv-Dev] Re: generalized unit capabilities, Raimar Falke, 2001/12/05
- [Freeciv-Dev] Re: generalized unit capabilities, Andrew Sutton, 2001/12/05
- [Freeciv-Dev] Re: generalized unit capabilities, Raimar Falke, 2001/12/05
- [Freeciv-Dev] Re: generalized unit capabilities, Vasco Alexandre Da Silva Costa, 2001/12/05
- [Freeciv-Dev] Re: generalized unit capabilities, Jason Short, 2001/12/05
- [Freeciv-Dev] Re: generalized unit capabilities, Andrew Sutton, 2001/12/05
[Freeciv-Dev] Re: generalized unit capabilities, Vasco Alexandre Da Silva Costa, 2001/12/05
[Freeciv-Dev] generalized unit capabilities, Andrew Sutton, 2001/12/05
|
|