summaryrefslogtreecommitdiff
path: root/src/libstddjb/bitarray_count.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-03-13 10:31:14 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-03-13 10:31:14 +0000
commite450f6efc39e55e32264d2daded6c757af0f7527 (patch)
tree7f03bd312b8e589cc494ca9776dc81b815ef14cd /src/libstddjb/bitarray_count.c
parent04905aaeffba2bc77866a4056dc3f2020a86bb26 (diff)
downloadskalibs-e450f6efc39e55e32264d2daded6c757af0f7527.tar.xz
Cleanups - mostly removing superfluous includes in headers
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]] ;