diff --git a/bitarray/_bitarray.c b/bitarray/_bitarray.c index 1f916533..6043a6fa 100644 --- a/bitarray/_bitarray.c +++ b/bitarray/_bitarray.c @@ -451,7 +451,7 @@ count(bitarrayobject *self, Py_ssize_t a, Py_ssize_t b) assert(wa <= wb && 64 * wa - a < 64 && b - 64 * wb < 64); cnt += count(self, a, 64 * wa); - cnt += popcount_words(WBUFF(self) + wa, wb - wa); + cnt += popcnt_words(WBUFF(self) + wa, wb - wa); cnt += count(self, 64 * wb, b); } else if (n >= 8) { diff --git a/bitarray/_util.c b/bitarray/_util.c index 8482d597..fb91e8a8 100644 --- a/bitarray/_util.c +++ b/bitarray/_util.c @@ -108,7 +108,7 @@ count_n_core(bitarrayobject *a, Py_ssize_t n, int vi) /* by counting big blocks we save comparisons and updates */ #define BLOCK_BITS 4096 /* block size: 4096 bits = 64 words */ while (i + BLOCK_BITS < nbits) { - m = popcount_words(wbuff + i / 64, BLOCK_BITS / 64); + m = popcnt_words(wbuff + i / 64, BLOCK_BITS / 64); if (!vi) m = BLOCK_BITS - m; if (t + m >= n) @@ -1038,7 +1038,7 @@ count_from_word(bitarrayobject *a, Py_ssize_t i) if (64 * i >= nbits) return 0; - cnt += popcount_words(WBUFF(a) + i, nbits / 64 - i); + cnt += popcnt_words(WBUFF(a) + i, nbits / 64 - i); if (nbits % 64) cnt += popcnt_64(zlw(a)); return cnt; @@ -1129,7 +1129,7 @@ sc_calc_rts(bitarrayobject *a) assert((m + 1) * SEGSIZE <= Py_SIZE(a)); if (memcmp(buff, zeros, SEGSIZE)) /* segment has not only zeros */ - cnt += popcount_words((uint64_t *) buff, SEGSIZE / 8); + cnt += popcnt_words((uint64_t *) buff, SEGSIZE / 8); } res[c_seg] = cnt; diff --git a/bitarray/bitarray.h b/bitarray/bitarray.h index d6f23a3e..38d281fe 100644 --- a/bitarray/bitarray.h +++ b/bitarray/bitarray.h @@ -205,7 +205,7 @@ popcnt_64(uint64_t x) /* population count of `n` words starting from `w` */ static inline Py_ssize_t -popcount_words(uint64_t *w, Py_ssize_t n) +popcnt_words(uint64_t *w, Py_ssize_t n) { Py_ssize_t cnt = 0;