Toxic features and improve protections (#897)

This commit is contained in:
maybegreat48
2023-01-22 21:57:32 +00:00
committed by GitHub
parent f360d7f436
commit d45d0c1ffc
59 changed files with 8056 additions and 6801 deletions

View File

@ -28,23 +28,5 @@ namespace rage
static_assert(consteval_joaat("test") == 0x3f75ccc1);
}
inline consteval rage::joaat_t operator""_j(const char* s, std::size_t n)
{
rage::joaat_t result = 0;
for (std::size_t i = 0; i < n; i++)
{
result += rage::joaat_to_lower(s[i]);
result += (result << 10);
result ^= (result >> 6);
}
result += (result << 3);
result ^= (result >> 11);
result += (result << 15);
return result;
}
#define RAGE_JOAAT_IMPL(str) (::rage::consteval_joaat(str))
#define RAGE_JOAAT(str) (std::integral_constant<rage::joaat_t, RAGE_JOAAT_IMPL(str)>::value)