summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-01-04 19:09:13 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-01-04 19:09:13 (GMT)
commite6e6479710b0a00218437753cf816bf68c99f8ab (patch)
treee3c5856c597bb146464ab1a8c30ae47df41058e3 /src
parente827eb8bdc797d2a8c194e675bd300e97aee6166 (diff)
Fixed the popcount feature of bitfields.
Diffstat (limited to 'src')
-rw-r--r--src/common/bits.c2
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);