diff --git a/include/exiv2/value.hpp b/include/exiv2/value.hpp index 2115af9d..383ba872 100644 --- a/include/exiv2/value.hpp +++ b/include/exiv2/value.hpp @@ -1248,8 +1248,7 @@ namespace Exiv2 { } } else if (std::is_signed::value) { // conversion is from unsigned to signed - const auto imax = - static_cast::type>(std::numeric_limits::max()); + const auto imax = std::make_unsigned_t(std::numeric_limits::max()); if (imax < b || imax < a) { return 0; } @@ -1260,8 +1259,8 @@ namespace Exiv2 { return 0; } // Inputs are not negative so convert them to unsigned. - const auto a_u = static_cast::type>(a); - const auto b_u = static_cast::type>(b); + const auto a_u = std::make_unsigned_t(a); + const auto b_u = std::make_unsigned_t(b); if (imax < b_u || imax < a_u) { return 0; }