Skip to content

Commit

Permalink
STYLE: Ran clang-format 18.1.5 through pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed May 9, 2024
1 parent 271392b commit c9b418e
Show file tree
Hide file tree
Showing 381 changed files with 2,524 additions and 2,529 deletions.
12 changes: 4 additions & 8 deletions Examples/DataRepresentation/Mesh/MeshCellsIteration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -272,32 +272,28 @@ main(int, char *[])
CellType * cell = cellIterator.Value();
switch (cell->GetType())
{
case itk::CellGeometryEnum::VERTEX_CELL:
{
case itk::CellGeometryEnum::VERTEX_CELL: {
std::cout << "VertexCell : " << std::endl;
auto * line = dynamic_cast<VertexType *>(cell);
std::cout << "dimension = " << line->GetDimension() << std::endl;
std::cout << "# points = " << line->GetNumberOfPoints() << std::endl;
break;
}
case itk::CellGeometryEnum::LINE_CELL:
{
case itk::CellGeometryEnum::LINE_CELL: {
std::cout << "LineCell : " << std::endl;
auto * line = dynamic_cast<LineType *>(cell);
std::cout << "dimension = " << line->GetDimension() << std::endl;
std::cout << "# points = " << line->GetNumberOfPoints() << std::endl;
break;
}
case itk::CellGeometryEnum::TRIANGLE_CELL:
{
case itk::CellGeometryEnum::TRIANGLE_CELL: {
std::cout << "TriangleCell : " << std::endl;
auto * line = dynamic_cast<TriangleType *>(cell);
std::cout << "dimension = " << line->GetDimension() << std::endl;
std::cout << "# points = " << line->GetNumberOfPoints() << std::endl;
break;
}
default:
{
default: {
std::cout << "Cell with more than three points" << std::endl;
std::cout << "dimension = " << cell->GetDimension() << std::endl;
std::cout << "# points = " << cell->GetNumberOfPoints() << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Filtering/DigitallyReconstructedRadiograph1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include "itkRayCastInterpolateImageFunction.h"
// Software Guide : EndCodeSnippet

//#define WRITE_CUBE_IMAGE_TO_FILE
// #define WRITE_CUBE_IMAGE_TO_FILE


void
Expand Down
6 changes: 3 additions & 3 deletions Examples/Filtering/FFTDirectInverse2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
#include "itkFlipImageFilter.h"

#if !defined(ITK_USE_FFTWF)
//#error "This example only works when single precision FFTW is used
// Changing WorkPixeltype to double and changing this conditional to
// ITK_USE_FFTWD will also work.
// #error "This example only works when single precision FFTW is used
// Changing WorkPixeltype to double and changing this conditional to
// ITK_USE_FFTWD will also work.
#endif

int
Expand Down
2 changes: 1 addition & 1 deletion Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ ParticleSwarmOptimizerSAXReader::ProcessBoundAttributes(
}
}
} // end if
} // end for
} // end for
}

/** Search for and return a particular attribute from the attribute list. */
Expand Down
5 changes: 3 additions & 2 deletions Modules/Bridge/NumPy/include/itkPyBuffer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ PyBuffer<TImage>::_GetArrayViewFromImage(ImageType * image)

template <class TImage>
auto
PyBuffer<TImage>::_GetImageViewFromArray(PyObject * arr, PyObject * shape, PyObject * numOfComponent)
-> const OutputImagePointer
PyBuffer<TImage>::_GetImageViewFromArray(PyObject * arr,
PyObject * shape,
PyObject * numOfComponent) -> const OutputImagePointer
{
PyObject * shapeseq = NULL;
PyObject * item = NULL;
Expand Down
30 changes: 15 additions & 15 deletions Modules/Bridge/VtkGlue/src/QuickView.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,27 @@ using FloatImageType = itk::Image<float, 2>;
using DoubleImageType = itk::Image<double, 2>;

template void ITKVtkGlue_EXPORT
QuickView::AddImage<CharImageType>(CharImageType * image, bool FlipVertical, std::string Description);
QuickView::AddImage<CharImageType>(CharImageType * image, bool FlipVertical, std::string Description);
template void ITKVtkGlue_EXPORT
QuickView::AddImage<UnsignedShortImageType>(UnsignedShortImageType * image, bool FlipVertical, std::string Description);
QuickView::AddImage<UnsignedShortImageType>(UnsignedShortImageType * image, bool FlipVertical, std::string Description);
template void ITKVtkGlue_EXPORT
QuickView::AddImage<ShortImageType>(ShortImageType * image, bool FlipVertical, std::string Description);
QuickView::AddImage<ShortImageType>(ShortImageType * image, bool FlipVertical, std::string Description);
template void ITKVtkGlue_EXPORT
QuickView::AddImage<UnsignedIntImageType>(UnsignedIntImageType * image, bool FlipVertical, std::string Description);
QuickView::AddImage<UnsignedIntImageType>(UnsignedIntImageType * image, bool FlipVertical, std::string Description);
template void ITKVtkGlue_EXPORT
QuickView::AddImage<IntImageType>(IntImageType * image, bool FlipVertical, std::string Description);
QuickView::AddImage<IntImageType>(IntImageType * image, bool FlipVertical, std::string Description);
template void ITKVtkGlue_EXPORT
QuickView::AddImage<UnsignedLongImageType>(UnsignedLongImageType * image, bool FlipVertical, std::string Description);
QuickView::AddImage<UnsignedLongImageType>(UnsignedLongImageType * image, bool FlipVertical, std::string Description);
template void ITKVtkGlue_EXPORT
QuickView::AddImage<LongImageType>(LongImageType * image, bool FlipVertical, std::string Description);
QuickView::AddImage<LongImageType>(LongImageType * image, bool FlipVertical, std::string Description);
template void ITKVtkGlue_EXPORT
QuickView::AddImage<FloatImageType>(FloatImageType * image, bool FlipVertical, std::string Description);
QuickView::AddImage<FloatImageType>(FloatImageType * image, bool FlipVertical, std::string Description);
template void ITKVtkGlue_EXPORT
QuickView::AddImage<DoubleImageType>(DoubleImageType * image, bool FlipVertical, std::string Description);
QuickView::AddImage<DoubleImageType>(DoubleImageType * image, bool FlipVertical, std::string Description);

template <>
void ITKVtkGlue_EXPORT
QuickView::AddImage<UnsignedCharImageType>(UnsignedCharImageType * image, bool FlipVertical, std::string Description)
QuickView::AddImage<UnsignedCharImageType>(UnsignedCharImageType * image, bool FlipVertical, std::string Description)
{
if (FlipVertical)
{
Expand All @@ -101,7 +101,7 @@ void ITKVtkGlue_EXPORT

template <typename TImage>
void ITK_TEMPLATE_EXPORT
QuickView::AddImage(TImage * image, bool FlipVertical, std::string Description)
QuickView::AddImage(TImage * image, bool FlipVertical, std::string Description)
{
using rescaleFilterType = itk::RescaleIntensityImageFilter<TImage, UnsignedCharImageType>;

Expand All @@ -116,7 +116,7 @@ void ITK_TEMPLATE_EXPORT

template <>
void ITKVtkGlue_EXPORT
QuickView::AddImage<UnsignedCharRGBImageType>(UnsignedCharRGBImageType * image,
QuickView::AddImage<UnsignedCharRGBImageType>(UnsignedCharRGBImageType * image,
bool FlipVertical,
std::string Description)
{
Expand All @@ -141,7 +141,7 @@ void ITKVtkGlue_EXPORT

template <>
void ITKVtkGlue_EXPORT
QuickView::AddRGBImage<UnsignedCharRGBImageType>(UnsignedCharRGBImageType * image,
QuickView::AddRGBImage<UnsignedCharRGBImageType>(UnsignedCharRGBImageType * image,
bool FlipVertical,
std::string Description)
{
Expand All @@ -166,7 +166,7 @@ void ITKVtkGlue_EXPORT

template <>
void ITKVtkGlue_EXPORT
QuickView::AddRGBImage<FloatRGBImageType>(FloatRGBImageType * image, bool FlipVertical, std::string Description)
QuickView::AddRGBImage<FloatRGBImageType>(FloatRGBImageType * image, bool FlipVertical, std::string Description)
{
using AdaptorType = itk::RGBToVectorImageAdaptor<FloatRGBImageType>;
AdaptorType::Pointer adaptor = AdaptorType::New();
Expand All @@ -182,7 +182,7 @@ void ITKVtkGlue_EXPORT

template <>
void ITKVtkGlue_EXPORT
QuickView::AddImage<FloatRGBImageType>(FloatRGBImageType * image, bool FlipVertical, std::string Description)
QuickView::AddImage<FloatRGBImageType>(FloatRGBImageType * image, bool FlipVertical, std::string Description)
{
using AdaptorType = itk::RGBToVectorImageAdaptor<FloatRGBImageType>;
AdaptorType::Pointer adaptor = AdaptorType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ITK_TEMPLATE_EXPORT ChildTreeIterator : public TreeIteratorBase<TTreeType>
if (this != &iterator)
{
Superclass::operator=(iterator);
auto & it = static_cast<ChildTreeIterator<TTreeType> &>(iterator);
auto & it = static_cast<ChildTreeIterator<TTreeType> &>(iterator);
m_ListPosition = it.m_ListPosition;
m_ParentNode = it.m_ParentNode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TreeIteratorBaseEnums
};
// Define how to print enumeration
extern ITKCOMMON_DEPRECATED_EXPORT std::ostream &
operator<<(std::ostream & out, const TreeIteratorBaseEnums::TreeIteratorBaseNode value);
operator<<(std::ostream & out, const TreeIteratorBaseEnums::TreeIteratorBaseNode value);
/** \class TreeIteratorBase
* \brief This class provides the base implementation for tree iterators.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ class TreeIteratorClone
}

/** Overload operator -> */
ObjectType * operator->() const { return m_Pointer; }
ObjectType *
operator->() const
{
return m_Pointer;
}

/** Test if the pointer has been initialized */
bool
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ operator<<(std::ostream & os, const Array<TValue> & arr)

// declaration of specialization
template <>
ITKCommon_EXPORT std::ostream & operator<<<double>(std::ostream & os, const Array<double> & arr);
ITKCommon_EXPORT std::ostream & operator<< <double>(std::ostream & os, const Array<double> & arr);
template <>
ITKCommon_EXPORT std::ostream & operator<<<float>(std::ostream & os, const Array<float> & arr);
ITKCommon_EXPORT std::ostream & operator<< <float>(std::ostream & os, const Array<float> & arr);


template <typename T>
Expand Down
6 changes: 5 additions & 1 deletion Modules/Core/Common/include/itkAutoPointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ class AutoPointer
~AutoPointer() { this->Reset(); }

/** Overload operator ->. */
ObjectType * operator->() const { return m_Pointer; }
ObjectType *
operator->() const
{
return m_Pointer;
}

/** Clear the AutoPointer. If it had a pointer the object
is deleted and the pointer is set to null. */
Expand Down
6 changes: 5 additions & 1 deletion Modules/Core/Common/include/itkBoolean.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ class Boolean
{}

/** Supports implicit conversion to `bool`. */
constexpr operator bool() const { return m_Value; }
constexpr
operator bool() const
{
return m_Value;
}

private:
bool m_Value = false;
Expand Down
22 changes: 15 additions & 7 deletions Modules/Core/Common/include/itkCellInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
// to define the Accept and GetTopologyId virtuals used
// by the MultiVisitor class
#define itkCellVisitMacro(TopologyId) \
static constexpr CellGeometryEnum GetTopologyId() { return TopologyId; } \
static constexpr CellGeometryEnum GetTopologyId() \
{ \
return TopologyId; \
} \
virtual void Accept(CellIdentifier cellid, typename CellInterface<PixelType, CellTraits>::MultiVisitor * mv) \
override \
{ \
Expand Down Expand Up @@ -381,7 +384,11 @@ class ITK_TEMPLATE_EXPORT CellInterface
* Array is ordered (xmin, xmax, ymin, ymax, ....). A pointer to the
* array is returned for convenience. This allows code like:
* "CoordRep* bounds = cell->GetBoundingBox(new CoordRep[6]);". */
CoordRepType * GetBoundingBox(CoordRepType[PointDimension * 2]) { return nullptr; }
CoordRepType *
GetBoundingBox(CoordRepType[PointDimension * 2])
{
return nullptr;
}

/** Compute the square of the diagonal length of the bounding box. */
CoordRepType
Expand All @@ -402,11 +409,12 @@ class ITK_TEMPLATE_EXPORT CellInterface
* (returned through "t" pointer).
*
* Returns whether an intersection exists. */
virtual bool IntersectBoundingBoxWithLine(CoordRepType[PointDimension * 2],
CoordRepType[PointDimension],
CoordRepType[PointDimension],
CoordRepType[PointDimension],
CoordRepType *)
virtual bool
IntersectBoundingBoxWithLine(CoordRepType[PointDimension * 2],
CoordRepType[PointDimension],
CoordRepType[PointDimension],
CoordRepType[PointDimension],
CoordRepType *)
{
return bool();
}
Expand Down
12 changes: 4 additions & 8 deletions Modules/Core/Common/include/itkColorTable.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -302,20 +302,16 @@ ColorTable<TComponent>::GetColorComponent(unsigned int c, char rgb)
{
switch (rgb)
{
case 'r':
{
case 'r': {
return m_Color[c][0];
}
case 'g':
{
case 'g': {
return m_Color[c][1];
}
case 'b':
{
case 'b': {
return m_Color[c][2];
}
default:
{
default: {
return 0;
}
}
Expand Down
7 changes: 4 additions & 3 deletions Modules/Core/Common/include/itkCompensatedSummation.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ class ITK_TEMPLATE_EXPORT CompensatedSummation
GetSum() const;

/** explicit conversion */
explicit operator FloatType() const;
explicit
operator FloatType() const;

private:
AccumulateType m_Sum{};
Expand All @@ -130,9 +131,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

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkCompensatedSummation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 12 additions & 4 deletions Modules/Core/Common/include/itkConceptChecking.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@
* project by Brad King at Kitware.
*/
# define itkConceptConstraintsMacro() \
virtual void Enforcer() { &Constraints::constraints; }
virtual void Enforcer() \
{ \
&Constraints::constraints; \
}
# define itkConceptMacro(name, concept) \
enum \
{ \
Expand Down Expand Up @@ -140,7 +143,8 @@ struct UniqueType_bool
* warning. (BOOST)
*/
template <typename T>
inline void IgnoreUnusedVariable(T)
inline void
IgnoreUnusedVariable(T)
{}

/**
Expand Down Expand Up @@ -806,7 +810,9 @@ struct SameDimensionOrMinusOne
using Type1 = Detail::UniqueType_unsigned_int<D1>;
using Type2 = Detail::UniqueType_unsigned_int<D1 - 1>;

void f(Type1) {}
void
f(Type1)
{}
void
f(Type2, int = 0)
{}
Expand All @@ -831,7 +837,9 @@ struct SameDimensionOrMinusOneOrTwo
using Type2 = Detail::UniqueType_unsigned_int<D1 - 1>;
using Type3 = Detail::UniqueType_unsigned_int<D1 - 2>;

void f(Type1) {}
void
f(Type1)
{}
void
f(Type2, int = 0)
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ class ConnectedImageNeighborhoodShape
static constexpr uintmax_t
CalculateBinomialCoefficient(const uintmax_t n, const uintmax_t k) noexcept
{
return (k > n) ? (assert(!"Out of range!"), 0)
: (k == 0) ? 1 : Math::UnsignedProduct(n, CalculateBinomialCoefficient(n - 1, k - 1)) / k;
return (k > n) ? (assert(!"Out of range!"), 0)
: (k == 0) ? 1
: Math::UnsignedProduct(n, CalculateBinomialCoefficient(n - 1, k - 1)) / k;
}


Expand Down
Loading

0 comments on commit c9b418e

Please sign in to comment.