[*] God dammit -> fix pointer variant of Fnv1 and ignore constness in shared ptr's virtual Get return type

This commit is contained in:
Reece Wilson 2022-05-26 10:52:46 +01:00
parent 68cf9de104
commit 79e09c9513
2 changed files with 7 additions and 4 deletions

View File

@ -339,7 +339,7 @@ namespace Aurora::Memory
inline virtual void *Get() override
{
return Base_t::operator->();
return (void *)Base_t::operator->();
}
auline void _cache()

View File

@ -43,19 +43,22 @@ inline constexpr AuUInt32 AuFnv1a32(const char *const str, const AuUInt32 value
inline constexpr AuUInt AuFnv1aType(const char *type, AuUInt size, AuUInt index, const AuUInt value) noexcept
{
return (index == size) ? value : AuFnv1aType(type + 1, size, index + 1, (value ^ AuUInt(*type) * kFnv1MagicPrimePlatform));
return (index == size) ? value : AuFnv1aType(type + 1, size, index + 1, (value ^ AuUInt(*type)) * kFnv1MagicPrimePlatform);
}
template <class T>
inline constexpr AuUInt AuFnv1aType(const T &type, const AuUInt value = kFnv1MagicValPlatform) noexcept
{
return AuFnv1aType(((const char *)&type) + 1, sizeof(T), 1, (value ^ AuUInt(*(const char *)&type) * kFnv1MagicPrimePlatform));
return AuFnv1aType(((const char *)&type) + 1, sizeof(T), 1, (value ^ (AuUInt(*(const char *)&type)) * kFnv1MagicPrimePlatform));
}
template <class T>
inline constexpr AuUInt AuFnv1aPtr(const T *const type, AuUInt length, const AuUInt value = kFnv1MagicValPlatform) noexcept
{
return AuFnv1aType(((const char *)type) + 1, length, 1, (value ^ AuUInt(*(const char *)type) * kFnv1MagicPrimePlatform));
return AuFnv1aType(((const char *)type),
length,
0,
value);
}
inline constexpr auto AuFnv1a(const char *const str) noexcept