]> mj.ucw.cz Git - libucw.git/blobdiff - lib/kmp.c
Merged with v3.8
[libucw.git] / lib / kmp.c
index 70f1be27dd4f9d97566cb29eb5227f5b9ede11ce..c2e2dd10f8437a11c9ea8d7ac2d067277813fa5c 100644 (file)
--- a/lib/kmp.c
+++ b/lib/kmp.c
@@ -5,9 +5,9 @@
  */
 
 #include "lib/lib.h"
+#include "lib/bitops.h"
 #include "lib/mempool.h"
 #include "lib/lists.h"
-#include "sherlock/tagged-text.h"
 #include "lib/unicode.h"
 
 #define KMP_GET_CHAR KMP_GET_RAW
@@ -15,7 +15,6 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <alloca.h>
 
 #define        TRACE(level, mask...)   if (0) fprintf(stderr, mask)
@@ -33,7 +32,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;