diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-03 13:19:54 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-03 13:30:04 +0100 |
commit | 2f00b1fc24b7fe48a19c3a778f023645c149ba0e (patch) | |
tree | 17b3b0f4d68e264f82b7d5b3adeb595c926b8785 /contrib | |
parent | 0d74357b78e6cc958e41808ff1b1af287258629e (diff) | |
download | rspamd-2f00b1fc24b7fe48a19c3a778f023645c149ba0e.tar.gz rspamd-2f00b1fc24b7fe48a19c3a778f023645c149ba0e.zip |
[Minor] Don't use shift on -1
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/aho-corasick/acism_create.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 } |