From 2f00b1fc24b7fe48a19c3a778f023645c149ba0e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 3 Oct 2018 13:19:54 +0100 Subject: [Minor] Don't use shift on -1 --- contrib/aho-corasick/acism_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/aho-corasick/acism_create.c') diff --git a/contrib/aho-corasick/acism_create.c b/contrib/aho-corasick/acism_create.c index bd8586c82..15f9e801e 100644 --- a/contrib/aho-corasick/acism_create.c +++ b/contrib/aho-corasick/acism_create.c @@ -50,7 +50,7 @@ static TNODE* find_child(TNODE*, SYMBOL); static inline void set_tran(ac_trie_t *psp, STATE s, SYMBOL sym, int match, int suffix, TRAN ns) { - psp->tranv[s + sym] = sym | (match ? IS_MATCH : 0) + psp->tranv[s + sym] = sym | (match ? IS_MATCH : 0) | (suffix ? IS_SUFFIX : 0) | (ns << SYM_BITS); } @@ -151,7 +151,7 @@ fill_symv(ac_trie_t *psp, ac_trie_pat_t const *strv, int nstrs) ++psp->nsyms; #if ACISM_SIZE < 8 psp->sym_bits = bitwid(psp->nsyms); - psp->sym_mask = ~(-1 << psp->sym_bits); + psp->sym_mask = ~((~(uint32_t)0u) << psp->sym_bits); #endif } -- cgit v1.2.3