Skip to content

Commit

Permalink
COMP: Fix unsigned<0 warning for itkSetClampMacro.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leengit committed Oct 29, 2021
1 parent 759b8ff commit b11a998
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Modules/Core/Common/include/itkMacro.h
Expand Up @@ -1047,20 +1047,20 @@ compilers.
/** Set built-in type where value is constrained between min/max limits.
* Create member Set"name"() (e.q., SetRadius()). \#defines are
* convenience for clamping open-ended values. */
#define itkSetClampMacro(name, type, min, max) \
virtual void Set##name(type _arg) \
{ \
const type temp_extrema = (_arg < min ? min : (_arg > max ? max : _arg)); \
itkDebugMacro("setting " << #name " to " << _arg); \
CLANG_PRAGMA_PUSH \
CLANG_SUPPRESS_Wfloat_equal \
if (this->m_##name != temp_extrema) \
{ \
this->m_##name = temp_extrema; \
this->Modified(); \
} \
CLANG_PRAGMA_POP \
} \
#define itkSetClampMacro(name, type, min, max) \
virtual void Set##name(type _arg) \
{ \
const type temp_extrema = (_arg <= min ? min : (_arg >= max ? max : _arg)); \
itkDebugMacro("setting " << #name " to " << _arg); \
CLANG_PRAGMA_PUSH \
CLANG_SUPPRESS_Wfloat_equal \
if (this->m_##name != temp_extrema) \
{ \
this->m_##name = temp_extrema; \
this->Modified(); \
} \
CLANG_PRAGMA_POP \
} \
ITK_MACROEND_NOOP_STATEMENT
// clang-format on

Expand Down

0 comments on commit b11a998

Please sign in to comment.