diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-01-04 19:09:13 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-01-04 19:09:13 (GMT) |
commit | e6e6479710b0a00218437753cf816bf68c99f8ab (patch) | |
tree | e3c5856c597bb146464ab1a8c30ae47df41058e3 | |
parent | e827eb8bdc797d2a8c194e675bd300e97aee6166 (diff) |
Fixed the popcount feature of bitfields.
-rw-r--r-- | src/common/bits.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/bits.c b/src/common/bits.c index 32041b9..7b49bb8 100644 --- a/src/common/bits.c +++ b/src/common/bits.c @@ -582,7 +582,7 @@ size_t popcount_for_bit_field(const bitfield_t *field) value = field->bits[i]; if (remaining < (8 * sizeof(unsigned long))) - value &= (1lu << (remaining + 1)) - 1; + value &= (1lu << remaining) - 1; #if __WORDSIZE == 64 result += popcount_64(value); |