|
| 1 | +diff --git a/components/esm/formid.hpp b/components/esm/formid.hpp |
| 2 | +index e9416e35c7..9fe89585c2 100644 |
| 3 | +--- a/components/esm/formid.hpp |
| 4 | ++++ b/components/esm/formid.hpp |
| 5 | +@@ -51,10 +51,10 @@ namespace std |
| 6 | + { |
| 7 | + size_t operator()(const ESM::FormId& formId) const |
| 8 | + { |
| 9 | +- static_assert(sizeof(ESM::FormId) == sizeof(size_t)); |
| 10 | +- size_t s; |
| 11 | +- memcpy(&s, &formId, sizeof(size_t)); |
| 12 | +- return hash<size_t>()(s); |
| 13 | ++ static_assert(sizeof(ESM::FormId) == sizeof(uint64_t)); |
| 14 | ++ uint64_t s; |
| 15 | ++ memcpy(&s, &formId, sizeof(ESM::FormId)); |
| 16 | ++ return hash<uint64_t>()(s); |
| 17 | + } |
| 18 | + }; |
| 19 | + |
| 20 | +diff --git a/components/misc/strings/algorithm.hpp b/components/misc/strings/algorithm.hpp |
| 21 | +index 18f72104bd..a41c6a54cc 100644 |
| 22 | +--- a/components/misc/strings/algorithm.hpp |
| 23 | ++++ b/components/misc/strings/algorithm.hpp |
| 24 | +@@ -4,6 +4,7 @@ |
| 25 | + #include "lower.hpp" |
| 26 | + |
| 27 | + #include <algorithm> |
| 28 | ++#include <cstdint> |
| 29 | + #include <functional> |
| 30 | + #include <string> |
| 31 | + #include <string_view> |
| 32 | +@@ -88,11 +89,11 @@ namespace Misc::StringUtils |
| 33 | + constexpr std::size_t operator()(std::string_view str) const |
| 34 | + { |
| 35 | + // FNV-1a |
| 36 | +- std::size_t hash{ 0xcbf29ce484222325ull }; |
| 37 | +- constexpr std::size_t prime{ 0x00000100000001B3ull }; |
| 38 | ++ std::uint64_t hash{ 0xcbf29ce484222325ull }; |
| 39 | ++ constexpr std::uint64_t prime{ 0x00000100000001B3ull }; |
| 40 | + for (char c : str) |
| 41 | + { |
| 42 | +- hash ^= static_cast<std::size_t>(toLower(c)); |
| 43 | ++ hash ^= static_cast<std::uint64_t>(toLower(c)); |
| 44 | + hash *= prime; |
| 45 | + } |
| 46 | + return hash; |
0 commit comments