diff --git a/Modules/Core/Common/include/itkBSplineInterpolationWeightFunction.h b/Modules/Core/Common/include/itkBSplineInterpolationWeightFunction.h index ba70c2c25dc..100e2f24167 100644 --- a/Modules/Core/Common/include/itkBSplineInterpolationWeightFunction.h +++ b/Modules/Core/Common/include/itkBSplineInterpolationWeightFunction.h @@ -106,10 +106,16 @@ class ITK_TEMPLATE_EXPORT BSplineInterpolationWeightFunction #if !defined(ITK_LEGACY_REMOVE) /** Get support region size. */ - itkLegacyMacro(SizeType GetSupportSize() const) { return Self::SupportSize; } + itkLegacyMacro(SizeType GetSupportSize() const) + { + return Self::SupportSize; + } /** Get number of weights. */ - itkLegacyMacro(unsigned int GetNumberOfWeights() const) { return Self::NumberOfWeights; } + itkLegacyMacro(unsigned int GetNumberOfWeights() const) + { + return Self::NumberOfWeights; + } #endif protected: diff --git a/Modules/Core/Common/include/itkFixedArray.h b/Modules/Core/Common/include/itkFixedArray.h index 9b0cebca955..d9f154e2705 100644 --- a/Modules/Core/Common/include/itkFixedArray.h +++ b/Modules/Core/Common/include/itkFixedArray.h @@ -260,12 +260,12 @@ class ITK_TEMPLATE_EXPORT FixedArray /** Allow the FixedArray to be indexed normally. No bounds checking is done. */ -// false positive warnings with GCC -ITK_GCC_PRAGMA_PUSH -ITK_GCC_SUPPRESS_Warray_bounds + // false positive warnings with GCC + ITK_GCC_PRAGMA_PUSH + ITK_GCC_SUPPRESS_Warray_bounds constexpr reference operator[](unsigned int index) { return m_InternalArray[index]; } constexpr const_reference operator[](unsigned int index) const { return m_InternalArray[index]; } -ITK_GCC_PRAGMA_POP + ITK_GCC_PRAGMA_POP /** Set/Get element methods are more convenient in wrapping languages */ void diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index 7c90fca28fe..9ece12444e4 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -121,7 +121,8 @@ namespace itk #if defined(__clang__) && defined(__has_warning) # define ITK_CLANG_PRAGMA_PUSH ITK_PRAGMA(clang diagnostic push) # define ITK_CLANG_PRAGMA_POP ITK_PRAGMA(clang diagnostic pop) -# define ITK_CLANG_SUPPRESS_Wzero_as_null_pointer_constant ITK_PRAGMA(clang diagnostic ignored "-Wzero-as-null-pointer-constant") +# define ITK_CLANG_SUPPRESS_Wzero_as_null_pointer_constant \ + ITK_PRAGMA(clang diagnostic ignored "-Wzero-as-null-pointer-constant") #else # define ITK_CLANG_PRAGMA_PUSH # define ITK_CLANG_PRAGMA_POP diff --git a/Modules/Core/Common/include/itkMatrix.h b/Modules/Core/Common/include/itkMatrix.h index 524c018adbb..801289bb29e 100644 --- a/Modules/Core/Common/include/itkMatrix.h +++ b/Modules/Core/Common/include/itkMatrix.h @@ -306,20 +306,20 @@ class ITK_TEMPLATE_EXPORT Matrix swap(this->m_Matrix, other.m_Matrix); } - inline void PrintSelf(std::ostream & os, Indent indent) const - { - os << indent << "Matrix (" << VRows << "x" << VColumns << ")\n"; - for (unsigned int r = 0; r < VRows; ++r) + inline void + PrintSelf(std::ostream & os, Indent indent) const + { + os << indent << "Matrix (" << VRows << "x" << VColumns << ")\n"; + for (unsigned int r = 0; r < VRows; ++r) + { + os << indent << " "; + for (unsigned int c = 0; c < VColumns; ++c) { - os << indent << " "; - for (unsigned int c = 0; c < VColumns; ++c) - { - os << m_Matrix(r, c) << " "; - } - os << "\n"; + os << m_Matrix(r, c) << " "; } - - } + os << "\n"; + } + } private: InternalMatrixType m_Matrix{}; diff --git a/Modules/Core/Common/include/itkMultiThreaderBase.h b/Modules/Core/Common/include/itkMultiThreaderBase.h index 821d2a60f12..8b0467bb3ac 100644 --- a/Modules/Core/Common/include/itkMultiThreaderBase.h +++ b/Modules/Core/Common/include/itkMultiThreaderBase.h @@ -223,7 +223,10 @@ class ITKCommon_EXPORT MultiThreaderBase : public Object this->SetMaximumNumberOfThreads(numberOfThreads); this->SetNumberOfWorkUnits(this->GetMaximumNumberOfThreads()); // Might be clamped } - itkLegacyMacro(virtual ThreadIdType GetNumberOfThreads()) { return this->GetNumberOfWorkUnits(); } + itkLegacyMacro(virtual ThreadIdType GetNumberOfThreads()) + { + return this->GetNumberOfWorkUnits(); + } /** This is the structure that is passed to the thread that is * created from the SingleMethodExecute. It is passed in as a void *, diff --git a/Modules/Core/Common/include/itkSingleton.h b/Modules/Core/Common/include/itkSingleton.h index 051207323b0..a2b2c280844 100644 --- a/Modules/Core/Common/include/itkSingleton.h +++ b/Modules/Core/Common/include/itkSingleton.h @@ -33,7 +33,8 @@ */ template [[deprecated("Preferably use the C++ `[[maybe_unused]]` attribute instead!")]] inline void -Unused(const T &){} +Unused(const T &) +{} #endif namespace itk diff --git a/Modules/Core/Common/test/itkSmartPointerGTest.cxx b/Modules/Core/Common/test/itkSmartPointerGTest.cxx index 72ed6411912..c2de0daa0e1 100644 --- a/Modules/Core/Common/test/itkSmartPointerGTest.cxx +++ b/Modules/Core/Common/test/itkSmartPointerGTest.cxx @@ -129,8 +129,8 @@ TEST(SmartPointer, EmptyAndNull) cptr = nullptr; EXPECT_TRUE(cptr.IsNull()); -ITK_CLANG_PRAGMA_PUSH -ITK_CLANG_SUPPRESS_Wzero_as_null_pointer_constant + ITK_CLANG_PRAGMA_PUSH + ITK_CLANG_SUPPRESS_Wzero_as_null_pointer_constant // NOLINTNEXTLINE(modernize-use-nullptr) ptr = NULL; // Do not change NULL, null, Null in this file. This file intentionally contains usage of legacy NULL @@ -138,7 +138,7 @@ ITK_CLANG_SUPPRESS_Wzero_as_null_pointer_constant // NOLINTNEXTLINE(modernize-use-nullptr) cptr = NULL; // Do not change NULL, null, Null in this file. This file intentionally contains usage of legacy NULL -ITK_CLANG_PRAGMA_POP + ITK_CLANG_PRAGMA_POP EXPECT_TRUE(cptr.IsNull()); diff --git a/Modules/Core/SpatialObjects/include/itkEllipseSpatialObject.h b/Modules/Core/SpatialObjects/include/itkEllipseSpatialObject.h index 57e8bbc7357..66ce1ac5fa9 100644 --- a/Modules/Core/SpatialObjects/include/itkEllipseSpatialObject.h +++ b/Modules/Core/SpatialObjects/include/itkEllipseSpatialObject.h @@ -100,13 +100,25 @@ class ITK_TEMPLATE_EXPORT EllipseSpatialObject : public SpatialObjectSetRadiusInObjectSpace(radius); } - - itkLegacyMacro(void SetRadius(ArrayType radii)) { this->SetRadiusInObjectSpace(radii); } - - itkLegacyMacro(ArrayType GetRadius() const) { return this->GetRadiusInObjectSpace(); } - - itkLegacyMacro(void SetRadiiInObjectSpace(ArrayType radii)) { this->SetRadiusInObjectSpace(radii); } + itkLegacyMacro(void SetRadius(double radius)) + { + this->SetRadiusInObjectSpace(radius); + } + + itkLegacyMacro(void SetRadius(ArrayType radii)) + { + this->SetRadiusInObjectSpace(radii); + } + + itkLegacyMacro(ArrayType GetRadius() const) + { + return this->GetRadiusInObjectSpace(); + } + + itkLegacyMacro(void SetRadiiInObjectSpace(ArrayType radii)) + { + this->SetRadiusInObjectSpace(radii); + } #endif protected: /** Get the boundaries of a specific object. This function needs to diff --git a/Modules/Core/SpatialObjects/include/itkGaussianSpatialObject.h b/Modules/Core/SpatialObjects/include/itkGaussianSpatialObject.h index e677e0abf34..9632a5f126d 100644 --- a/Modules/Core/SpatialObjects/include/itkGaussianSpatialObject.h +++ b/Modules/Core/SpatialObjects/include/itkGaussianSpatialObject.h @@ -123,9 +123,15 @@ class ITK_TEMPLATE_EXPORT GaussianSpatialObject : public SpatialObjectSetSigmaInObjectSpace(sigma); } - - itkLegacyMacro(double GetSigma() const) { return this->GetSigmaInObjectSpace(); } + itkLegacyMacro(void SetSigma(double sigma)) + { + return this->SetSigmaInObjectSpace(sigma); + } + + itkLegacyMacro(double GetSigma() const) + { + return this->GetSigmaInObjectSpace(); + } #endif protected: /** This function needs to be called every time one of the object's diff --git a/Modules/Core/SpatialObjects/include/itkImageSpatialObject.h b/Modules/Core/SpatialObjects/include/itkImageSpatialObject.h index 44553c7b2b0..7039a43165b 100644 --- a/Modules/Core/SpatialObjects/include/itkImageSpatialObject.h +++ b/Modules/Core/SpatialObjects/include/itkImageSpatialObject.h @@ -116,7 +116,10 @@ class ITK_TEMPLATE_EXPORT ImageSpatialObject : public SpatialObject } #if !defined(ITK_LEGACY_REMOVE) - itkLegacyMacro(const char * GetPixelTypeName()) { return m_PixelType.c_str(); } + itkLegacyMacro(const char * GetPixelTypeName()) + { + return m_PixelType.c_str(); + } #endif /** Set/Get the interpolator. */ diff --git a/Modules/Core/SpatialObjects/include/itkMeshSpatialObject.h b/Modules/Core/SpatialObjects/include/itkMeshSpatialObject.h index 19fa6a010b5..02074d28481 100644 --- a/Modules/Core/SpatialObjects/include/itkMeshSpatialObject.h +++ b/Modules/Core/SpatialObjects/include/itkMeshSpatialObject.h @@ -96,7 +96,10 @@ class ITK_TEMPLATE_EXPORT MeshSpatialObject : public SpatialObjectGetNumberOfWeights(); } + itkLegacyMacro(unsigned long GetNumberOfWeights() const) + { + return m_WeightsFunction->GetNumberOfWeights(); + } #endif /** Method to transform a vector - diff --git a/Modules/Core/Transform/include/itkBSplineTransform.h b/Modules/Core/Transform/include/itkBSplineTransform.h index 4a14e6de466..e6970c031b9 100644 --- a/Modules/Core/Transform/include/itkBSplineTransform.h +++ b/Modules/Core/Transform/include/itkBSplineTransform.h @@ -302,14 +302,17 @@ class ITK_TEMPLATE_EXPORT BSplineTransform : public BSplineBaseTransformSetNumberOfWorkUnits(number); } - itkLegacyMacro(virtual const ThreadIdType & GetNumberOfThreads() const) { return this->m_NumberOfWorkUnits; } + itkLegacyMacro(virtual void SetNumberOfThreads(ThreadIdType number)) + { + return this->SetNumberOfWorkUnits(number); + } + itkLegacyMacro(virtual const ThreadIdType & GetNumberOfThreads() const) + { + return this->m_NumberOfWorkUnits; + } #endif // !ITK_LEGACY_REMOVE /** Get the number of work units set to be used. */ diff --git a/Modules/Registration/Common/include/itkTransformParametersAdaptor.h b/Modules/Registration/Common/include/itkTransformParametersAdaptor.h index 3c5fa782c6c..00827dec16d 100644 --- a/Modules/Registration/Common/include/itkTransformParametersAdaptor.h +++ b/Modules/Registration/Common/include/itkTransformParametersAdaptor.h @@ -107,7 +107,8 @@ class TransformParametersAdaptor /** Initialize the transform using the specified fixed parameters */ void - AdaptTransformParameters() override{} + AdaptTransformParameters() override + {} protected: TransformParametersAdaptor() = default; diff --git a/Modules/Registration/Metricsv4/include/itkImageToImageMetricv4.h b/Modules/Registration/Metricsv4/include/itkImageToImageMetricv4.h index bd97c52e312..9bdbb72f843 100644 --- a/Modules/Registration/Metricsv4/include/itkImageToImageMetricv4.h +++ b/Modules/Registration/Metricsv4/include/itkImageToImageMetricv4.h @@ -465,10 +465,22 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetricv4 #if !defined(ITK_LEGACY_REMOVE) /** UseFixedSampledPointSet is deprecated and has been replaced * with UseSampledPointsSet. */ - itkLegacyMacro(virtual void SetUseFixedSampledPointSet(bool v)) { this->SetUseSampledPointSet(v); } - itkLegacyMacro(virtual bool GetUseFixedSampledPointSet() const) { return this->GetUseSampledPointSet(); } - itkLegacyMacro(virtual void UseFixedSampledPointSetOn()) { return this->UseSampledPointSetOn(); } - itkLegacyMacro(virtual void UseFixedSampledPointSetOff()) { return this->UseSampledPointSetOff(); } + itkLegacyMacro(virtual void SetUseFixedSampledPointSet(bool v)) + { + this->SetUseSampledPointSet(v); + } + itkLegacyMacro(virtual bool GetUseFixedSampledPointSet() const) + { + return this->GetUseSampledPointSet(); + } + itkLegacyMacro(virtual void UseFixedSampledPointSetOn()) + { + return this->UseSampledPointSetOn(); + } + itkLegacyMacro(virtual void UseFixedSampledPointSetOff()) + { + return this->UseSampledPointSetOff(); + } #endif @@ -515,7 +527,10 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetricv4 * GetValue() has been called. * * NOTE: deprecated. Use GetNumberOfWorkUnitsUsed() */ - itkLegacyMacro(virtual ThreadIdType GetNumberOfThreadsUsed() const) { return this->GetNumberOfWorkUnitsUsed(); } + itkLegacyMacro(virtual ThreadIdType GetNumberOfThreadsUsed() const) + { + return this->GetNumberOfWorkUnitsUsed(); + } /** Set number of threads to use. This the maximum number of threads to use * when multithreaded. The actual number of threads used (may be less than @@ -527,7 +542,10 @@ class ITK_TEMPLATE_EXPORT ImageToImageMetricv4 { this->SetMaximumNumberOfWorkUnits(count); } - itkLegacyMacro(virtual ThreadIdType GetMaximumNumberOfThreads() const) { return this->GetMaximumNumberOfWorkUnits(); } + itkLegacyMacro(virtual ThreadIdType GetMaximumNumberOfThreads() const) + { + return this->GetMaximumNumberOfWorkUnits(); + } #endif // !ITK_LEGACY_REMOVE