From b11a9981b9679118aecaea274edf7e307c90c3c7 Mon Sep 17 00:00:00 2001 From: Lee Newberg Date: Fri, 29 Oct 2021 17:41:03 -0400 Subject: [PATCH] COMP: Fix unsigned<0 warning for itkSetClampMacro. --- Modules/Core/Common/include/itkMacro.h | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index 7d2072af48b..564c59830a6 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -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