diff --git a/src/entt/core/hashed_string.hpp b/src/entt/core/hashed_string.hpp index 5510b9fe3..bb7d5d8a0 100644 --- a/src/entt/core/hashed_string.hpp +++ b/src/entt/core/hashed_string.hpp @@ -25,6 +25,7 @@ struct fnv1a_traits; template<> struct fnv1a_traits { + using type = std::uint32_t; static constexpr std::uint32_t offset = 2166136261; static constexpr std::uint32_t prime = 16777619; }; @@ -32,6 +33,7 @@ struct fnv1a_traits { template<> struct fnv1a_traits { + using type = std::uint64_t; static constexpr std::uint64_t offset = 14695981039346656037ull; static constexpr std::uint64_t prime = 1099511628211ull; }; @@ -72,7 +74,7 @@ class basic_hashed_string { auto value = traits_type::offset; while(*curr != 0) { - value = (value ^ (*(curr++))) * traits_type::prime; + value = (value ^ static_cast(*(curr++))) * traits_type::prime; } return value; diff --git a/test/lib/registry/lib.cpp b/test/lib/registry/lib.cpp index 77eaaa412..581f34eec 100644 --- a/test/lib/registry/lib.cpp +++ b/test/lib/registry/lib.cpp @@ -4,8 +4,8 @@ ENTT_API void update_position(entt::registry ®istry) { registry.view().each([](auto &pos, auto &vel) { - pos.x += 16 * vel.dx; - pos.y += 16 * vel.dy; + pos.x += static_cast(16 * vel.dx); + pos.y += static_cast(16 * vel.dy); }); } diff --git a/test/lib/registry_std/lib.cpp b/test/lib/registry_std/lib.cpp index 77eaaa412..581f34eec 100644 --- a/test/lib/registry_std/lib.cpp +++ b/test/lib/registry_std/lib.cpp @@ -4,8 +4,8 @@ ENTT_API void update_position(entt::registry ®istry) { registry.view().each([](auto &pos, auto &vel) { - pos.x += 16 * vel.dx; - pos.y += 16 * vel.dy; + pos.x += static_cast(16 * vel.dx); + pos.y += static_cast(16 * vel.dy); }); }