Skip to content

Commit

Permalink
COMP: fixed cppcheck warnings about identical options in ternary oper…
Browse files Browse the repository at this point in the history
…ator

Probably was a way to avoid unused variable warnings. Added itkNotUsed instead.
  • Loading branch information
seanm authored and N-Dekker committed Jan 7, 2025
1 parent b7c6cb4 commit cfec55a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions Modules/Core/Common/include/itkNumericTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,14 @@ class NumericTraits<bool> : public std::numeric_limits<bool>
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;
Expand Down Expand Up @@ -640,14 +640,14 @@ class NumericTraits<unsigned char> : public std::numeric_limits<unsigned char>
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;
Expand Down Expand Up @@ -845,14 +845,14 @@ class NumericTraits<unsigned short> : public std::numeric_limits<unsigned short>
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;
Expand Down Expand Up @@ -1069,14 +1069,14 @@ class NumericTraits<unsigned int> : public std::numeric_limits<unsigned int>
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;
Expand Down

0 comments on commit cfec55a

Please sign in to comment.