1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2021-03-07 02:13:02 +01:00
parent 2d64ffaee5
commit 84679d254f

View File

@ -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;