Fix ambiguous calls to safe_shift_left() in basisu_containers.h

Explicitly cast 1 to `uint64_t` to resolve overload ambiguity between `safe_shift_left(uint32_t, uint32_t)` and `safe_shift_left(uint64_t, uint32_t)`.
This commit is contained in:
Jakub Marcowski
2025-03-11 18:35:04 +01:00
committed by GitHub
parent 2da6664eab
commit b738655c40

View File

@@ -3349,7 +3349,7 @@ namespace basisu
inline size_t hash_key(const Key& k) const
{
assert((safe_shift_left(1ULL, (SIZE_T_BITS - m_hash_shift))) == m_values.size());
assert((safe_shift_left(static_cast<uint64_t>(1), (SIZE_T_BITS - m_hash_shift))) == m_values.size());
// Fibonacci hashing
if (SIZE_T_BITS == 32)
@@ -3433,7 +3433,7 @@ namespace basisu
return false;
new_map.m_hash_shift = SIZE_T_BITS - helpers::floor_log2i((uint64_t)new_hash_size);
assert(new_hash_size == safe_shift_left(1ULL, SIZE_T_BITS - new_map.m_hash_shift));
assert(new_hash_size == safe_shift_left(static_cast<uint64_t>(1), SIZE_T_BITS - new_map.m_hash_shift));
new_map.m_grow_threshold = std::numeric_limits<size_t>::max();