소스 검색

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