A previous commit introduced a latent bug where the wrong popcount
definition was used when overriding the compilation mode to C23.
This commit fixes it.
branch_count_bitmap_before(dns_qpnode_t *n, dns_qpshift_t bit) {
uint64_t mask = (1ULL << bit) - 1 - TAG_MASK;
uint64_t bitmap = branch_index(n) & mask;
- return (dns_qpweight_t)stdc_count_zeros(bitmap);
+ return (dns_qpweight_t)stdc_count_ones(bitmap);
}
/*
#else /* __has_header(<stdbit.h>) */
#ifdef HAVE_BUILTIN_POPCOUNTG
-#define stdc_count_zeros(x) __builtin_popcountg(x)
+#define stdc_count_ones(x) __builtin_popcountg(x)
#else /* HAVE_BUILTIN_POPCOUNTG */
-#define stdc_count_zeros(x) \
+#define stdc_count_ones(x) \
_Generic((x), \
unsigned int: __builtin_popcount, \
unsigned long: __builtin_popcountl, \