diff --git a/ricepp/include/ricepp/codec.h b/ricepp/include/ricepp/codec.h index 90b8d3ac..5105b8cc 100644 --- a/ricepp/include/ricepp/codec.h +++ b/ricepp/include/ricepp/codec.h @@ -130,7 +130,7 @@ class codec final { [[nodiscard]] size_t worst_case_bit_count(size_t pixel_count) const noexcept { static constexpr size_t const kFsBits{ - std::countr_zero(pixel_traits::kBitCount)}; + static_cast(std::countr_zero(pixel_traits::kBitCount))}; assert(pixel_count % kComponentStreamCount == 0); pixel_count /= kComponentStreamCount; size_t num = pixel_traits::kBitCount; // initial value diff --git a/ricepp/include/ricepp/detail/decode.h b/ricepp/include/ricepp/detail/decode.h index 5225c4e7..33a06d89 100644 --- a/ricepp/include/ricepp/detail/decode.h +++ b/ricepp/include/ricepp/detail/decode.h @@ -40,7 +40,8 @@ void decode_block(V block, BitstreamReader& reader, PixelTraits const& traits, typename PixelTraits::value_type& last_value) { using pixel_value_type = typename PixelTraits::value_type; static constexpr unsigned kPixelBits{PixelTraits::kBitCount}; - static constexpr unsigned kFsBits{std::countr_zero(kPixelBits)}; + static constexpr unsigned kFsBits{ + static_cast(std::countr_zero(kPixelBits))}; static constexpr unsigned kFsMax{kPixelBits - 2}; auto last = last_value; diff --git a/ricepp/include/ricepp/detail/encode.h b/ricepp/include/ricepp/detail/encode.h index 5854fee2..0fde4d85 100644 --- a/ricepp/include/ricepp/detail/encode.h +++ b/ricepp/include/ricepp/detail/encode.h @@ -91,7 +91,8 @@ void encode_block(V block, BitstreamWriter& writer, PixelTraits const& traits, typename PixelTraits::value_type& last_value) { using pixel_value_type = typename PixelTraits::value_type; static constexpr unsigned kPixelBits{PixelTraits::kBitCount}; - static constexpr unsigned kFsBits{std::countr_zero(kPixelBits)}; + static constexpr unsigned kFsBits{ + static_cast(std::countr_zero(kPixelBits))}; static constexpr unsigned kFsMax{kPixelBits - 2}; static constexpr pixel_value_type kPixelMsb{static_cast(1) << (kPixelBits - 1)};