X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fkmp.c;h=c2e2dd10f8437a11c9ea8d7ac2d067277813fa5c;hb=6829bc0163f6ecfc8ae70ee7b3ce2b79e7484dfe;hp=70f1be27dd4f9d97566cb29eb5227f5b9ede11ce;hpb=8e6f42243848d33e5044ae6b47596245e3609bbe;p=libucw.git diff --git a/lib/kmp.c b/lib/kmp.c index 70f1be27..c2e2dd10 100644 --- 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 #include -#include #include #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;