Skip to content

Commit cbb8efe

Browse files
committed
STYLE: Declare wanted parameter of CheckNumberOfSamples SizeValueType
The use of `unsigned long` as parameter type might cause narrowing type conversions, especially on Windows, for which `unsigned long` is only 32-bit.
1 parent 79645d2 commit cbb8efe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Common/CostFunctions/itkAdvancedImageToImageMetric.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ class ITK_TEMPLATE_EXPORT AdvancedImageToImageMetric : public ImageToImageMetric
483483
/** Check if enough samples have been found to compute a reliable
484484
* estimate of the value/derivative; throws an exception if not. */
485485
void
486-
CheckNumberOfSamples(unsigned long wanted) const;
486+
CheckNumberOfSamples(const SizeValueType wanted) const;
487487

488488
/** Methods for image derivative evaluation support **********/
489489

Common/CostFunctions/itkAdvancedImageToImageMetric.hxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ AdvancedImageToImageMetric<TFixedImage, TMovingImage>::AccumulateDerivativesThre
749749

750750
template <typename TFixedImage, typename TMovingImage>
751751
void
752-
AdvancedImageToImageMetric<TFixedImage, TMovingImage>::CheckNumberOfSamples(unsigned long wanted) const
752+
AdvancedImageToImageMetric<TFixedImage, TMovingImage>::CheckNumberOfSamples(const SizeValueType wanted) const
753753
{
754754
if (const SizeValueType found{ Superclass::m_NumberOfPixelsCounted }; found < wanted * m_RequiredRatioOfValidSamples)
755755
{

0 commit comments

Comments
 (0)