Bitmap words (e.g. resulting from BITMAP_{N,HEAD}WORDS) are of
unsigned type.
Use "unsigned int" to iterate over bitmap words to avoid comparisons
between signed and unsigned expressions. GCC otherwise warns about
these when -Wsign-compare is enabled.
Signed-off-by: Emilio G. Cota <cota@braap.org>
static inline void bitmap_##_name(bitmap *dst, bitmap *src1, bitmap *src2, \
int nbits) \
{ \
static inline void bitmap_##_name(bitmap *dst, bitmap *src1, bitmap *src2, \
int nbits) \
{ \
for (i = 0; i < BITMAP_NWORDS(nbits); i++) { \
dst[i].w = src1[i].w _op src2[i].w; \
} \
for (i = 0; i < BITMAP_NWORDS(nbits); i++) { \
dst[i].w = src1[i].w _op src2[i].w; \
} \
static inline void bitmap_complement(bitmap *dst, bitmap *src, int nbits)
{
static inline void bitmap_complement(bitmap *dst, bitmap *src, int nbits)
{
for (i = 0; i < BITMAP_NWORDS(nbits); i++)
dst[i].w = ~src[i].w;
for (i = 0; i < BITMAP_NWORDS(nbits); i++)
dst[i].w = ~src[i].w;
static inline bool bitmap_intersects(bitmap *src1, bitmap *src2, int nbits)
{
static inline bool bitmap_intersects(bitmap *src1, bitmap *src2, int nbits)
{
for (i = 0; i < BITMAP_HEADWORDS(nbits); i++) {
if (src1[i].w & src2[i].w)
for (i = 0; i < BITMAP_HEADWORDS(nbits); i++) {
if (src1[i].w & src2[i].w)
static inline bool bitmap_subset(bitmap *src1, bitmap *src2, int nbits)
{
static inline bool bitmap_subset(bitmap *src1, bitmap *src2, int nbits)
{
for (i = 0; i < BITMAP_HEADWORDS(nbits); i++) {
if (src1[i].w & ~src2[i].w)
for (i = 0; i < BITMAP_HEADWORDS(nbits); i++) {
if (src1[i].w & ~src2[i].w)
static inline bool bitmap_full(bitmap *bitmap, int nbits)
{
static inline bool bitmap_full(bitmap *bitmap, int nbits)
{
for (i = 0; i < BITMAP_HEADWORDS(nbits); i++) {
if (bitmap[i].w != -1UL)
for (i = 0; i < BITMAP_HEADWORDS(nbits); i++) {
if (bitmap[i].w != -1UL)
static inline bool bitmap_empty(bitmap *bitmap, int nbits)
{
static inline bool bitmap_empty(bitmap *bitmap, int nbits)
{
for (i = 0; i < BITMAP_HEADWORDS(nbits); i++) {
if (bitmap[i].w != 0)
for (i = 0; i < BITMAP_HEADWORDS(nbits); i++) {
if (bitmap[i].w != 0)