]> mj.ucw.cz Git - libucw.git/commitdiff
Updated calls of fls().
authorMartin Mares <mj@ucw.cz>
Thu, 22 Sep 2005 20:45:26 +0000 (20:45 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 22 Sep 2005 20:45:26 +0000 (20:45 +0000)
lib/kmp.c
lib/qache.c

index 70f1be27dd4f9d97566cb29eb5227f5b9ede11ce..c930168d6a7a64bb7c6bd00068780de22d8cb9f9 100644 (file)
--- 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;
index a973be458a5d88f15fd6177bdfb14efdedc95eba..aa5844180464bb574ac818cf396bf72342fb0f8b 100644 (file)
@@ -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);