From beb8a1bc9e4bca9eb8e661c9c4d1ab32d1d6fd8f Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Mon, 26 Sep 2016 18:01:56 +0200 Subject: [PATCH] Adding bits_set() to header file --- include/lib/utils.h | 6 ++++++ lib/utils.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/lib/utils.h b/include/lib/utils.h index 838e24d..e8ffac2 100644 --- a/include/lib/utils.h +++ b/include/lib/utils.h @@ -48,5 +48,11 @@ uint8_t clz(uint32_t x); */ uint8_t ctz(uint32_t x); +/* + * Count bits set + */ +uint8_t bits_set(uint32_t x); + + #endif /* LIB_UTILS_H */ diff --git a/lib/utils.c b/lib/utils.c index c6899eb..cb9f354 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -83,8 +83,10 @@ uint8_t ctz(uint32_t x) return r + bval_ctz[(x & 0x0F)]; } -/* Count bits set - * + + +/* + * Count bits set */ uint8_t bits_set(uint32_t x) { -- 2.43.0