summaryrefslogtreecommitdiff
path: root/src/libstddjb/bitarray_count.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/bitarray_count.c')
-rw-r--r--src/libstddjb/bitarray_count.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstddjb/bitarray_count.c b/src/libstddjb/bitarray_count.c
index 8f4ab50..19ed09e 100644
--- a/src/libstddjb/bitarray_count.c
+++ b/src/libstddjb/bitarray_count.c
@@ -1,7 +1,6 @@
/* ISC license. */
#include <sys/types.h>
-#include <skalibs/uint64.h>
#include <skalibs/bitarray.h>
#define B0(n) n, n+1, n+1, n+2
@@ -9,11 +8,11 @@
#define B2(n) B1(n), B1(n+1), B1(n+1), B1(n+2)
#define B3(n) B2(n), B2(n+1), B2(n+1), B2(n+2)
-uint64_t bitarray_countones (unsigned char const *c, size_t n)
+size_t bitarray_countones (unsigned char const *c, size_t n)
{
static unsigned char const table[256] = { B3(0) } ;
size_t len = bitarray_div8(n) ;
- uint64_t total = 0 ;
+ size_t total = 0 ;
size_t i = 0 ;
if (n & 7) len-- ;
for (; i < len ; i++) total += table[c[i]] ;