aboutsummaryrefslogtreecommitdiff
path: root/src/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hash.c')
-rw-r--r--src/hash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hash.c b/src/hash.c
index 21d15dc..52fbc82 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -30,17 +30,17 @@ int
30_gdbm_hash (datum key) 30_gdbm_hash (datum key)
31{ 31{
32 unsigned int value; /* Used to compute the hash value. */ 32 unsigned int value; /* Used to compute the hash value. */
33 int index; /* Used to cycle through random values. */ 33 int index; /* Used to cycle through random values. */
34 34
35 /* Set the initial value from key. */ 35 /* Set the initial value from key. */
36 value = 0x238F13AF * key.dsize; 36 value = 0x238F13AFu * key.dsize;
37 for (index = 0; index < key.dsize; index++) 37 for (index = 0; index < key.dsize; index++)
38 value = (value + (key.dptr[index] << (index*5 % 24))) & 0x7FFFFFFF; 38 value = (value + (key.dptr[index] << ((unsigned) index * 5 % 24))) & 0x7FFFFFFF;
39 39
40 value = (1103515243 * value + 12345) & 0x7FFFFFFF; 40 value = (1103515243u * value + 12345) & 0x7FFFFFFF;
41 41
42 /* Return the value. */ 42 /* Return the value. */
43 return((int) value); 43 return((int) value);
44} 44}
45 45
46int 46int

Return to:

Send suggestions and report system problems to the System administrator.