summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-03-07 02:13:02 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2021-03-08 15:33:15 +0100
commit84679d254ffdeab24cc2994d1ef3bc800ca736d7 (patch)
tree017fe60addcd9896245316ae5e0be2ada17cab3b /base
parent2d64ffaee521222e64b5c0bdfec367617e503f05 (diff)
downloadlvm2-84679d254ffdeab24cc2994d1ef3bc800ca736d7.tar.gz
hash: use unsigned size
There is not much point in using 64bit hash size, since we hash with way less bits anyway. So keep size 32bit.
Diffstat (limited to 'base')
-rw-r--r--base/data-struct/hash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/base/data-struct/hash.c b/base/data-struct/hash.c
index d60f28a25..9f6322733 100644
--- a/base/data-struct/hash.c
+++ b/base/data-struct/hash.c
@@ -71,16 +71,16 @@ static struct dm_hash_node *_create_node(const void *key, unsigned len)
return n;
}
-static unsigned long _hash(const void *key, unsigned len)
+static unsigned _hash(const void *key, unsigned len)
{
const unsigned char *str = key;
- unsigned long h = 0, g;
+ unsigned h = 0, g;
unsigned i;
for (i = 0; i < len; i++) {
h <<= 4;
h += _nums[*str++];
- g = h & ((unsigned long) 0xf << 16u);
+ g = h & ((unsigned) 0xf << 16u);
if (g) {
h ^= g >> 16u;
h ^= g >> 5u;