mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-23 18:19:21 +01:00
Common: Fix 2 implicit conversion warnings in CityHash
This commit is contained in:
parent
712e6ee960
commit
3e456cd3fe
@ -179,7 +179,7 @@ static uint64 HashLen0to16(const char* s, size_t len) {
|
|||||||
uint8 b = s[len >> 1];
|
uint8 b = s[len >> 1];
|
||||||
uint8 c = s[len - 1];
|
uint8 c = s[len - 1];
|
||||||
uint32 y = static_cast<uint32>(a) + (static_cast<uint32>(b) << 8);
|
uint32 y = static_cast<uint32>(a) + (static_cast<uint32>(b) << 8);
|
||||||
uint32 z = len + (static_cast<uint32>(c) << 2);
|
uint32 z = static_cast<uint32>(len) + (static_cast<uint32>(c) << 2);
|
||||||
return ShiftMix(y * k2 ^ z * k0) * k2;
|
return ShiftMix(y * k2 ^ z * k0) * k2;
|
||||||
}
|
}
|
||||||
return k2;
|
return k2;
|
||||||
@ -290,7 +290,7 @@ static uint128 CityMurmur(const char* s, size_t len, uint128 seed) {
|
|||||||
uint64 b = Uint128High64(seed);
|
uint64 b = Uint128High64(seed);
|
||||||
uint64 c = 0;
|
uint64 c = 0;
|
||||||
uint64 d = 0;
|
uint64 d = 0;
|
||||||
signed long l = len - 16;
|
signed long l = static_cast<long>(len) - 16;
|
||||||
if (l <= 0) { // len <= 16
|
if (l <= 0) { // len <= 16
|
||||||
a = ShiftMix(a * k1) * k1;
|
a = ShiftMix(a * k1) * k1;
|
||||||
c = b * k1 + HashLen0to16(s, len);
|
c = b * k1 + HashLen0to16(s, len);
|
||||||
|
Loading…
Reference in New Issue
Block a user