From 1b94016651511a3d626188893cf9e47e4103c3fc Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 22 Sep 2005 20:45:26 +0000 Subject: [PATCH] Updated calls of fls(). --- lib/kmp.c | 3 ++- lib/qache.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/kmp.c b/lib/kmp.c index 70f1be27..c930168d 100644 --- a/lib/kmp.c +++ b/lib/kmp.c @@ -5,6 +5,7 @@ */ #include "lib/lib.h" +#include "lib/bitops.h" #include "lib/mempool.h" #include "lib/lists.h" #include "sherlock/tagged-text.h" @@ -33,7 +34,7 @@ kmp_new(struct mempool *mp, int words_len, uns modify_flags) kmp->g.sons = mp_alloc_zero(mp, size * sizeof(struct list)); init_list(kmp->g.sons + 0); if (words_len > 1) - size = words_len * fls(words_len); + size = words_len * bit_fls(words_len); else size = 1; kmp->g.hash_size = size; diff --git a/lib/qache.c b/lib/qache.c index a973be45..aa584418 100644 --- a/lib/qache.c +++ b/lib/qache.c @@ -7,6 +7,7 @@ #undef LOCAL_DEBUG #include "lib/lib.h" +#include "lib/bitops.h" #include "lib/fastbuf.h" #include "lib/qache.h" @@ -313,7 +314,7 @@ qache_create(struct qache *q, struct qache_params *par) bzero(&h, sizeof(h)); h.magic = QACHE_MAGIC; h.block_size = par->block_size; - h.block_shift = fls(h.block_size); + h.block_shift = bit_fls(h.block_size); h.num_blocks = par->cache_size >> h.block_shift; h.format_id = par->format_id; h.entry_table_start = sizeof(h); -- 2.39.2