diff --git a/include/util.hpp b/include/util.hpp index 90c1235b..3d8b208a 100644 --- a/include/util.hpp +++ b/include/util.hpp @@ -51,7 +51,7 @@ char const *printChar(int c); struct Uppercase { // FNV-1a hash of an uppercased string constexpr size_t operator()(std::string const &str) const { - return std::accumulate(RANGE(str), 0x811C9DC5, [](size_t hash, char c) { + return std::accumulate(RANGE(str), size_t(0x811C9DC5), [](size_t hash, char c) { return (hash ^ toUpper(c)) * 16777619; }); } diff --git a/src/diagnostics.cpp b/src/diagnostics.cpp index af3c81dd..b610c9df 100644 --- a/src/diagnostics.cpp +++ b/src/diagnostics.cpp @@ -76,5 +76,5 @@ std::pair> getInitialWarningState(std::str } } - return {state, param > UINT32_MAX ? UINT32_MAX : param}; + return {state, param > UINT32_MAX ? UINT32_MAX : uint32_t(param)}; } diff --git a/src/gfx/pal_spec.cpp b/src/gfx/pal_spec.cpp index b8b08704..32d3cdd1 100644 --- a/src/gfx/pal_spec.cpp +++ b/src/gfx/pal_spec.cpp @@ -204,7 +204,7 @@ static void warnExtraColors( // Parses the initial part of a string_view, advancing the "read index" as it does template // Should be uint*_t static std::optional parseDec(std::string const &str, size_t &n) { - uintmax_t value = 0; + UintT value = 0; auto result = std::from_chars(str.data() + n, str.data() + str.length(), value); if (static_cast(result.ec)) { return std::nullopt;