[med-svn] [Git][med-team/insighttoolkit][master] 2 commits: Use full ::itk namespace in itkMacro.

Steven Robbins (@smr) gitlab at salsa.debian.org
Mon Sep 25 06:31:51 BST 2023



Steven Robbins pushed to branch master at Debian Med / insighttoolkit


Commits:
d47841b9 by Steve Robbins at 2023-09-24T23:54:17-05:00
Use full ::itk namespace in itkMacro.

Applied upstream patch identified by Flavien Bridault.
Closes: #1052223.

- - - - -
5a3a5e1e by Steve Robbins at 2023-09-24T23:57:35-05:00
Update for new release.

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/0003-Use-full-itk-namespace-in-itkMacro.h.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+insighttoolkit5 (5.3.0-6) unstable; urgency=medium
+
+  [ Steve Robbins ]
+  * [d47841b] Use full ::itk namespace in itkMacro.  Applied upstream patch
+    identified by Flavien Bridault.  (Closes: #1052223)
+
+ -- Steve M. Robbins <smr at debian.org>  Sun, 24 Sep 2023 23:55:49 -0500
+
 insighttoolkit5 (5.3.0-5) unstable; urgency=medium
 
   [ Andreas Tille ]


=====================================
debian/patches/0003-Use-full-itk-namespace-in-itkMacro.h.patch
=====================================
@@ -0,0 +1,215 @@
+From: Steve Robbins <steve at sumost.ca>
+Date: Sun, 24 Sep 2023 23:48:29 -0500
+Subject: Use full ::itk namespace in itkMacro.h
+
+This patch obtained from upstream tree, with some hand edits for
+stanzas that did not apply cleanly.
+https://github.com/InsightSoftwareConsortium/ITK/commit/7f2fc29f1ffb53d1f12cdbfca3f81df6edf2f56d
+
+Fixes upstream bug https://github.com/InsightSoftwareConsortium/ITK/issues/4074
+Reported in Debian as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052223
+---
+ Modules/Core/Common/include/itkMacro.h | 114 ++++++++++++++++-----------------
+ 1 file changed, 57 insertions(+), 57 deletions(-)
+
+diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h
+index 3979841..6029bd8 100644
+--- a/Modules/Core/Common/include/itkMacro.h
++++ b/Modules/Core/Common/include/itkMacro.h
+@@ -313,26 +313,26 @@ namespace itk
+   itkCloneMacro(x);         \
+   ITK_MACROEND_NOOP_STATEMENT
+ 
+-#define itkSimpleNewMacro(x)                            \
+-  static Pointer New()                                  \
+-  {                                                     \
+-    Pointer smartPtr = itk::ObjectFactory<x>::Create(); \
+-    if (smartPtr == nullptr)                            \
+-    {                                                   \
+-      smartPtr = new x;                                 \
+-    }                                                   \
+-    smartPtr->UnRegister();                             \
+-    return smartPtr;                                    \
+-  }                                                     \
++#define itkSimpleNewMacro(x)                              \
++  static Pointer New()                                    \
++  {                                                       \
++    Pointer smartPtr = ::itk::ObjectFactory<x>::Create(); \
++    if (smartPtr == nullptr)                              \
++    {                                                     \
++      smartPtr = new x;                                   \
++    }                                                     \
++    smartPtr->UnRegister();                               \
++    return smartPtr;                                      \
++  }                                                       \
+   ITK_MACROEND_NOOP_STATEMENT
+ 
+-#define itkCreateAnotherMacro(x)                           \
+-  itk::LightObject::Pointer CreateAnother() const override \
+-  {                                                        \
+-    itk::LightObject::Pointer smartPtr;                    \
+-    smartPtr = x::New().GetPointer();                      \
+-    return smartPtr;                                       \
+-  }                                                        \
++#define itkCreateAnotherMacro(x)                             \
++  ::itk::LightObject::Pointer CreateAnother() const override \
++  {                                                          \
++    ::itk::LightObject::Pointer smartPtr;                    \
++    smartPtr = x::New().GetPointer();                        \
++    return smartPtr;                                         \
++  }                                                          \
+   ITK_MACROEND_NOOP_STATEMENT
+ 
+ #define itkCloneMacro(x)                                                  \
+@@ -355,7 +355,7 @@ namespace itk
+ #define itkSimpleFactoryOnlyNewMacro(x)                                                                 \
+   static auto New()->Pointer                                                                            \
+   {                                                                                                     \
+-    Pointer smartPtr = itk::ObjectFactory<x>::Create();                                                 \
++    Pointer smartPtr = ::itk::ObjectFactory<x>::Create();                                               \
+     if (smartPtr == nullptr)                                                                            \
+     {                                                                                                   \
+       itkSpecializedMessageExceptionMacro(ExceptionObject,                                              \
+@@ -378,21 +378,21 @@ namespace itk
+  * UnRegister() on the rawPtr to compensate for LightObject's constructor
+  * initializing an object's reference count to 1 (needed for proper
+  * initialization of process objects and data objects cycles). */
+-#define itkFactorylessNewMacro(x)                          \
+-  static Pointer New()                                     \
+-  {                                                        \
+-    Pointer smartPtr;                                      \
+-    x *     rawPtr = new x;                                \
+-    smartPtr = rawPtr;                                     \
+-    rawPtr->UnRegister();                                  \
+-    return smartPtr;                                       \
+-  }                                                        \
+-  itk::LightObject::Pointer CreateAnother() const override \
+-  {                                                        \
+-    itk::LightObject::Pointer smartPtr;                    \
+-    smartPtr = x::New().GetPointer();                      \
+-    return smartPtr;                                       \
+-  }                                                        \
++#define itkFactorylessNewMacro(x)                            \
++  static Pointer New()                                       \
++  {                                                          \
++    Pointer smartPtr;                                        \
++    x *     rawPtr = new x;                                  \
++    smartPtr = rawPtr;                                       \
++    rawPtr->UnRegister();                                    \
++    return smartPtr;                                         \
++  }                                                          \
++  ::itk::LightObject::Pointer CreateAnother() const override \
++  {                                                          \
++    ::itk::LightObject::Pointer smartPtr;                    \
++    smartPtr = x::New().GetPointer();                        \
++    return smartPtr;                                         \
++  }                                                          \
+   ITK_MACROEND_NOOP_STATEMENT
+ 
+ //
+@@ -487,12 +487,12 @@ OutputWindowDisplayDebugText(const char *);
+ #  define itkDebugMacro(x)                                                     \
+     do                                                                         \
+     {                                                                          \
+-      if (this->GetDebug() && itk::Object::GetGlobalWarningDisplay())          \
++      if (this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay())        \
+       {                                                                        \
+         std::ostringstream itkmsg;                                             \
+         itkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n"          \
+                << this->GetNameOfClass() << " (" << this << "): " x << "\n\n"; \
+-        itk::OutputWindowDisplayDebugText(itkmsg.str().c_str());               \
++        ::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str());             \
+       }                                                                        \
+     } while (0)
+ 
+@@ -507,12 +507,12 @@ OutputWindowDisplayDebugText(const char *);
+ #define itkWarningMacro(x)                                                   \
+   do                                                                         \
+   {                                                                          \
+-    if (itk::Object::GetGlobalWarningDisplay())                              \
++    if (::itk::Object::GetGlobalWarningDisplay())                            \
+     {                                                                        \
+       std::ostringstream itkmsg;                                             \
+       itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n"        \
+              << this->GetNameOfClass() << " (" << this << "): " x << "\n\n"; \
+-      itk::OutputWindowDisplayWarningText(itkmsg.str().c_str());             \
++      ::itk::OutputWindowDisplayWarningText(itkmsg.str().c_str());           \
+     }                                                                        \
+   } while (0)
+ 
+@@ -550,13 +550,13 @@ OutputWindowDisplayDebugText(const char *);
+   {                                                                                                                  \
+     std::ostringstream exceptionDescriptionOutputStringStream;                                                       \
+     exceptionDescriptionOutputStringStream << "ITK ERROR: " x;                                                       \
+-    throw itk::ExceptionType(                                                                                        \
++    throw ::itk::ExceptionType(                                                                                      \
+       std::string{ __FILE__ }, __LINE__, exceptionDescriptionOutputStringStream.str(), std::string{ ITK_LOCATION }); \
+   }                                                                                                                  \
+   ITK_MACROEND_NOOP_STATEMENT
+ 
+ #define itkSpecializedExceptionMacro(ExceptionType) \
+-  itkSpecializedMessageExceptionMacro(ExceptionType, << itk::ExceptionType::default_exception_message)
++  itkSpecializedMessageExceptionMacro(ExceptionType, << ::itk::ExceptionType::default_exception_message)
+ 
+ /** The itkExceptionMacro macro is used to print error information (i.e., usually
+  * a condition that results in program failure). Example usage looks like:
+@@ -568,11 +568,11 @@ OutputWindowDisplayDebugText(const char *);
+ 
+ #define itkGenericOutputMacro(x)                                                   \
+   {                                                                                \
+-    if (itk::Object::GetGlobalWarningDisplay())                                    \
++    if (::itk::Object::GetGlobalWarningDisplay())                                  \
+     {                                                                              \
+       std::ostringstream itkmsg;                                                   \
+       itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" x << "\n\n"; \
+-      itk::OutputWindowDisplayGenericOutputText(itkmsg.str().c_str());             \
++      ::itk::OutputWindowDisplayGenericOutputText(itkmsg.str().c_str());           \
+     }                                                                              \
+   }                                                                                \
+   ITK_MACROEND_NOOP_STATEMENT
+@@ -580,22 +580,22 @@ OutputWindowDisplayDebugText(const char *);
+ //----------------------------------------------------------------------------
+ // Macros for simplifying the use of logging
+ //
+-#define itkLogMacro(x, y)                              \
+-  {                                                    \
+-    if (this->GetLogger())                             \
+-    {                                                  \
+-      this->GetLogger()->Write(itk::LoggerBase::x, y); \
+-    }                                                  \
+-  }                                                    \
++#define itkLogMacro(x, y)                                \
++  {                                                      \
++    if (this->GetLogger())                               \
++    {                                                    \
++      this->GetLogger()->Write(::itk::LoggerBase::x, y); \
++    }                                                    \
++  }                                                      \
+   ITK_MACROEND_NOOP_STATEMENT
+ 
+-#define itkLogMacroStatic(obj, x, y)                  \
+-  {                                                   \
+-    if (obj->GetLogger())                             \
+-    {                                                 \
+-      obj->GetLogger()->Write(itk::LoggerBase::x, y); \
+-    }                                                 \
+-  }                                                   \
++#define itkLogMacroStatic(obj, x, y)                    \
++  {                                                     \
++    if (obj->GetLogger())                               \
++    {                                                   \
++      obj->GetLogger()->Write(::itk::LoggerBase::x, y); \
++    }                                                   \
++  }                                                     \
+   ITK_MACROEND_NOOP_STATEMENT
+ 
+ //----------------------------------------------------------------------------
+@@ -770,7 +770,7 @@ compilers.
+   DestinationType, Sourcrnd_halfintup, DestinationElementType, DestinationArray, SourceArray, NumberOfIterations) \
+   for (unsigned int i = 0; i < NumberOfIterations; ++i)                                                           \
+   {                                                                                                               \
+-    DestinationArray[i] = itk::Math::Round<DestinationElementType>(SourceArray[i]);                               \
++    DestinationArray[i] = ::itk::Math::Round<DestinationElementType>(SourceArray[i]);                             \
+   }
+ 
+ // end of Template Meta Programming helper macros


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 0001-Fix-building-and-running-with-system-MINC.patch
 0002-Fix-build-with-GCC-13.patch
+0003-Use-full-itk-namespace-in-itkMacro.h.patch



View it on GitLab: https://salsa.debian.org/med-team/insighttoolkit/-/compare/61134be9389bcfc0eddeff4aa5a7aa8ad228cdc3...5a3a5e1ec8c8aef2a77c3434451b3a9e70f3b8c1

-- 
View it on GitLab: https://salsa.debian.org/med-team/insighttoolkit/-/compare/61134be9389bcfc0eddeff4aa5a7aa8ad228cdc3...5a3a5e1ec8c8aef2a77c3434451b3a9e70f3b8c1
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230925/4bd7c805/attachment-0001.htm>


More information about the debian-med-commit mailing list