Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: generalized unit capabilities
Home

[Freeciv-Dev] Re: generalized unit capabilities

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: Freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: generalized unit capabilities
From: Jason Short <vze2zq63@xxxxxxxxxxx>
Date: Wed, 05 Dec 2001 20:39:21 -0500
Reply-to: jdorje@xxxxxxxxxxxx

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



[Prev in Thread] Current Thread [Next in Thread]