aboutsummaryrefslogtreecommitdiff
path: root/games/openmw/files/patch-components_misc_strings_algorithm.hpp
diff options
context:
space:
mode:
authorDima Panov <fluffy@FreeBSD.org>2025-07-29 10:06:17 +0000
committerDima Panov <fluffy@FreeBSD.org>2025-07-29 10:10:33 +0000
commitf53aee55c0c0069817c67b0e43cba9061b479c0f (patch)
tree16534e289e25a31bdad1a755d99f8df1acf596c2 /games/openmw/files/patch-components_misc_strings_algorithm.hpp
parent8fd31f95b3e4895e175d53caf541af2194eb08dc (diff)
Diffstat (limited to 'games/openmw/files/patch-components_misc_strings_algorithm.hpp')
-rw-r--r--games/openmw/files/patch-components_misc_strings_algorithm.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/games/openmw/files/patch-components_misc_strings_algorithm.hpp b/games/openmw/files/patch-components_misc_strings_algorithm.hpp
new file mode 100644
index 000000000000..c7aa3b1ecfeb
--- /dev/null
+++ b/games/openmw/files/patch-components_misc_strings_algorithm.hpp
@@ -0,0 +1,28 @@
+--- components/misc/strings/algorithm.hpp.orig 2025-07-01 11:41:15 UTC
++++ components/misc/strings/algorithm.hpp
+@@ -4,6 +4,7 @@
+ #include "lower.hpp"
+
+ #include <algorithm>
++#include <cstdint>
+ #include <functional>
+ #include <string>
+ #include <string_view>
+@@ -88,14 +89,14 @@ namespace Misc::StringUtils
+ constexpr std::size_t operator()(std::string_view str) const
+ {
+ // FNV-1a
+- std::size_t hash{ 0xcbf29ce484222325ull };
+- constexpr std::size_t prime{ 0x00000100000001B3ull };
++ std::uint64_t hash{ 0xcbf29ce484222325ull };
++ constexpr std::uint64_t prime{ 0x00000100000001B3ull };
+ for (char c : str)
+ {
+- hash ^= static_cast<std::size_t>(toLower(c));
++ hash ^= static_cast<std::uint64_t>(toLower(c));
+ hash *= prime;
+ }
+- return hash;
++ return static_cast<std::size_t>(hash);
+ }
+ };