Skip to content

Commit

Permalink
STYLE: Change unsigned to unsigned int.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leengit authored and hjmjohnson committed Jan 26, 2022
1 parent a0d4cef commit a812aa3
Show file tree
Hide file tree
Showing 224 changed files with 842 additions and 842 deletions.
2 changes: 1 addition & 1 deletion Examples/Iterators/NeighborhoodIterators6.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ main(int argc, char ** argv)
flag = false;

PixelType min = it.GetCenterPixel();
for (unsigned i = 0; i < it.Size(); ++i)
for (unsigned int i = 0; i < it.Size(); ++i)
{
if (it.GetPixel(i) < min)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ main(int argc, char * argv[])

// Software Guide : BeginCodeSnippet
using PixelType = unsigned char;
using AccumulatorPixelType = unsigned;
using AccumulatorPixelType = unsigned int;
using RadiusPixelType = float;
constexpr unsigned int Dimension = 2;
using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Statistics/ScalarImageKmeansClassifier.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ main(int argc, char * argv[])


// Software Guide : BeginCodeSnippet
for (unsigned k = 0; k < numberOfInitialClasses; ++k)
for (unsigned int k = 0; k < numberOfInitialClasses; ++k)
{
const double userProvidedInitialMean = std::stod(argv[k + argoffset]);
kmeansFilter->AddClassWithInitialMean(userProvidedInitialMean);
Expand Down
2 changes: 1 addition & 1 deletion Modules/Bridge/VtkGlue/include/itkViewImage.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ViewImage<TImage>::View(const ImageType * img, const std::string & winTitle, siz
double level = minIntensity + window / 2;
/** SLICES */
FixedArray<vtkSmartPointer<vtkImagePlaneWidget>, 3> slicePlanes;
for (unsigned i = 0; i < 3; ++i)
for (unsigned int i = 0; i < 3; ++i)
{
slicePlanes[i] = vtkSmartPointer<vtkImagePlaneWidget>::New();
slicePlanes[i]->SetResliceInterpolateToCubic();
Expand Down
2 changes: 1 addition & 1 deletion Modules/Compatibility/Deprecated/src/itkBarrier.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void
Barrier::Wait()
{
std::unique_lock<std::mutex> lockHolder{ m_Mutex };
unsigned lGeneration = m_Generation;
unsigned int lGeneration = m_Generation;
++m_NumberArrived;
if (m_NumberArrived == m_NumberExpected)
{
Expand Down
18 changes: 9 additions & 9 deletions Modules/Compatibility/Deprecated/test/itkAtomicIntTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int Total = 0;
itk::uint64_t Total64 = 0;
itk::AtomicInt<itk::uint32_t> TotalAtomic(0);
itk::AtomicInt<itk::uint64_t> TotalAtomic64(0);
constexpr unsigned Target = 1000000;
constexpr unsigned int Target = 1000000;
itk::int32_t Values32[Target + 2];
itk::int64_t Values64[Target + 2];
itk::AtomicInt<itk::int32_t *> AtomicPtr(Values32);
Expand All @@ -56,7 +56,7 @@ itk::Object::Pointer AnObject;
ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
MyFunction(void *)
{
for (unsigned i = 0; i < Target / NumThreads; ++i)
for (unsigned int i = 0; i < Target / NumThreads; ++i)
{
Total++;
int idx = ++TotalAtomic;
Expand All @@ -75,7 +75,7 @@ MyFunction(void *)
ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
MyFunction2(void *)
{
for (unsigned i = 0; i < Target / NumThreads; ++i)
for (unsigned int i = 0; i < Target / NumThreads; ++i)
{
--TotalAtomic;

Expand All @@ -88,7 +88,7 @@ MyFunction2(void *)
ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
MyFunction3(void *)
{
for (unsigned i = 0; i < Target / NumThreads; ++i)
for (unsigned int i = 0; i < Target / NumThreads; ++i)
{
int idx = TotalAtomic += 1;
Values32[idx]++;
Expand All @@ -103,7 +103,7 @@ MyFunction3(void *)
ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
MyFunction4(void *)
{
for (unsigned i = 0; i < Target / NumThreads; ++i)
for (unsigned int i = 0; i < Target / NumThreads; ++i)
{
TotalAtomic++;
TotalAtomic += 1;
Expand All @@ -122,7 +122,7 @@ MyFunction4(void *)
ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
MyFunctionPtr(void *)
{
for (unsigned i = 0; i < Target / NumThreads; ++i)
for (unsigned int i = 0; i < Target / NumThreads; ++i)
{
itk::int32_t * ptr32 = ++AtomicPtr;
(*ptr32) = 1;
Expand Down Expand Up @@ -223,7 +223,7 @@ itkAtomicIntTest(int, char *[])
Total64 = 0;
TotalAtomic64 = 0;

for (unsigned i = 0; i < Target; ++i)
for (unsigned int i = 0; i < Target; ++i)
{
Values32[i] = 0;
Values64[i] = 0;
Expand Down Expand Up @@ -259,7 +259,7 @@ itkAtomicIntTest(int, char *[])
std::cout << "Expecting Values64[0] to be 0. Got " << Values64[0] << std::endl;
return 1;
}
for (unsigned i = 1; i < Target; ++i)
for (unsigned int i = 1; i < Target; ++i)
{
if (Values32[i] != 2)
{
Expand Down Expand Up @@ -297,7 +297,7 @@ itkAtomicIntTest(int, char *[])
std::cout << "Expecting Values64[0] to be 0. Got " << Values64[0] << std::endl;
return 1;
}
for (unsigned i = 1; i < Target; ++i)
for (unsigned int i = 1; i < Target; ++i)
{
if (Values32[i] != 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ConditionVariableTestIncCount(void * ptr)

double v = 400.0;

for (unsigned i = 0; i < 10; ++i)
for (unsigned int i = 0; i < 10; ++i)
{
data->m_Mutex.Lock();
data->m_Counter++;
Expand All @@ -61,7 +61,7 @@ ConditionVariableTestIncCount(void * ptr)
data->m_Mutex.Unlock();

// Do some work here.
for (unsigned j = 0; j < 1000; ++j)
for (unsigned int j = 0; j < 1000; ++j)
{
v = v / 2.4;
v = v * 2.4;
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkBresenhamLine.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ BresenhamLine<VDimension>::BuildLine(LType Direction, IdentifierType length) ->
// we are going to start at 0
m_CurrentImageIndex.Fill(0);
constexpr IndexType StartIndex = { { 0 } };
for (unsigned i = 0; i < VDimension; ++i)
for (unsigned int i = 0; i < VDimension; ++i)
{
LastIndex[i] = (IndexValueType)(length * Direction[i]);
}
// Find the dominant direction
IndexValueType maxDistance = 0;
unsigned int maxDistanceDimension = 0;
for (unsigned i = 0; i < VDimension; ++i)
for (unsigned int i = 0; i < VDimension; ++i)
{
auto distance = static_cast<long>(itk::Math::abs(LastIndex[i]));
if (distance > maxDistance)
Expand Down
8 changes: 4 additions & 4 deletions Modules/Core/Common/include/itkConstNeighborhoodIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator
* center in the positive specified "axis" direction. No bounds checking
* is done on the size of the neighborhood. */
ITK_ITERATOR_VIRTUAL PixelType
GetNext(const unsigned axis, NeighborIndexType i) const ITK_ITERATOR_FINAL
GetNext(const unsigned int axis, NeighborIndexType i) const ITK_ITERATOR_FINAL
{
return (this->GetPixel(this->GetCenterNeighborhoodIndex() + (i * this->GetStride(axis))));
}
Expand All @@ -248,7 +248,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator
* center in the specified positive axis direction. No bounds checking is
* done on the size of the neighborhood. */
ITK_ITERATOR_VIRTUAL PixelType
GetNext(const unsigned axis) const ITK_ITERATOR_FINAL
GetNext(const unsigned int axis) const ITK_ITERATOR_FINAL
{
return (this->GetPixel(this->GetCenterNeighborhoodIndex() + this->GetStride(axis)));
}
Expand All @@ -257,7 +257,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator
* center in the negative specified "axis" direction. No bounds checking
* is done on the size of the neighborhood. */
ITK_ITERATOR_VIRTUAL PixelType
GetPrevious(const unsigned axis, NeighborIndexType i) const ITK_ITERATOR_FINAL
GetPrevious(const unsigned int axis, NeighborIndexType i) const ITK_ITERATOR_FINAL
{
return (this->GetPixel(this->GetCenterNeighborhoodIndex() - (i * this->GetStride(axis))));
}
Expand All @@ -266,7 +266,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator
* center in the specified negative axis direction. No bounds checking is
* done on the size of the neighborhood. */
ITK_ITERATOR_VIRTUAL PixelType
GetPrevious(const unsigned axis) const ITK_ITERATOR_FINAL
GetPrevious(const unsigned int axis) const ITK_ITERATOR_FINAL
{
return (this->GetPixel(this->GetCenterNeighborhoodIndex() - this->GetStride(axis)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ConstShapedNeighborhoodIterator<TImage, TBoundaryCondition>::ActivateIndex(Neigh

// Set the pointer in the neighborhood location just activated.
this->GetElement(n) = this->GetCenterPointer();
for (unsigned i = 0; i < Dimension; ++i)
for (unsigned int i = 0; i < Dimension; ++i)
{
this->GetElement(n) += OffsetTable[i] * this->GetOffset(n)[i];
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkDefaultConvertPixelTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class ITK_TEMPLATE_EXPORT DefaultConvertPixelTraits<Offset<VDimension>>
//

#define ITK_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE(type) \
template <typename TComponentType, unsigned VDimension> \
template <typename TComponentType, unsigned int VDimension> \
class ITK_TEMPLATE_EXPORT DefaultConvertPixelTraits<type<TComponentType, VDimension>> \
{ \
public: \
Expand Down Expand Up @@ -292,7 +292,7 @@ class ITK_TEMPLATE_EXPORT DefaultConvertPixelTraits<VariableSizeMatrix<VComponen
// Default traits for the pixel types deriving from Matrix<>
//

template <typename VComponent, unsigned VRows, unsigned VCols>
template <typename VComponent, unsigned int VRows, unsigned int VCols>
class ITK_TEMPLATE_EXPORT DefaultConvertPixelTraits<Matrix<VComponent, VRows, VCols>>
{
public:
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkImageAlgorithm.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ ImageAlgorithm::EnlargeRegionOverBox(const typename InputImageType::RegionType &
// else if InputDimension == OutputDimension copy the points.
// else if InputDimension > OutputDimension project the point to first N-Dimensions of Output space.
outputPoint.Fill(0.0);
for (unsigned d = 0; d < std::min(inputPoint.GetPointDimension(), outputPoint.GetPointDimension()); ++d)
for (unsigned int d = 0; d < std::min(inputPoint.GetPointDimension(), outputPoint.GetPointDimension()); ++d)
{
outputPoint[d] = inputPoint[d];
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkImageNeighborhoodOffsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GenerateImageNeighborhoodOffsets(const TImageNeighborhoodShape & shape)


/** Generates the offsets for a hyperrectangular (box shaped) neighborhood. */
template <unsigned VImageDimension>
template <unsigned int VImageDimension>
std::vector<Offset<VImageDimension>>
GenerateRectangularImageNeighborhoodOffsets(const Size<VImageDimension> & radius)
{
Expand Down
22 changes: 11 additions & 11 deletions Modules/Core/Common/include/itkIndexRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace itk
*
* The following example prints all indices of an 2-D grid space of size 2x3.
\code
constexpr unsigned Dimension = 2;
constexpr unsigned int Dimension = 2;
const Size<Dimension> size = { {2, 3} };
const ZeroBasedIndexRange<Dimension> indexRange{ size };
Expand Down Expand Up @@ -74,11 +74,11 @@ namespace itk
* \ingroup ImageIterators
* \ingroup ITKCommon
*/
template <unsigned VDimension, bool VBeginAtZero>
template <unsigned int VDimension, bool VBeginAtZero>
class IndexRange final
{
public:
static constexpr unsigned Dimension = VDimension;
static constexpr unsigned int Dimension = VDimension;
using SizeType = Size<VDimension>;
using IndexType = Index<VDimension>;

Expand Down Expand Up @@ -112,7 +112,7 @@ class IndexRange final
const_iterator &
operator++() noexcept
{
for (unsigned i = 0; i < (VDimension - 1); ++i)
for (unsigned int i = 0; i < (VDimension - 1); ++i)
{
auto & indexValue = m_Index[i];

Expand Down Expand Up @@ -145,7 +145,7 @@ class IndexRange final
const_iterator &
operator--() noexcept
{
for (unsigned i = 0; i < (VDimension - 1); ++i)
for (unsigned int i = 0; i < (VDimension - 1); ++i)
{
auto & indexValue = m_Index[i];

Expand Down Expand Up @@ -198,7 +198,7 @@ class IndexRange final
friend bool
operator<(const const_iterator & lhs, const const_iterator & rhs) noexcept
{
for (unsigned i = VDimension; i > 0; --i)
for (unsigned int i = VDimension; i > 0; --i)
{
const auto difference = lhs.m_Index[i - 1] - rhs.m_Index[i - 1];

Expand Down Expand Up @@ -250,7 +250,7 @@ class IndexRange final
struct ZeroIndex
{
// The "index" operator.
constexpr IndexValueType operator[](unsigned) const { return 0; }
constexpr IndexValueType operator[](unsigned int) const { return 0; }

// Implicitly converts to a default-initialized itk::Index<N>.
constexpr operator IndexType() const { return IndexType(); }
Expand Down Expand Up @@ -391,7 +391,7 @@ class IndexRange final
{
std::size_t result = 1;

for (unsigned i = 0; i < VDimension; ++i)
for (unsigned int i = 0; i < VDimension; ++i)
{
result *= ((m_MaxIndex[i] + 1) - m_MinIndex[i]);
}
Expand Down Expand Up @@ -433,7 +433,7 @@ class IndexRange final

IndexType index;

for (unsigned i = 0; i < VDimension; ++i)
for (unsigned int i = 0; i < VDimension; ++i)
{
index[i] = minIndex[i] + static_cast<IndexValueType>(normalizedSize[i]) - 1;
}
Expand All @@ -450,10 +450,10 @@ class IndexRange final
IndexType m_MaxIndex = IndexType::Filled(-1);
};

template <unsigned VDimension>
template <unsigned int VDimension>
using ImageRegionIndexRange = IndexRange<VDimension, false>;

template <unsigned VDimension>
template <unsigned int VDimension>
using ZeroBasedIndexRange = IndexRange<VDimension, true>;

} // namespace itk
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkLaplacianOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ITK_TEMPLATE_EXPORT LaplacianOperator : public NeighborhoodOperator<TPixel

LaplacianOperator()
{
for (unsigned i = 0; i < VDimension; ++i)
for (unsigned int i = 0; i < VDimension; ++i)
{
m_DerivativeScalings[i] = 1.0;
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkNeighborhood.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Neighborhood<TPixel, VDimension, TContainer>::GetNeighborhoodIndex(const OffsetT
{
unsigned int idx = (this->Size() / 2);

for (unsigned i = 0; i < VDimension; ++i)
for (unsigned int i = 0; i < VDimension; ++i)
{
idx += o[i] * m_StrideTable[i];
}
Expand Down
9 changes: 6 additions & 3 deletions Modules/Core/Common/include/itkNeighborhoodInnerProduct.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ class ITK_TEMPLATE_EXPORT NeighborhoodInnerProduct
static OutputPixelType
Compute(const ConstNeighborhoodIterator<TImage> & it,
const OperatorType & op,
const unsigned start = 0,
const unsigned stride = 1);
const unsigned int start = 0,
const unsigned int stride = 1);

static OutputPixelType
Compute(const NeighborhoodType & N, const OperatorType & op, const unsigned start = 0, const unsigned stride = 1);
Compute(const NeighborhoodType & N,
const OperatorType & op,
const unsigned int start = 0,
const unsigned int stride = 1);

/** Reference oeprator. */
OutputPixelType
Expand Down
8 changes: 4 additions & 4 deletions Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ template <typename TImage, typename TOperator, typename TComputation>
typename NeighborhoodInnerProduct<TImage, TOperator, TComputation>::OutputPixelType
NeighborhoodInnerProduct<TImage, TOperator, TComputation>::Compute(const ConstNeighborhoodIterator<TImage> & it,
const OperatorType & op,
const unsigned start,
const unsigned stride)
const unsigned int start,
const unsigned int stride)
{
typename OperatorType::ConstIterator o_it;

Expand Down Expand Up @@ -57,8 +57,8 @@ NeighborhoodInnerProduct<TImage, TOperator, TComputation>::Compute(
/* const ImageBoundaryCondition<TImage> *,*/
const NeighborhoodType & N,
const OperatorType & op,
const unsigned start,
const unsigned stride)
const unsigned int start,
const unsigned int stride)
{
typename OperatorType::ConstIterator o_it;

Expand Down
Loading

0 comments on commit a812aa3

Please sign in to comment.