From cfec55a3da7cb2e97223646ef2b315cf079a33f8 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Thu, 2 Jan 2025 23:40:21 -0500 Subject: [PATCH] COMP: fixed cppcheck warnings about identical options in ternary operator Probably was a way to avoid unused variable warnings. Added itkNotUsed instead. --- .../Core/Common/include/itkNumericTraits.h | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Modules/Core/Common/include/itkNumericTraits.h b/Modules/Core/Common/include/itkNumericTraits.h index 55bce536e3d..65dcdaf3f7a 100644 --- a/Modules/Core/Common/include/itkNumericTraits.h +++ b/Modules/Core/Common/include/itkNumericTraits.h @@ -308,14 +308,14 @@ class NumericTraits : public std::numeric_limits return !val; } static constexpr bool - IsNegative(bool val) + IsNegative(bool itkNotUsed(val)) { - return val ? false : false; + return false; } static constexpr bool - IsNonnegative(bool val) + IsNonnegative(bool itkNotUsed(val)) { - return val ? true : true; + return true; } static constexpr bool IsSigned = false; static constexpr bool IsInteger = true; @@ -640,14 +640,14 @@ class NumericTraits : public std::numeric_limits return val == Zero; } static constexpr bool - IsNegative(unsigned char val) + IsNegative(unsigned char itkNotUsed(val)) { - return val ? false : false; + return false; } static constexpr bool - IsNonnegative(unsigned char val) + IsNonnegative(unsigned char itkNotUsed(val)) { - return val ? true : true; + return true; } static constexpr bool IsSigned = false; static constexpr bool IsInteger = true; @@ -845,14 +845,14 @@ class NumericTraits : public std::numeric_limits return val == Zero; } static constexpr bool - IsNegative(unsigned short val) + IsNegative(unsigned short itkNotUsed(val)) { - return val ? false : false; + return false; } static constexpr bool - IsNonnegative(unsigned short val) + IsNonnegative(unsigned short itkNotUsed(val)) { - return val ? true : true; + return true; } static constexpr bool IsSigned = false; static constexpr bool IsInteger = true; @@ -1069,14 +1069,14 @@ class NumericTraits : public std::numeric_limits return val == Zero; } static constexpr bool - IsNegative(unsigned int val) + IsNegative(unsigned int itkNotUsed(val)) { - return val ? false : false; + return false; } static constexpr bool - IsNonnegative(unsigned int val) + IsNonnegative(unsigned int itkNotUsed(val)) { - return val ? true : true; + return true; } static constexpr bool IsSigned = false; static constexpr bool IsInteger = true;