From 09e0ea83f6095cca192b4e2c4a06ab52c599d77a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 5 Mar 2022 19:08:53 -0800 Subject: [PATCH] use make_unsigned_t Simpler Signed-off-by: Rosen Penev --- include/exiv2/value.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; }