]> git.ozlabs.org Git - ccan/commit
bitmap: Fix some bugs on 32-bit platforms
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 11 Jul 2019 02:07:33 +0000 (12:07 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 11 Jul 2019 02:07:33 +0000 (12:07 +1000)
commitcdd0b8b5942126c9b8a779d2244b4aaffcb037e7
tree33ce86c9e2aa8dc0247adfa1740cad33ed322f15
parentce4660aa49404530a608a37754fae16fbb3fde02
bitmap: Fix some bugs on 32-bit platforms

The bitmap_word type is an unsigned long.  However in some places we assign
it using -1ULL, a 64-bit value on many platforms.  We sometimes get away
with this because it masks correctly, but in other cases it breaks things.

To clean this up define a new BITMAP_WORD_1 constant, indicating a
bitmap_word with all bits set, and use that instead of explicit UL or ULL
qualifiers.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/bitmap/bitmap.c
ccan/bitmap/bitmap.h