diff options
author | Brendan Cully <brendan@kublai.com> | 2009-01-03 14:00:25 -0800 |
---|---|---|
committer | Brendan Cully <brendan@kublai.com> | 2009-01-03 14:00:25 -0800 |
commit | 8a6df300ce98f15253723fe44584fdefbfc42902 (patch) | |
tree | 21ecadef67d93d8d905522a14f80353d6ec8444c /hash.c | |
parent | 2350076e5e2b453415482ab53bed55ce2809410a (diff) |
Make hash_string work in unsigned domain
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -28,7 +28,7 @@ #define SOMEPRIME 149711 -int hash_string (const unsigned char *s, int n) +unsigned int hash_string (const unsigned char *s, unsigned int n) { unsigned int h = 0; @@ -36,7 +36,7 @@ int hash_string (const unsigned char *s, int n) h += (h << 7) + *s++; h = (h * SOMEPRIME) % n; - return (signed) h; + return h; } HASH *hash_create (int nelem) |