summaryrefslogtreecommitdiffstats
path: root/ewah
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-20 05:14:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-20 05:14:36 +0000
commit037de004c68d704abf839eebe075c58c9603f8f3 (patch)
tree7ac13a7fbb70193e7d04fc193f75de839e914d45 /ewah
parentAdding upstream version 1:2.43.0. (diff)
downloadgit-20ec40b9dc901952c46c323faf090fc8e31a66a4.tar.xz
git-20ec40b9dc901952c46c323faf090fc8e31a66a4.zip
Adding upstream version 1:2.45.1.upstream/1%2.45.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ewah')
-rw-r--r--ewah/bitmap.c9
-rw-r--r--ewah/ewok.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/ewah/bitmap.c b/ewah/bitmap.c
index 7b525b1..ac7e0af 100644
--- a/ewah/bitmap.c
+++ b/ewah/bitmap.c
@@ -169,6 +169,15 @@ size_t bitmap_popcount(struct bitmap *self)
return count;
}
+int bitmap_is_empty(struct bitmap *self)
+{
+ size_t i;
+ for (i = 0; i < self->word_alloc; i++)
+ if (self->words[i])
+ return 0;
+ return 1;
+}
+
int bitmap_equals(struct bitmap *self, struct bitmap *other)
{
struct bitmap *big, *small;
diff --git a/ewah/ewok.h b/ewah/ewok.h
index 7eb8b9b..c11d76c 100644
--- a/ewah/ewok.h
+++ b/ewah/ewok.h
@@ -189,5 +189,6 @@ void bitmap_or_ewah(struct bitmap *self, struct ewah_bitmap *other);
void bitmap_or(struct bitmap *self, const struct bitmap *other);
size_t bitmap_popcount(struct bitmap *self);
+int bitmap_is_empty(struct bitmap *self);
#endif