From 4ed6a64c61bc28513e3fa000f2f2c83e54052678 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 22 Apr 2013 22:20:08 +0900 Subject: [PATCH] change the type of popcount unsigned it's a natural choice and compatible with a version found in NetBSD libc. Signed-off-by: YAMAMOTO Takashi Signed-off-by: Ben Pfaff --- lib/util.c | 2 +- lib/util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.c b/lib/util.c index cbaffa733..cd4019eb7 100644 --- a/lib/util.c +++ b/lib/util.c @@ -843,7 +843,7 @@ raw_ctz(uint32_t n) #endif /* Returns the number of 1-bits in 'x', between 0 and 32 inclusive. */ -int +unsigned int popcount(uint32_t x) { /* In my testing, this implementation is over twice as fast as any other diff --git a/lib/util.h b/lib/util.h index b944ec793..4f6a20165 100644 --- a/lib/util.h +++ b/lib/util.h @@ -265,7 +265,7 @@ ctz(uint32_t n) int log_2_floor(uint32_t); int log_2_ceil(uint32_t); -int popcount(uint32_t); +unsigned int popcount(uint32_t); /* Returns the rightmost 1-bit in 'x' (e.g. 01011000 => 00001000), or 0 if 'x' * is 0. */ -- 2.47.0