Skip to content

Commit

Permalink
STYLE: Remove initial << from itkGenericExceptionMacro(<< " calls
Browse files Browse the repository at this point in the history
Follow-up to pull request #4057
commit 89beb04
"STYLE: Remove initial `<<` insertion from `itkExceptionMacro(<< "` calls"
  • Loading branch information
N-Dekker authored and dzenanz committed Jun 2, 2023
1 parent 366ed3e commit 1d0d43c
Show file tree
Hide file tree
Showing 78 changed files with 238 additions and 239 deletions.
Expand Up @@ -79,7 +79,7 @@ PostOrderTreeIterator<TTreeType>::PostOrderTreeIterator(TTreeType * tree)
const auto * root = dynamic_cast<const TreeNodeType *>(tree->GetRoot());
if (root == nullptr)
{
itkGenericExceptionMacro(<< "Can't downcast root node to TreeNodeType *");
itkGenericExceptionMacro("Can't downcast root node to TreeNodeType *");
}
this->m_Position = const_cast<TreeNodeType *>(root);
this->m_Position = const_cast<TreeNodeType *>(FindMostRightLeaf(this->m_Position));
Expand Down Expand Up @@ -138,7 +138,7 @@ PostOrderTreeIterator<TTreeType>::FindNextNode() const
auto * rval = dynamic_cast<TreeNodeType *>(this->m_Position->GetParent());
if (rval == nullptr)
{
itkGenericExceptionMacro(<< "Can't downcast to TreeNodeType *");
itkGenericExceptionMacro("Can't downcast to TreeNodeType *");
}
return rval;
}
Expand All @@ -156,7 +156,7 @@ PostOrderTreeIterator<TTreeType>::FindSister(TreeNodeType * node) const
auto * parent = dynamic_cast<TreeNodeType *>(node->GetParent());
if (parent == nullptr)
{
itkGenericExceptionMacro(<< "Can't downcast to TreeNodeType *");
itkGenericExceptionMacro("Can't downcast to TreeNodeType *");
}

int childPosition = parent->ChildPosition(node);
Expand All @@ -173,7 +173,7 @@ PostOrderTreeIterator<TTreeType>::FindSister(TreeNodeType * node) const
auto * sister = dynamic_cast<TreeNodeType *>(parent->GetChild(childPosition + 1));
if (sister == nullptr)
{
itkGenericExceptionMacro(<< "Can't downcast to TreeNodeType *");
itkGenericExceptionMacro("Can't downcast to TreeNodeType *");
}
return sister;
}
Expand Down Expand Up @@ -203,7 +203,7 @@ PostOrderTreeIterator<TTreeType>::FindMostRightLeaf(TreeNodeType * node) const
helpNode = dynamic_cast<TreeNodeType *>(node->GetChild(i));
if (helpNode == nullptr)
{
itkGenericExceptionMacro(<< "Can't downcast to TreeNodeType *");
itkGenericExceptionMacro("Can't downcast to TreeNodeType *");
}
}
++i;
Expand Down
12 changes: 6 additions & 6 deletions Modules/Core/Common/include/itkByteSwapper.hxx
Expand Up @@ -92,7 +92,7 @@ ByteSwapper<T>::SwapFromSystemToBigEndian(T * p)
Self::Swap8(p);
return;
default:
itkGenericExceptionMacro(<< "Cannot swap number of bytes requested");
itkGenericExceptionMacro("Cannot swap number of bytes requested");
}
}

Expand Down Expand Up @@ -129,7 +129,7 @@ ByteSwapper<T>::SwapRangeFromSystemToBigEndian(T * p, BufferSizeType num)
Self::Swap8Range(p, num);
return;
default:
itkGenericExceptionMacro(<< "Cannot swap number of bytes requested");
itkGenericExceptionMacro("Cannot swap number of bytes requested");
}
}

Expand Down Expand Up @@ -163,7 +163,7 @@ ByteSwapper<T>::SwapWriteRangeFromSystemToBigEndian(const T * p, int num, OStrea
Self::SwapWrite8Range(p, num, fp);
return;
default:
itkGenericExceptionMacro(<< "Cannot swap number of bytes requested");
itkGenericExceptionMacro("Cannot swap number of bytes requested");
}
}

Expand All @@ -190,7 +190,7 @@ ByteSwapper<T>::SwapFromSystemToLittleEndian(T * p)
Self::Swap8(p);
return;
default:
itkGenericExceptionMacro(<< "Cannot swap number of bytes requested");
itkGenericExceptionMacro("Cannot swap number of bytes requested");
}
}

Expand Down Expand Up @@ -220,7 +220,7 @@ ByteSwapper<T>::SwapRangeFromSystemToLittleEndian(T * p, BufferSizeType num)
Self::Swap8Range(p, num);
return;
default:
itkGenericExceptionMacro(<< "Cannot swap number of bytes requested");
itkGenericExceptionMacro("Cannot swap number of bytes requested");
}
}

Expand Down Expand Up @@ -250,7 +250,7 @@ ByteSwapper<T>::SwapWriteRangeFromSystemToLittleEndian(const T * p, int num, OSt
Self::SwapWrite8Range(p, num, fp);
return;
default:
itkGenericExceptionMacro(<< "Cannot swap number of bytes requested");
itkGenericExceptionMacro("Cannot swap number of bytes requested");
}
}

Expand Down
Expand Up @@ -119,8 +119,9 @@ ConstShapedNeighborhoodIterator<TImage, TBoundaryCondition>::CreateActiveListFro
{
if (this->GetRadius() != neighborhood.GetRadius())
{
itkGenericExceptionMacro(<< "Radius of shaped iterator(" << this->GetRadius()
<< ") does not equal radius of neighborhood(" << neighborhood.GetRadius() << ')');
itkGenericExceptionMacro("Radius of shaped iterator(" << this->GetRadius()
<< ") does not equal radius of neighborhood("
<< neighborhood.GetRadius() << ')');
}
typename NeighborhoodType::ConstIterator nit;
NeighborIndexType idx = 0;
Expand Down
Expand Up @@ -195,8 +195,8 @@ class ITK_TEMPLATE_EXPORT ImageLinearConstIteratorWithIndex : public ImageConstI
{
if (direction >= TImage::ImageDimension)
{
itkGenericExceptionMacro(<< "In image of dimension " << TImage::ImageDimension << " Direction " << direction
<< " was selected");
itkGenericExceptionMacro("In image of dimension " << TImage::ImageDimension << " Direction " << direction
<< " was selected");
}
m_Direction = direction;
m_Jump = this->m_OffsetTable[m_Direction];
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkImageRegion.hxx
Expand Up @@ -249,8 +249,8 @@ ImageRegion<VImageDimension>::Slice(const unsigned int dim) const -> SliceRegion
{
if (dim >= VImageDimension)
{
itkGenericExceptionMacro(<< "The dimension to remove: " << dim
<< " is greater than the dimension of the image: " << VImageDimension);
itkGenericExceptionMacro(
"The dimension to remove: " << dim << " is greater than the dimension of the image: " << VImageDimension);
}

Index<SliceDimension> sliceIndex;
Expand Down
Expand Up @@ -184,8 +184,8 @@ ImageSliceConstIteratorWithIndex<TImage>::SetFirstDirection(unsigned int directi
{
if (direction >= TImage::ImageDimension)
{
itkGenericExceptionMacro(<< "In image of dimension " << TImage::ImageDimension << " Direction " << direction
<< " sas selected");
itkGenericExceptionMacro("In image of dimension " << TImage::ImageDimension << " Direction " << direction
<< " sas selected");
}
m_Direction_A = direction;
m_PixelJump = this->m_OffsetTable[m_Direction_A];
Expand All @@ -200,8 +200,8 @@ ImageSliceConstIteratorWithIndex<TImage>::SetSecondDirection(unsigned int direct
{
if (direction >= TImage::ImageDimension)
{
itkGenericExceptionMacro(<< "In image of dimension " << TImage::ImageDimension << " Direction " << direction
<< " sas selected");
itkGenericExceptionMacro("In image of dimension " << TImage::ImageDimension << " Direction " << direction
<< " sas selected");
}
m_Direction_B = direction;
m_LineJump = this->m_OffsetTable[m_Direction_B];
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkMacro.h
Expand Up @@ -1374,8 +1374,8 @@ itkDynamicCastInDebugMode(TSource x)
TTarget rval = dynamic_cast<TTarget>(x);
if (rval == nullptr)
{
itkGenericExceptionMacro(<< "Failed dynamic cast to " << typeid(TTarget).name()
<< " object type = " << x->GetNameOfClass());
itkGenericExceptionMacro("Failed dynamic cast to " << typeid(TTarget).name()
<< " object type = " << x->GetNameOfClass());
}
return rval;
#else
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkMatrix.h
Expand Up @@ -278,7 +278,7 @@ class ITK_TEMPLATE_EXPORT Matrix
{
if (vnl_determinant(m_Matrix) == NumericTraits<T>::ZeroValue())
{
itkGenericExceptionMacro(<< "Singular matrix. Determinant is 0.");
itkGenericExceptionMacro("Singular matrix. Determinant is 0.");
}
vnl_matrix_inverse<T> inverse(m_Matrix.as_ref());
return vnl_matrix_fixed<T, VColumns, VRows>{ inverse.as_matrix() };
Expand Down
34 changes: 17 additions & 17 deletions Modules/Core/Common/include/itkNumericTraits.h
Expand Up @@ -187,7 +187,7 @@ class NumericTraits : public std::numeric_limits<T>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -366,7 +366,7 @@ class NumericTraits<bool> : public std::numeric_limits<bool>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -472,7 +472,7 @@ class NumericTraits<char> : public std::numeric_limits<char>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -594,7 +594,7 @@ class NumericTraits<signed char> : public std::numeric_limits<signed char>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -698,7 +698,7 @@ class NumericTraits<unsigned char> : public std::numeric_limits<unsigned char>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -800,7 +800,7 @@ class NumericTraits<short> : public std::numeric_limits<short>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -903,7 +903,7 @@ class NumericTraits<unsigned short> : public std::numeric_limits<unsigned short>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1005,7 +1005,7 @@ class NumericTraits<int> : public std::numeric_limits<int>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1127,7 +1127,7 @@ class NumericTraits<unsigned int> : public std::numeric_limits<unsigned int>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1230,7 +1230,7 @@ class NumericTraits<long> : public std::numeric_limits<long>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1333,7 +1333,7 @@ class NumericTraits<unsigned long> : public std::numeric_limits<unsigned long>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1437,7 +1437,7 @@ class NumericTraits<float> : public std::numeric_limits<float>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1540,7 +1540,7 @@ class NumericTraits<double> : public std::numeric_limits<double>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1651,7 +1651,7 @@ class NumericTraits<long double> : public std::numeric_limits<long double>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1755,7 +1755,7 @@ class NumericTraits<long long> : public std::numeric_limits<long long>
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1850,7 +1850,7 @@ class NumericTraits<unsigned long long> : public std::numeric_limits<unsigned lo
{
if (s != 1)
{
itkGenericExceptionMacro(<< "Cannot set the size of a scalar to " << s);
itkGenericExceptionMacro("Cannot set the size of a scalar to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down Expand Up @@ -1976,7 +1976,7 @@ class NumericTraits<std::complex<TComponent>>
{
if (s != 2)
{
itkGenericExceptionMacro(<< "Cannot set the size of a complex to " << s);
itkGenericExceptionMacro("Cannot set the size of a complex to " << s);
}
m = NumericTraits<ValueType>::ZeroValue();
}
Expand Down
Expand Up @@ -155,7 +155,7 @@ class NumericTraits<CovariantVector<T, D>>
{
if (s != D)
{
itkGenericExceptionMacro(<< "Cannot set the size of a CovariantVector of length " << D << " to " << s);
itkGenericExceptionMacro("Cannot set the size of a CovariantVector of length " << D << " to " << s);
}
m.Fill(NumericTraits<T>::ZeroValue());
}
Expand Down
Expand Up @@ -157,8 +157,8 @@ class NumericTraits<DiffusionTensor3D<T>>
{
if (s != 6)
{
itkGenericExceptionMacro(<< "Cannot set the size of a DiffusionTensor3D "
"to anything other than 6.");
itkGenericExceptionMacro("Cannot set the size of a DiffusionTensor3D "
"to anything other than 6.");
}
m.Fill(NumericTraits<T>::ZeroValue());
}
Expand Down
Expand Up @@ -151,7 +151,7 @@ class NumericTraits<FixedArray<T, D>>
{
if (s != D)
{
itkGenericExceptionMacro(<< "Cannot set the size of a FixedArray of length " << D << " to " << s);
itkGenericExceptionMacro("Cannot set the size of a FixedArray of length " << D << " to " << s);
}
m.Fill(NumericTraits<T>::ZeroValue());
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkNumericTraitsPointPixel.h
Expand Up @@ -142,7 +142,7 @@ class NumericTraits<Point<T, D>>
{
if (s != D)
{
itkGenericExceptionMacro(<< "Cannot set the size of a Point of length " << D << " to " << s);
itkGenericExceptionMacro("Cannot set the size of a Point of length " << D << " to " << s);
}
m.Fill(NumericTraits<T>::ZeroValue());
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkNumericTraitsRGBAPixel.h
Expand Up @@ -182,8 +182,8 @@ class NumericTraits<RGBAPixel<T>>
{
if (s != 4)
{
itkGenericExceptionMacro(<< "Cannot set the size of a RGBAPixel to anything other "
"than 4.");
itkGenericExceptionMacro("Cannot set the size of a RGBAPixel to anything other "
"than 4.");
}
m.Fill(NumericTraits<T>::ZeroValue());
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkNumericTraitsRGBPixel.h
Expand Up @@ -182,8 +182,8 @@ class NumericTraits<RGBPixel<T>>
{
if (s != 3)
{
itkGenericExceptionMacro(<< "Cannot set the size of a RGBPixel to anything other "
"than 3.");
itkGenericExceptionMacro("Cannot set the size of a RGBPixel to anything other "
"than 3.");
}
m.Fill(NumericTraits<T>::ZeroValue());
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkNumericTraitsTensorPixel.h
Expand Up @@ -156,8 +156,8 @@ class NumericTraits<SymmetricSecondRankTensor<T, D>>
{
if (s != D * (D + 1) / 2)
{
itkGenericExceptionMacro(<< "Cannot set the size of a SymmetricSecondRankTensor "
"of dimension "
itkGenericExceptionMacro("Cannot set the size of a SymmetricSecondRankTensor "
"of dimension "
<< D << " ( = size of " << D * (D + 1) / 2 << ") to " << s);
}
m.Fill(NumericTraits<T>::ZeroValue());
Expand Down

0 comments on commit 1d0d43c

Please sign in to comment.