Skip to content

Commit b11a998

Browse files
committed
COMP: Fix unsigned<0 warning for itkSetClampMacro.
1 parent 759b8ff commit b11a998

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Modules/Core/Common/include/itkMacro.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,20 +1047,20 @@ compilers.
10471047
/** Set built-in type where value is constrained between min/max limits.
10481048
* Create member Set"name"() (e.q., SetRadius()). \#defines are
10491049
* convenience for clamping open-ended values. */
1050-
#define itkSetClampMacro(name, type, min, max) \
1051-
virtual void Set##name(type _arg) \
1052-
{ \
1053-
const type temp_extrema = (_arg < min ? min : (_arg > max ? max : _arg)); \
1054-
itkDebugMacro("setting " << #name " to " << _arg); \
1055-
CLANG_PRAGMA_PUSH \
1056-
CLANG_SUPPRESS_Wfloat_equal \
1057-
if (this->m_##name != temp_extrema) \
1058-
{ \
1059-
this->m_##name = temp_extrema; \
1060-
this->Modified(); \
1061-
} \
1062-
CLANG_PRAGMA_POP \
1063-
} \
1050+
#define itkSetClampMacro(name, type, min, max) \
1051+
virtual void Set##name(type _arg) \
1052+
{ \
1053+
const type temp_extrema = (_arg <= min ? min : (_arg >= max ? max : _arg)); \
1054+
itkDebugMacro("setting " << #name " to " << _arg); \
1055+
CLANG_PRAGMA_PUSH \
1056+
CLANG_SUPPRESS_Wfloat_equal \
1057+
if (this->m_##name != temp_extrema) \
1058+
{ \
1059+
this->m_##name = temp_extrema; \
1060+
this->Modified(); \
1061+
} \
1062+
CLANG_PRAGMA_POP \
1063+
} \
10641064
ITK_MACROEND_NOOP_STATEMENT
10651065
// clang-format on
10661066

0 commit comments

Comments
 (0)