Skip to content

Commit

Permalink
STYLE: Add in-class {} member initializers having trailing comments
Browse files Browse the repository at this point in the history
Previous commits that added `{}` initializers to data members by means of
regular expressions had overlooked member declarations that had a trailing
comment.

Follow-up to pull request InsightSoftwareConsortium#3851
commit 5e2c49f
"STYLE: Add in-class `{}` member initializers to objects created by New()"
  • Loading branch information
N-Dekker committed Mar 4, 2023
1 parent 05d3490 commit df57675
Show file tree
Hide file tree
Showing 60 changed files with 187 additions and 187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class ITK_TEMPLATE_EXPORT TreeIteratorBase
TreeIteratorBase(TTreeType * tree, const TreeNodeType * start);
TreeIteratorBase(const TTreeType * tree, const TreeNodeType * start);

mutable TreeNodeType * m_Position; // Current position of the iterator
mutable TreeNodeType * m_Position{}; // Current position of the iterator
mutable TreeNodeType * m_Begin{};
const TreeNodeType * m_Root{};
TTreeType * m_Tree{};
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkBoundingBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ class ITK_TEMPLATE_EXPORT BoundingBox : public Object
PointsContainerPointer m_CornersContainer{ PointsContainer::New() };
#endif
mutable BoundsArrayType m_Bounds{};
mutable TimeStamp m_BoundsMTime; // The last time the bounds
// were computed.
mutable TimeStamp m_BoundsMTime{}; // The last time the bounds
// were computed.
};
} // end namespace itk

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkDataObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ class ITK_FORCE_EXPORT_MACRO(ITKCommon) DataObject : public Object
/** When, in real time, this data was generated. */
RealTimeStamp m_RealTimeStamp{};

bool m_ReleaseDataFlag; // Data will release after use by a filter if on
bool m_DataReleased; // Keep track of data release during pipeline execution
bool m_ReleaseDataFlag{}; // Data will release after use by a filter if on
bool m_DataReleased{}; // Keep track of data release during pipeline execution

/** The maximum MTime of all upstream filters and data objects.
* This does not include the MTime of this data object. */
Expand Down
6 changes: 3 additions & 3 deletions Modules/Core/Common/include/itkImageConstIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,11 @@ class ITK_TEMPLATE_EXPORT ImageConstIterator
protected: // made protected so other iterators can access
typename TImage::ConstWeakPointer m_Image{};

RegionType m_Region; // region to iterate over
RegionType m_Region{}; // region to iterate over

OffsetValueType m_Offset{};
OffsetValueType m_BeginOffset; // offset to first pixel in region
OffsetValueType m_EndOffset; // offset to one pixel past last pixel in region
OffsetValueType m_BeginOffset{}; // offset to first pixel in region
OffsetValueType m_EndOffset{}; // offset to one pixel past last pixel in region

const InternalPixelType * m_Buffer{};

Expand Down
6 changes: 3 additions & 3 deletions Modules/Core/Common/include/itkImageRegionConstIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ class ITK_TEMPLATE_EXPORT ImageRegionConstIterator : public ImageConstIterator<T
}

protected:
OffsetValueType m_SpanBeginOffset; // one pixel before the beginning of the span
// (row)
OffsetValueType m_SpanEndOffset; // one pixel past the end of the span (row)
OffsetValueType m_SpanBeginOffset{}; // one pixel before the beginning of the span
// (row)
OffsetValueType m_SpanEndOffset{}; // one pixel past the end of the span (row)

private:
void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ class ITK_TEMPLATE_EXPORT ImageRegionReverseConstIterator : public ImageReverseC
}

protected:
SizeValueType m_SpanBeginOffset; // offset to last pixel in the row
SizeValueType m_SpanEndOffset; // offset to one pixel before the row
SizeValueType m_SpanBeginOffset{}; // offset to last pixel in the row
SizeValueType m_SpanEndOffset{}; // offset to one pixel before the row
};
} // end namespace itk

Expand Down
6 changes: 3 additions & 3 deletions Modules/Core/Common/include/itkImageReverseConstIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,11 @@ class ITK_TEMPLATE_EXPORT ImageReverseConstIterator
protected: // made protected so other iterators can access
typename ImageType::ConstWeakPointer m_Image{};

RegionType m_Region; // region to iterate over
RegionType m_Region{}; // region to iterate over

SizeValueType m_Offset{};
SizeValueType m_BeginOffset; // offset to last pixel in region
SizeValueType m_EndOffset; // offset to one pixel before first pixel
SizeValueType m_BeginOffset{}; // offset to last pixel in region
SizeValueType m_EndOffset{}; // offset to one pixel before first pixel

const InternalPixelType * m_Buffer{};

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkImageScanlineConstIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ class ITK_TEMPLATE_EXPORT ImageScanlineConstIterator : public ImageConstIterator


protected:
OffsetValueType m_SpanBeginOffset; // one pixel the beginning of the scanline
OffsetValueType m_SpanEndOffset; // one pixel past the end of the scanline
OffsetValueType m_SpanBeginOffset{}; // one pixel the beginning of the scanline
OffsetValueType m_SpanEndOffset{}; // one pixel past the end of the scanline
};
} // end namespace itk

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkLineConstIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class ITK_TEMPLATE_EXPORT LineConstIterator
IndexType m_CurrentImageIndex{};
IndexType m_StartIndex{};
IndexType m_LastIndex{};
IndexType m_EndIndex; // one past the end of the line in the m_MainDirection
IndexType m_EndIndex{}; // one past the end of the line in the m_MainDirection

/** Variables that drive the Bresenham-Algorithm */
// The dimension with the largest difference between start and end
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkOctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ class ITK_TEMPLATE_EXPORT Octree : public OctreeBase
// and large enough to contain MAX(DIMS[1,2,3])
unsigned int m_Width{ 0 };

unsigned int m_Depth{ 0 }; // The depth of the Octree
unsigned int m_TrueDims[3]; // The true dimensions of the image
unsigned int m_Depth{ 0 }; // The depth of the Octree
unsigned int m_TrueDims[3]{}; // The true dimensions of the image
OctreeNodeBranch m_ColorTable[ColorTableSize];
OctreeNode m_Tree{};
MappingFunctionType m_MappingFunction{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ class ITK_TEMPLATE_EXPORT PhasedArray3DSpecialCoordinatesImage : public SpecialC
PrintSelf(std::ostream & os, Indent indent) const override;

private:
double m_AzimuthAngularSeparation; // in radians
double m_ElevationAngularSeparation; // in radians
double m_AzimuthAngularSeparation{}; // in radians
double m_ElevationAngularSeparation{}; // in radians
double m_RadiusSampleSize{};
double m_FirstSampleDistance{};
};
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkSmapsFileParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ class ITK_TEMPLATE_EXPORT MapFileParser
GetMemoryUsage(const char * filter, const char * token = "Size");

protected:
std::string m_MapFilePath; //< location of the last loaded Map file
TMapData m_MapData; //< data of the loaded smap file
std::string m_MapFilePath{}; //< location of the last loaded Map file
TMapData m_MapData{}; //< data of the loaded smap file
};

/** \class SmapsFileParser
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/GPUCommon/include/itkGPUContextManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GPUContextManager : public LightObject
cl_platform_id m_Platform{};
cl_context m_Context{};
cl_device_id * m_Devices{};
cl_command_queue * m_CommandQueue; // one queue per device
cl_command_queue * m_CommandQueue{}; // one queue per device

cl_uint m_NumberOfDevices, m_NumberOfPlatforms{};

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/GPUCommon/include/itkGPUDataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class GPUDataManager : public Object // DataObject//
protected:
/* NOTE: ivars are protected instead of private to improve performance access in child classes*/

unsigned int m_BufferSize; // # of bytes
unsigned int m_BufferSize{}; // # of bytes

GPUContextManager * m_ContextManager{};

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/GPUCommon/include/itkGPUImageDataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class ITK_TEMPLATE_EXPORT GPUImageDataManager : public GPUDataManager
~GPUImageDataManager() override = default;

private:
WeakPointer<ImageType> m_Image; // WeakPointer has to be used here
// to avoid SmartPointer loop
WeakPointer<ImageType> m_Image{}; // WeakPointer has to be used here
// to avoid SmartPointer loop
int m_BufferedRegionIndex[ImageType::ImageDimension]{};
int m_BufferedRegionSize[ImageType::ImageDimension]{};
typename GPUDataManager::Pointer m_GPUBufferedRegionIndex{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,17 +396,17 @@ class ITK_TEMPLATE_EXPORT BSplineInterpolateImageFunction : public InterpolateIm
void
ApplyMirrorBoundaryConditions(vnl_matrix<long> & evaluateIndex, unsigned int splineOrder) const;

Iterator m_CIterator; // Iterator for
// traversing spline
// coefficients.
unsigned long m_MaxNumberInterpolationPoints; // number of
// neighborhood
// points used for
// interpolation
std::vector<IndexType> m_PointsToIndex; // Preallocation of
// interpolation
// neighborhood
// indices
Iterator m_CIterator{}; // Iterator for
// traversing spline
// coefficients.
unsigned long m_MaxNumberInterpolationPoints{}; // number of
// neighborhood
// points used for
// interpolation
std::vector<IndexType> m_PointsToIndex{}; // Preallocation of
// interpolation
// neighborhood
// indices

CoefficientFilterPointer m_CoefficientFilter{};

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class ITK_TEMPLATE_EXPORT AutomaticTopologyMeshSource : public MeshSource<TOutpu

PointHashMap m_PointsHashTable{};
CellHashMap m_CellsHashTable{};
MeshPointer m_OutputMesh; // Retained for convenience.
MeshPointer m_OutputMesh{}; // Retained for convenience.
};
} // end namespace itk

Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Mesh/include/itkBinaryMask3DMeshSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class ITK_TEMPLATE_EXPORT BinaryMask3DMeshSource : public ImageToMeshFilter<TInp
IdentifierType
SearchThroughLastFrame(int index, int start, int end);

unsigned char m_LUT[256][2]; // the two lookup tables
unsigned char m_LUT[256][2]{}; // the two lookup tables

IdentifierType m_LastVoxel[14]{};
IdentifierType m_CurrentVoxel[14]{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class ITK_TEMPLATE_EXPORT TriangleMeshToBinaryImageFilter : public ImageSource<T

SpacingType m_Spacing{};

PointType m_Origin; // start value
PointType m_Origin{}; // start value

double m_Tolerance{};

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/QuadEdgeMesh/include/itkGeometricalQuadEdge.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ class ITK_TEMPLATE_EXPORT GeometricalQuadEdge : public QuadEdge
static const OriginRefType m_NoPoint;

protected:
OriginRefType m_Origin; // Geometrical information
PrimalDataType m_Data; // User data associated to this edge.
OriginRefType m_Origin{}; // Geometrical information
PrimalDataType m_Data{}; // User data associated to this edge.
bool m_DataSet{ false }; // Indicates if the data is set.
LineCellIdentifier m_LineCellIdent{};
};
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/QuadEdgeMesh/include/itkQuadEdge.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ class ITKQuadEdgeMesh_EXPORT QuadEdge
GetOrder() const;

private:
Self * m_Onext; /**< Onext ring */
Self * m_Rot; /**< Rot ring */
Self * m_Onext{}; /**< Onext ring */
Self * m_Rot{}; /**< Rot ring */
};
} // namespace itk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ class QuadEdgeMeshBaseIterator
}

protected:
QuadEdgeType * m_StartEdge; /**< Start edge */
QuadEdgeType * m_Iterator; /**< Current iteration position */
int m_OpType; /**< Operation type */
bool m_Start; /**< Indicates iteration has just started */
QuadEdgeType * m_StartEdge{}; /**< Start edge */
QuadEdgeType * m_Iterator{}; /**< Current iteration position */
int m_OpType{}; /**< Operation type */
bool m_Start{}; /**< Indicates iteration has just started */
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshEulerOperatorSplitVertexFunction
~QuadEdgeMeshEulerOperatorSplitVertexFunction() override = default;

private:
PointIdentifier m_NewPoint; // stock newly created point ID for user.
PointIdentifier m_NewPoint{}; // stock newly created point ID for user.
};
} // end namespace itk

Expand Down
12 changes: 6 additions & 6 deletions Modules/Core/TestKernel/include/itkRandomImageSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ class ITK_TEMPLATE_EXPORT RandomImageSource : public ImageSource<TOutputImage>
GenerateOutputInformation() override;

private:
SizeType m_Size; // size of the output image
SpacingType m_Spacing; // spacing
PointType m_Origin; // origin
DirectionType m_Direction; // direction
SizeType m_Size{}; // size of the output image
SpacingType m_Spacing{}; // spacing
PointType m_Origin{}; // origin
DirectionType m_Direction{}; // direction

typename TOutputImage::PixelType m_Min; // minimum possible value
typename TOutputImage::PixelType m_Max; // maximum possible value
typename TOutputImage::PixelType m_Min{}; // minimum possible value
typename TOutputImage::PixelType m_Max{}; // maximum possible value

// The following variables are deprecated, and provided here just for
// backward compatibility. It use is discouraged.
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Transform/include/itkScaleTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class ITK_TEMPLATE_EXPORT ScaleTransform
PrintSelf(std::ostream & os, Indent indent) const override;

private:
ScaleType m_Scale; // Scales of the transformation
ScaleType m_Scale{}; // Scales of the transformation

}; // class ScaleTransform

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Transform/include/itkTranslationTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ class ITK_TEMPLATE_EXPORT TranslationTransform : public Transform<TParametersVal

private:
JacobianType m_IdentityJacobian{};
OutputVectorType m_Offset; // Offset of the transformation
}; // class TranslationTransform
OutputVectorType m_Offset{}; // Offset of the transformation
}; // class TranslationTransform

// Back transform a point
template <typename TParametersValueType, unsigned int VDimension>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,14 @@ class ITK_TEMPLATE_EXPORT InverseDisplacementFieldImageFilter : public ImageToIm
PrepareKernelBaseSpline();

private:
SizeType m_Size; // Size of the output image
KernelTransformPointerType m_KernelTransform; // Coordinate transform to
// use
SpacingType m_OutputSpacing; // output image spacing
OriginPointType m_OutputOrigin; // output image origin

unsigned int m_SubsamplingFactor; // factor to subsample the
// input field.
SizeType m_Size{}; // Size of the output image
KernelTransformPointerType m_KernelTransform{}; // Coordinate transform to
// use
SpacingType m_OutputSpacing{}; // output image spacing
OriginPointType m_OutputOrigin{}; // output image origin

unsigned int m_SubsamplingFactor{}; // factor to subsample the
// input field.
};
} // end namespace itk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ class ITK_TEMPLATE_EXPORT TransformToDisplacementFieldFilter : public ImageSourc

private:
/** Member variables. */
SizeType m_Size; // size of the output region
IndexType m_OutputStartIndex; // start index of the output region
SpacingType m_OutputSpacing; // output image spacing
OriginType m_OutputOrigin; // output image origin
DirectionType m_OutputDirection; // output image direction cosines
SizeType m_Size{}; // size of the output region
IndexType m_OutputStartIndex{}; // start index of the output region
SpacingType m_OutputSpacing{}; // output image spacing
OriginType m_OutputOrigin{}; // output image origin
DirectionType m_OutputDirection{}; // output image direction cosines
bool m_UseReferenceImage{ false };
};
} // end namespace itk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ class ITK_TEMPLATE_EXPORT SignedDanielssonDistanceMapImageFilter : public ImageT
private:
bool m_SquaredDistance{};
bool m_UseImageSpacing{};
bool m_InsideIsPositive; // ON is treated as inside pixels
}; // end of SignedDanielssonDistanceMapImageFilter
// class
bool m_InsideIsPositive{}; // ON is treated as inside pixels
}; // end of SignedDanielssonDistanceMapImageFilter
// class
} // end namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ class ITK_TEMPLATE_EXPORT CannyEdgeDetectionImageFilter : public ImageToImageFil
ArrayType m_Variance{};
ArrayType m_MaximumError{};

OutputImagePixelType m_UpperThreshold; // should be float here?
OutputImagePixelType m_LowerThreshold; // should be float here?
OutputImagePixelType m_UpperThreshold{}; // should be float here?
OutputImagePixelType m_LowerThreshold{}; // should be float here?

typename OutputImageType::Pointer m_UpdateBuffer1{};

Expand Down
Loading

0 comments on commit df57675

Please sign in to comment.