From a2e5248a8349a36803f15b7e8d61f3c0cf722610 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Tue, 31 May 2022 14:09:43 +0200 Subject: [PATCH] STYLE: Pass numeric parameters by (const) value, not by const reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed the ampersand (`&`) from declarations of "in" (`const`) numeric parameters (`int`, `unsigned int`, `long`, `unsigned long`, `long long`, `unsigned long long`, `signed char`, `unsigned char`, `float`, `double`) of non-virtual member functions and non-member functions. Following C++ Core Guidelines, April 10, 2022, "For “in” parameters, pass cheaply-copied types by value and others by reference to `const`": https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f16-for-in-parameters-pass-cheaply-copied-types-by-value-and-others-by-reference-to-const --- .../Common/include/itkCompensatedSummation.h | 4 +- .../include/itkCompensatedSummation.hxx | 4 +- .../Common/include/itkDerivativeOperator.h | 2 +- .../Core/Common/include/itkGaussianOperator.h | 4 +- ...itkMersenneTwisterRandomVariateGenerator.h | 20 ++--- .../Common/include/itkNeighborhoodOperator.h | 2 +- .../Common/src/itkCompensatedSummation.cxx | 4 +- .../Common/test/itkExceptionObjectTest.cxx | 4 +- .../test/itkBinaryMask3DMeshSourceTest.cxx | 80 +++++++++---------- .../itkQuadEdgeMeshEulerOperatorsTestHelper.h | 2 +- .../include/itkAnisotropicDiffusionFunction.h | 4 +- .../FFT/include/itkFFTWGlobalConfiguration.h | 4 +- .../FFT/src/itkFFTWGlobalConfiguration.cxx | 4 +- .../itkFastMarchingExtensionImageFilterBase.h | 2 +- ...tkFastMarchingExtensionImageFilterBase.hxx | 2 +- .../itkGPUAnisotropicDiffusionFunction.h | 4 +- .../test/itkWarpVectorImageFilterTest.cxx | 2 +- .../include/itkNoiseBaseImageFilter.h | 2 +- .../include/itkNoiseBaseImageFilter.hxx | 2 +- .../LabelMap/include/itkShapeLabelObject.h | 20 ++--- .../include/itkStatisticsLabelObject.h | 22 ++--- ...adEdgeMeshDecimationQuadricElementHelper.h | 2 +- .../IO/CSV/include/itkCSVArray2DDataObject.h | 12 +-- .../CSV/include/itkCSVArray2DDataObject.hxx | 12 +-- Modules/IO/HDF5/include/itkHDF5ImageIO.h | 10 +-- Modules/IO/HDF5/src/itkHDF5ImageIO.cxx | 8 +- .../itkInternationalizationIOHelpers.h | 4 +- .../include/itkRegionBasedLevelSetFunction.h | 2 +- ...itkRegionBasedLevelSetFunctionSharedData.h | 6 +- .../itkScalarRegionBasedLevelSetFunction.h | 2 +- .../itkScalarRegionBasedLevelSetFunction.hxx | 2 +- .../NarrowBand/include/itkNarrowBand.h | 4 +- .../include/itkNarrowBandImageFilterBase.h | 6 +- .../Statistics/include/itkMembershipSample.h | 2 +- .../include/itkMembershipSample.hxx | 2 +- 35 files changed, 134 insertions(+), 134 deletions(-) diff --git a/Modules/Core/Common/include/itkCompensatedSummation.h b/Modules/Core/Common/include/itkCompensatedSummation.h index cd4e32d2898..9af83c4af5e 100644 --- a/Modules/Core/Common/include/itkCompensatedSummation.h +++ b/Modules/Core/Common/include/itkCompensatedSummation.h @@ -130,9 +130,9 @@ class ITK_TEMPLATE_EXPORT CompensatedSummation }; void ITKCommon_EXPORT - CompensatedSummationAddElement(float & compensation, float & sum, const float & element); + CompensatedSummationAddElement(float & compensation, float & sum, const float element); void ITKCommon_EXPORT - CompensatedSummationAddElement(double & compensation, double & sum, const double & element); + CompensatedSummationAddElement(double & compensation, double & sum, const double element); } // end namespace itk diff --git a/Modules/Core/Common/include/itkCompensatedSummation.hxx b/Modules/Core/Common/include/itkCompensatedSummation.hxx index 0eef5619f91..4be5d2f1ef1 100644 --- a/Modules/Core/Common/include/itkCompensatedSummation.hxx +++ b/Modules/Core/Common/include/itkCompensatedSummation.hxx @@ -23,9 +23,9 @@ namespace itk { void ITKCommon_EXPORT - CompensatedSummationAddElement(float & compensation, float & sum, const float & element); + CompensatedSummationAddElement(float & compensation, float & sum, const float element); void ITKCommon_EXPORT - CompensatedSummationAddElement(double & compensation, double & sum, const double & element); + CompensatedSummationAddElement(double & compensation, double & sum, const double element); #ifndef itkCompensatedSummation_cxx // We try the looser pragma guards if we don't have an explicit instantiation. diff --git a/Modules/Core/Common/include/itkDerivativeOperator.h b/Modules/Core/Common/include/itkDerivativeOperator.h index 6c8f1d9463f..397264c64da 100644 --- a/Modules/Core/Common/include/itkDerivativeOperator.h +++ b/Modules/Core/Common/include/itkDerivativeOperator.h @@ -81,7 +81,7 @@ class ITK_TEMPLATE_EXPORT DerivativeOperator : public NeighborhoodOperatorm_Order = order; } diff --git a/Modules/Core/Common/include/itkGaussianOperator.h b/Modules/Core/Common/include/itkGaussianOperator.h index 15bb925e15a..afec558c733 100644 --- a/Modules/Core/Common/include/itkGaussianOperator.h +++ b/Modules/Core/Common/include/itkGaussianOperator.h @@ -78,7 +78,7 @@ class ITK_TEMPLATE_EXPORT GaussianOperator : public NeighborhoodOperator= 1 || max_error <= 0) { diff --git a/Modules/Core/Common/include/itkMersenneTwisterRandomVariateGenerator.h b/Modules/Core/Common/include/itkMersenneTwisterRandomVariateGenerator.h index a5f0458205c..416c2d8de0c 100644 --- a/Modules/Core/Common/include/itkMersenneTwisterRandomVariateGenerator.h +++ b/Modules/Core/Common/include/itkMersenneTwisterRandomVariateGenerator.h @@ -177,7 +177,7 @@ class ITKCommon_EXPORT MersenneTwisterRandomVariateGenerator : public RandomVari /** Get a random variate in the range [0, n] */ double - GetVariateWithClosedRange(const double & n); + GetVariateWithClosedRange(const double n); /** Get a range variate in the range [0, 1) */ double @@ -185,7 +185,7 @@ class ITKCommon_EXPORT MersenneTwisterRandomVariateGenerator : public RandomVari /** Get a range variate in the range [0, n) */ double - GetVariateWithOpenUpperRange(const double & n); + GetVariateWithOpenUpperRange(const double n); /** Get a range variate in the range (0, 1) */ double @@ -193,7 +193,7 @@ class ITKCommon_EXPORT MersenneTwisterRandomVariateGenerator : public RandomVari /** Get a range variate in the range (0, n) */ double - GetVariateWithOpenRange(const double & n); + GetVariateWithOpenRange(const double n); /** Get an integer variate in [0, 2^32-1] */ IntegerType @@ -211,12 +211,12 @@ class ITKCommon_EXPORT MersenneTwisterRandomVariateGenerator : public RandomVari /* Access to a normal random number distribution * TODO: Compare with vnl_sample_normal */ double - GetNormalVariate(const double & mean = 0.0, const double & variance = 1.0); + GetNormalVariate(const double mean = 0.0, const double variance = 1.0); /* Access to a uniform random number distribution in the range [a, b) * TODO: Compare with vnl_sample_uniform */ double - GetUniformVariate(const double & a, const double & b); + GetUniformVariate(const double a, const double b); /** Get a variate in the range [0, 1] * Do NOT use for CRYPTOGRAPHY without securely hashing several returned @@ -435,7 +435,7 @@ MersenneTwisterRandomVariateGenerator::GetVariateWithClosedRange() /** Get a random variate in the range [0, n] */ inline double -MersenneTwisterRandomVariateGenerator::GetVariateWithClosedRange(const double & n) +MersenneTwisterRandomVariateGenerator::GetVariateWithClosedRange(const double n) { return GetVariateWithClosedRange() * n; } @@ -449,7 +449,7 @@ MersenneTwisterRandomVariateGenerator::GetVariateWithOpenUpperRange() /** Get a range variate in the range [0, n) */ inline double -MersenneTwisterRandomVariateGenerator::GetVariateWithOpenUpperRange(const double & n) +MersenneTwisterRandomVariateGenerator::GetVariateWithOpenUpperRange(const double n) { return GetVariateWithOpenUpperRange() * n; } @@ -463,7 +463,7 @@ MersenneTwisterRandomVariateGenerator::GetVariateWithOpenRange() /** Get a range variate in the range (0, n) */ inline double -MersenneTwisterRandomVariateGenerator::GetVariateWithOpenRange(const double & n) +MersenneTwisterRandomVariateGenerator::GetVariateWithOpenRange(const double n) { return GetVariateWithOpenRange() * n; } @@ -504,7 +504,7 @@ MersenneTwisterRandomVariateGenerator::Get53BitVariate() /** Access to a normal random number distribution. */ // TODO: Compare with vnl_sample_normal inline double -MersenneTwisterRandomVariateGenerator::GetNormalVariate(const double & mean, const double & variance) +MersenneTwisterRandomVariateGenerator::GetNormalVariate(const double mean, const double variance) { // Return a real number from a normal (Gaussian) distribution with given // mean and variance by Box-Muller method @@ -517,7 +517,7 @@ MersenneTwisterRandomVariateGenerator::GetNormalVariate(const double & mean, con /** Access to a uniform random number distribution */ // TODO: Compare with vnl_sample_uniform inline double -MersenneTwisterRandomVariateGenerator::GetUniformVariate(const double & a, const double & b) +MersenneTwisterRandomVariateGenerator::GetUniformVariate(const double a, const double b) { double u = GetVariateWithOpenUpperRange(); diff --git a/Modules/Core/Common/include/itkNeighborhoodOperator.h b/Modules/Core/Common/include/itkNeighborhoodOperator.h index 614030734e6..5f6d7a868d2 100644 --- a/Modules/Core/Common/include/itkNeighborhoodOperator.h +++ b/Modules/Core/Common/include/itkNeighborhoodOperator.h @@ -91,7 +91,7 @@ class ITK_TEMPLATE_EXPORT NeighborhoodOperator : public Neighborhood std::vector -GeneratePointCoordinates(const unsigned int & iN) +GeneratePointCoordinates(const unsigned int iN) { using PointType = typename TMesh::PointType; using CoordRepType = typename PointType::CoordRepType; diff --git a/Modules/Filtering/AnisotropicSmoothing/include/itkAnisotropicDiffusionFunction.h b/Modules/Filtering/AnisotropicSmoothing/include/itkAnisotropicDiffusionFunction.h index 334cad1f4b7..db19510a387 100644 --- a/Modules/Filtering/AnisotropicSmoothing/include/itkAnisotropicDiffusionFunction.h +++ b/Modules/Filtering/AnisotropicSmoothing/include/itkAnisotropicDiffusionFunction.h @@ -187,7 +187,7 @@ class ITK_TEMPLATE_EXPORT AnisotropicDiffusionFunction : public FiniteDifference /** Set/Get the conductance parameter. The conductance parameter. */ void - SetConductanceParameter(const double & c) + SetConductanceParameter(const double c) { m_ConductanceParameter = c; } @@ -206,7 +206,7 @@ class ITK_TEMPLATE_EXPORT AnisotropicDiffusionFunction : public FiniteDifference } void - SetAverageGradientMagnitudeSquared(const double & c) + SetAverageGradientMagnitudeSquared(const double c) { m_AverageGradientMagnitudeSquared = c; } diff --git a/Modules/Filtering/FFT/include/itkFFTWGlobalConfiguration.h b/Modules/Filtering/FFT/include/itkFFTWGlobalConfiguration.h index 9122028619f..c2979d5390c 100644 --- a/Modules/Filtering/FFT/include/itkFFTWGlobalConfiguration.h +++ b/Modules/Filtering/FFT/include/itkFFTWGlobalConfiguration.h @@ -237,7 +237,7 @@ class ITKFFT_EXPORT FFTWGlobalConfiguration : public Object * FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE */ static void - SetPlanRigor(const int & v); + SetPlanRigor(const int v); static int GetPlanRigor(); @@ -250,7 +250,7 @@ class ITKFFT_EXPORT FFTWGlobalConfiguration : public Object /** Translate plan rigor value to name. An exception is sent if the value is not valid. */ static std::string - GetPlanRigorName(const int & value); + GetPlanRigorName(const int value); /** * \brief Set/Get the behavior of wisdom file caching diff --git a/Modules/Filtering/FFT/src/itkFFTWGlobalConfiguration.cxx b/Modules/Filtering/FFT/src/itkFFTWGlobalConfiguration.cxx index d1d842f8e8c..1211549d636 100644 --- a/Modules/Filtering/FFT/src/itkFFTWGlobalConfiguration.cxx +++ b/Modules/Filtering/FFT/src/itkFFTWGlobalConfiguration.cxx @@ -110,7 +110,7 @@ FFTWGlobalConfiguration::GetPlanRigorValue(const std::string & name) } std::string -FFTWGlobalConfiguration::GetPlanRigorName(const int & value) +FFTWGlobalConfiguration::GetPlanRigorName(const int value) { switch (value) { @@ -758,7 +758,7 @@ FFTWGlobalConfiguration::GetNewWisdomAvailable() } void -FFTWGlobalConfiguration::SetPlanRigor(const int & v) +FFTWGlobalConfiguration::SetPlanRigor(const int v) { itkInitGlobalsMacro(PimplGlobals); // use that method to check the value diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.h b/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.h index 25fc0c6a25e..3e8beaffc37 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.h +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.h @@ -109,7 +109,7 @@ class ITK_TEMPLATE_EXPORT FastMarchingExtensionImageFilterBase : public FastMarc /** Get one of the extended auxiliary variable image. */ AuxImageType * - GetAuxiliaryImage(const unsigned int & idx); + GetAuxiliaryImage(const unsigned int idx); /** Set the container auxiliary values at the initial alive points. */ itkSetObjectMacro(AuxiliaryAliveValues, AuxValueContainerType); diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.hxx index 9acae3c6f3e..e1d4104eb42 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.hxx @@ -54,7 +54,7 @@ FastMarchingExtensionImageFilterBase: template typename FastMarchingExtensionImageFilterBase::AuxImageType * FastMarchingExtensionImageFilterBase::GetAuxiliaryImage( - const unsigned int & idx) + const unsigned int idx) { if (idx >= AuxDimension || this->GetNumberOfIndexedOutputs() < idx + 2) { diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUAnisotropicDiffusionFunction.h b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUAnisotropicDiffusionFunction.h index eabb0762147..40f420ea707 100644 --- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUAnisotropicDiffusionFunction.h +++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUAnisotropicDiffusionFunction.h @@ -86,7 +86,7 @@ class ITK_TEMPLATE_EXPORT GPUAnisotropicDiffusionFunction : public GPUFiniteDiff /** Set/Get the conductance parameter. The conductance parameter. */ void - SetConductanceParameter(const double & c) + SetConductanceParameter(const double c) { m_ConductanceParameter = c; } @@ -105,7 +105,7 @@ class ITK_TEMPLATE_EXPORT GPUAnisotropicDiffusionFunction : public GPUFiniteDiff } void - SetAverageGradientMagnitudeSquared(const double & c) + SetAverageGradientMagnitudeSquared(const double c) { m_AverageGradientMagnitudeSquared = c; } diff --git a/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx index 7dc80aafebd..7f42a4a94b2 100644 --- a/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx @@ -41,7 +41,7 @@ class ImagePattern } double - Evaluate(const IndexType & index, const SizeType & size, const SizeType & clampSize, const float & padValue) + Evaluate(const IndexType & index, const SizeType & size, const SizeType & clampSize, const float padValue) { double accum = m_Offset; for (int j = 0; j < VDimension; ++j) diff --git a/Modules/Filtering/ImageNoise/include/itkNoiseBaseImageFilter.h b/Modules/Filtering/ImageNoise/include/itkNoiseBaseImageFilter.h index 0e3a3fc715d..51a3c5ee4c7 100644 --- a/Modules/Filtering/ImageNoise/include/itkNoiseBaseImageFilter.h +++ b/Modules/Filtering/ImageNoise/include/itkNoiseBaseImageFilter.h @@ -78,7 +78,7 @@ class ITK_TEMPLATE_EXPORT NoiseBaseImageFilter : public InPlaceImageFilter::SetSeed() template auto -NoiseBaseImageFilter::ClampCast(const double & value) -> OutputImagePixelType +NoiseBaseImageFilter::ClampCast(const double value) -> OutputImagePixelType { if (value >= static_cast(NumericTraits::max())) { diff --git a/Modules/Filtering/LabelMap/include/itkShapeLabelObject.h b/Modules/Filtering/LabelMap/include/itkShapeLabelObject.h index f58bc2e7004..97e5b3e9072 100644 --- a/Modules/Filtering/LabelMap/include/itkShapeLabelObject.h +++ b/Modules/Filtering/LabelMap/include/itkShapeLabelObject.h @@ -352,7 +352,7 @@ class ITK_TEMPLATE_EXPORT ShapeLabelObject : public LabelObject::GetColumnIndexByName(const std::string & column_nam template auto -CSVArray2DDataObject::GetRow(const unsigned int & row_index) const -> NumericVectorType +CSVArray2DDataObject::GetRow(const unsigned int row_index) const -> NumericVectorType { NumericVectorType row; unsigned int max_rows = this->m_Matrix.rows() - 1; @@ -107,7 +107,7 @@ CSVArray2DDataObject::GetRow(const std::string & row_name) const -> Numer template auto -CSVArray2DDataObject::GetColumn(const unsigned int & column_index) const -> NumericVectorType +CSVArray2DDataObject::GetColumn(const unsigned int column_index) const -> NumericVectorType { NumericVectorType column; unsigned int max_columns = this->m_Matrix.columns() - 1; @@ -136,7 +136,7 @@ CSVArray2DDataObject::GetColumn(const std::string & column_name) const -> template TData -CSVArray2DDataObject::GetData(const unsigned int & row, const unsigned int & column) const +CSVArray2DDataObject::GetData(const unsigned int row, const unsigned int column) const { if (row > this->m_Matrix.rows() - 1) { @@ -161,7 +161,7 @@ CSVArray2DDataObject::GetData(const std::string & row_name, const std::st template TData -CSVArray2DDataObject::GetRowData(const std::string & row_name, const unsigned int & column_index) const +CSVArray2DDataObject::GetRowData(const std::string & row_name, const unsigned int column_index) const { unsigned int row_index = this->GetRowIndexByName(row_name); return this->GetData(row_index, column_index); @@ -169,7 +169,7 @@ CSVArray2DDataObject::GetRowData(const std::string & row_name, const unsi template TData -CSVArray2DDataObject::GetColumnData(const std::string & column_name, const unsigned int & row_index) const +CSVArray2DDataObject::GetColumnData(const std::string & column_name, const unsigned int row_index) const { unsigned int column_index = this->GetColumnIndexByName(column_name); return this->GetData(row_index, column_index); @@ -177,7 +177,7 @@ CSVArray2DDataObject::GetColumnData(const std::string & column_name, cons template TData -CSVArray2DDataObject::operator()(const unsigned int & row_index, const unsigned int & column_index) const +CSVArray2DDataObject::operator()(const unsigned int row_index, const unsigned int column_index) const { return this->GetData(row_index, column_index); } diff --git a/Modules/IO/HDF5/include/itkHDF5ImageIO.h b/Modules/IO/HDF5/include/itkHDF5ImageIO.h index 634e2d98494..8bf904b8ecb 100644 --- a/Modules/IO/HDF5/include/itkHDF5ImageIO.h +++ b/Modules/IO/HDF5/include/itkHDF5ImageIO.h @@ -156,15 +156,15 @@ class ITKIOHDF5_EXPORT HDF5ImageIO : public StreamingImageIOBase ReadString(const std::string & path); void - WriteScalar(const std::string & path, const bool & value); + WriteScalar(const std::string & path, const bool value); void - WriteScalar(const std::string & path, const long & value); + WriteScalar(const std::string & path, const long value); void - WriteScalar(const std::string & path, const unsigned long & value); + WriteScalar(const std::string & path, const unsigned long value); void - WriteScalar(const std::string & path, const long long & value); + WriteScalar(const std::string & path, const long long value); void - WriteScalar(const std::string & path, const unsigned long long & value); + WriteScalar(const std::string & path, const unsigned long long value); template void diff --git a/Modules/IO/HDF5/src/itkHDF5ImageIO.cxx b/Modules/IO/HDF5/src/itkHDF5ImageIO.cxx index e563b139aae..5e08c0b8959 100644 --- a/Modules/IO/HDF5/src/itkHDF5ImageIO.cxx +++ b/Modules/IO/HDF5/src/itkHDF5ImageIO.cxx @@ -284,7 +284,7 @@ HDF5ImageIO ::WriteScalar(const std::string & path, const bool value) } void -HDF5ImageIO ::WriteScalar(const std::string & path, const long & value) +HDF5ImageIO ::WriteScalar(const std::string & path, const long value) { hsize_t numScalars(1); H5::DataSpace scalarSpace(1, &numScalars); @@ -307,7 +307,7 @@ HDF5ImageIO ::WriteScalar(const std::string & path, const long & value) } void -HDF5ImageIO ::WriteScalar(const std::string & path, const unsigned long & value) +HDF5ImageIO ::WriteScalar(const std::string & path, const unsigned long value) { hsize_t numScalars(1); H5::DataSpace scalarSpace(1, &numScalars); @@ -330,7 +330,7 @@ HDF5ImageIO ::WriteScalar(const std::string & path, const unsigned long & value) } void -HDF5ImageIO ::WriteScalar(const std::string & path, const long long & value) +HDF5ImageIO ::WriteScalar(const std::string & path, const long long value) { hsize_t numScalars(1); H5::DataSpace scalarSpace(1, &numScalars); @@ -352,7 +352,7 @@ HDF5ImageIO ::WriteScalar(const std::string & path, const long long & value) } void -HDF5ImageIO ::WriteScalar(const std::string & path, const unsigned long long & value) +HDF5ImageIO ::WriteScalar(const std::string & path, const unsigned long long value) { hsize_t numScalars(1); H5::DataSpace scalarSpace(1, &numScalars); diff --git a/Modules/IO/ImageBase/include/itkInternationalizationIOHelpers.h b/Modules/IO/ImageBase/include/itkInternationalizationIOHelpers.h index 3e5267029ed..08278839a50 100644 --- a/Modules/IO/ImageBase/include/itkInternationalizationIOHelpers.h +++ b/Modules/IO/ImageBase/include/itkInternationalizationIOHelpers.h @@ -115,7 +115,7 @@ Utf8StringToWString(const std::string & str) // Get a file descriptor from a filename (using utf8 to wstring // on windows if requested) without specifying any specific permissions inline int -I18nOpen(const std::string & str, const int & flags) +I18nOpen(const std::string & str, const int flags) { #if LOCAL_USE_WIN32_WOPEN // mingw has _wopen @@ -130,7 +130,7 @@ I18nOpen(const std::string & str, const int & flags) // Get a file descriptor from a filename (using utf8 to wstring // on windows if requested) inline int -I18nOpen(const std::string & str, const int & flags, const int & mode) +I18nOpen(const std::string & str, const int flags, const int mode) { #if LOCAL_USE_WIN32_WOPEN // mingw has _wopen diff --git a/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.h b/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.h index cba7dd6f5e2..f26e142be18 100644 --- a/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.h +++ b/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunction.h @@ -337,7 +337,7 @@ class ITK_TEMPLATE_EXPORT RegionBasedLevelSetFunction : public FiniteDifferenceF /** Set function id. */ void - SetFunctionId(const unsigned int & iFid) + SetFunctionId(const unsigned int iFid) { this->m_FunctionId = iFid; } diff --git a/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunctionSharedData.h b/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunctionSharedData.h index 8f563b733ea..83a9688b03a 100644 --- a/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunctionSharedData.h +++ b/Modules/Nonunit/Review/include/itkRegionBasedLevelSetFunctionSharedData.h @@ -128,7 +128,7 @@ class RegionBasedLevelSetFunctionSharedData : public LightObject using LevelSetDataPointerVectorIterator = typename LevelSetDataPointerVector::iterator; void - SetFunctionCount(const unsigned int & n) + SetFunctionCount(const unsigned int n) { this->m_FunctionCount = n; this->m_LevelSetDataPointerVector.resize(n, nullptr); @@ -143,13 +143,13 @@ class RegionBasedLevelSetFunctionSharedData : public LightObject } void - SetNumberOfNeighbors(const unsigned int & n) + SetNumberOfNeighbors(const unsigned int n) { this->m_NumberOfNeighbors = n; } void - CreateHeavisideFunctionOfLevelSetImage(const unsigned int & j, const InputImageType * image) + CreateHeavisideFunctionOfLevelSetImage(const unsigned int j, const InputImageType * image) { m_LevelSetDataPointerVector[j]->CreateHeavisideFunctionOfLevelSetImage(image); } diff --git a/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.h b/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.h index c7ec3c7b22a..6e51fb7061b 100644 --- a/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.h +++ b/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.h @@ -125,7 +125,7 @@ class ITK_TEMPLATE_EXPORT ScalarRegionBasedLevelSetFunction shared data which contains information from the other level sets). Using the new H values, the previous c_i are updated. */ void - UpdatePixel(const unsigned int & idx, + UpdatePixel(const unsigned int idx, NeighborhoodIterator & iterator, InputPixelType & newValue, bool & status); diff --git a/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.hxx b/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.hxx index 8227f4f4fde..6c36076e9f0 100644 --- a/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.hxx +++ b/Modules/Nonunit/Review/include/itkScalarRegionBasedLevelSetFunction.hxx @@ -68,7 +68,7 @@ filter */ template void ScalarRegionBasedLevelSetFunction::UpdatePixel( - const unsigned int & idx, + const unsigned int idx, NeighborhoodIterator & iterator, InputPixelType & newValue, bool & itkNotUsed(status)) diff --git a/Modules/Numerics/NarrowBand/include/itkNarrowBand.h b/Modules/Numerics/NarrowBand/include/itkNarrowBand.h index f59c9be581c..e19121a26b3 100644 --- a/Modules/Numerics/NarrowBand/include/itkNarrowBand.h +++ b/Modules/Numerics/NarrowBand/include/itkNarrowBand.h @@ -161,7 +161,7 @@ class ITK_TEMPLATE_EXPORT NarrowBand : public LightObject this value (positive and negative distance to the zero level set). The user of the narrow band container should set up this value properly. */ void - SetTotalRadius(const float & val) + SetTotalRadius(const float val) { m_TotalRadius = val; } @@ -175,7 +175,7 @@ class ITK_TEMPLATE_EXPORT NarrowBand : public LightObject /** Set/Get the narrow band inner radius. The inner radius is the safe are where the level set can be computed.*/ void - SetInnerRadius(const float & val) + SetInnerRadius(const float val) { m_InnerRadius = val; } diff --git a/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.h b/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.h index 4892d9d489a..558af2acc70 100644 --- a/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.h +++ b/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.h @@ -142,7 +142,7 @@ class ITK_TEMPLATE_EXPORT NarrowBandImageFilterBase : public FiniteDifferenceIma } void - InsertNarrowBandNode(const IndexType & index, const PixelType & value, const signed char & nodestate) + InsertNarrowBandNode(const IndexType & index, const PixelType & value, const signed char nodestate) { BandNodeType tmpnode; @@ -158,7 +158,7 @@ class ITK_TEMPLATE_EXPORT NarrowBandImageFilterBase : public FiniteDifferenceIma * twice this value (positive and negative distance to the zero level * set). The default value is 3. */ void - SetNarrowBandTotalRadius(const float & val) + SetNarrowBandTotalRadius(const float val) { if (m_NarrowBand->GetTotalRadius() != val) { @@ -177,7 +177,7 @@ class ITK_TEMPLATE_EXPORT NarrowBandImageFilterBase : public FiniteDifferenceIma /** Set the narrow band inner radius. The inner radius is the safe * are where the level set can be computed. The default value is 1. */ void - SetNarrowBandInnerRadius(const float & val) + SetNarrowBandInnerRadius(const float val) { if (m_NarrowBand->GetInnerRadius() != val) { diff --git a/Modules/Numerics/Statistics/include/itkMembershipSample.h b/Modules/Numerics/Statistics/include/itkMembershipSample.h index 763803c56db..13de609fd2f 100644 --- a/Modules/Numerics/Statistics/include/itkMembershipSample.h +++ b/Modules/Numerics/Statistics/include/itkMembershipSample.h @@ -136,7 +136,7 @@ class ITK_TEMPLATE_EXPORT MembershipSample : public DataObject /** returns the measurement element which is the 'n'-th element * in the 'd' dimension of the measurement vector */ MeasurementType - GetMeasurement(const InstanceIdentifier & id, const unsigned int & dimension); + GetMeasurement(const InstanceIdentifier & id, const unsigned int dimension); /** returns the frequency of the instance which is identified by the 'id' */ AbsoluteFrequencyType diff --git a/Modules/Numerics/Statistics/include/itkMembershipSample.hxx b/Modules/Numerics/Statistics/include/itkMembershipSample.hxx index 4ca073fad2e..47447f0e25d 100644 --- a/Modules/Numerics/Statistics/include/itkMembershipSample.hxx +++ b/Modules/Numerics/Statistics/include/itkMembershipSample.hxx @@ -108,7 +108,7 @@ MembershipSample::GetMeasurementVector(const InstanceIdentifier & id) c template inline typename MembershipSample::MeasurementType -MembershipSample::GetMeasurement(const InstanceIdentifier & id, const unsigned int & dimension) +MembershipSample::GetMeasurement(const InstanceIdentifier & id, const unsigned int dimension) { return m_Sample->GetMeasurement(id, dimension); }