b->bitmaps[offset] &= ~bitmask;
}
-bool bitmap_isset(Bitmap *b, unsigned n) {
+bool bitmap_isset(const Bitmap *b, unsigned n) {
uint64_t bitmask;
unsigned offset;
return !!(b->bitmaps[offset] & bitmask);
}
-bool bitmap_isclear(Bitmap *b) {
+bool bitmap_isclear(const Bitmap *b) {
unsigned i;
if (!b)
}
void bitmap_clear(Bitmap *b) {
-
if (!b)
return;
b->bitmaps_allocated = 0;
}
-bool bitmap_iterate(Bitmap *b, Iterator *i, unsigned *n) {
+bool bitmap_iterate(const Bitmap *b, Iterator *i, unsigned *n) {
uint64_t bitmask;
unsigned offset, rem;
return false;
}
-bool bitmap_equal(Bitmap *a, Bitmap *b) {
+bool bitmap_equal(const Bitmap *a, const Bitmap *b) {
size_t common_n_bitmaps;
- Bitmap *c;
+ const Bitmap *c;
unsigned i;
if (a == b)
int bitmap_set(Bitmap *b, unsigned n);
void bitmap_unset(Bitmap *b, unsigned n);
-bool bitmap_isset(Bitmap *b, unsigned n);
-bool bitmap_isclear(Bitmap *b);
+bool bitmap_isset(const Bitmap *b, unsigned n);
+bool bitmap_isclear(const Bitmap *b);
void bitmap_clear(Bitmap *b);
-bool bitmap_iterate(Bitmap *b, Iterator *i, unsigned *n);
+bool bitmap_iterate(const Bitmap *b, Iterator *i, unsigned *n);
-bool bitmap_equal(Bitmap *a, Bitmap *b);
+bool bitmap_equal(const Bitmap *a, const Bitmap *b);
#define BITMAP_FOREACH(n, b, i) \
for ((i).idx = 0; bitmap_iterate((b), &(i), (unsigned*)&(n)); )