Преглед изворни кода

bit: handle conversion warnings

Michele Caini пре 1 година
родитељ
комит
2df2dd2d6f
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/entt/core/bit.hpp

+ 1 - 1
src/entt/core/bit.hpp

@@ -62,7 +62,7 @@ template<typename Type>
 template<typename Type>
 [[nodiscard]] constexpr std::enable_if_t<std::is_unsigned_v<Type>, Type> fast_mod(const Type value, const std::size_t mod) noexcept {
     ENTT_ASSERT_CONSTEXPR(has_single_bit(mod), "Value must be a power of two");
-    return value & (mod - 1u);
+    return static_cast<Type>(value & (mod - 1u));
 }
 
 } // namespace entt