From 96833cc26faf9781de7c6cd5e9077d39f14dc8de Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20W=C3=BCrdig?= Date: Tue, 15 May 2007 15:28:57 +0000 Subject: [PATCH] bitset_popcnt returns number of set bits as unsigned [r13884] --- ir/adt/bitset.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ir/adt/bitset.h b/ir/adt/bitset.h index 3e27eea84..0b647d5f8 100644 --- a/ir/adt/bitset.h +++ b/ir/adt/bitset.h @@ -356,12 +356,13 @@ static INLINE bitset_pos_t _bitset_next(const bitset_t *bs, * @param bs The bitset. * @return The number of bits set in the bitset. */ -static INLINE bitset_pos_t bitset_popcnt(const bitset_t *bs) +static INLINE unsigned bitset_popcnt(const bitset_t *bs) { - bitset_pos_t i, pop = 0; + bitset_pos_t i; bitset_unit_t *unit; + unsigned pop = 0; - for(i = 0, unit = bs->data; i < bs->units; ++i, ++unit) + for (i = 0, unit = bs->data; i < bs->units; ++i, ++unit) pop += _bitset_inside_pop(unit); return pop; -- 2.20.1