45 |
|
|
46 |
/* Data type used to store a word of bits. */ |
/* Data type used to store a word of bits. */ |
47 |
typedef unsigned long bitset_word; |
typedef unsigned long bitset_word; |
48 |
#define BITSET_WORD_BITS ((unsigned) CHAR_BIT * sizeof (bitset_word)) |
#define BITSET_WORD_BITS ((unsigned) (CHAR_BIT * sizeof (bitset_word))) |
49 |
|
|
50 |
/* Bit index. */ |
/* Bit index. In theory we might need a type wider than size_t, but |
51 |
typedef unsigned long bitset_bindex; |
in practice we lose at most a factor of CHAR_BIT by going with |
52 |
|
size_t, and that is good enough. */ |
53 |
|
typedef size_t bitset_bindex; |
54 |
|
|
55 |
/* Word index. */ |
/* Word index. */ |
56 |
typedef unsigned long bitset_windex; |
typedef size_t bitset_windex; |
57 |
|
|
58 |
#define BITSET_INDEX_MAX ((1U << (BITSET_WORD_BITS - 1))) |
#define BITSET_INDEX_MAX ((bitset_word) 1 << (BITSET_WORD_BITS - 1)) |
59 |
|
|
60 |
#define BITSET_MSB (1U << (BITSET_WORD_BITS - 1)) |
#define BITSET_MSB ((bitset_word) 1 << (BITSET_WORD_BITS - 1)) |
61 |
|
|
62 |
#define BITSET_LIST_SIZE 1024 |
#define BITSET_LIST_SIZE 1024 |
63 |
|
|