From e45c110f4f4297964db202934ad56561027daa9e Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Wed, 6 Nov 2024 23:26:19 +0100 Subject: [PATCH] STYLE: Remove C-style cast from `nullptr` default arguments QuadEdgeMesh Found by the regular expression `(\w+ \*)([ ]+\w+ = )\(\1\)nullptr`. Following C++ Core Guidelines, Oct 3, 2024, "Avoid casts", http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es48-avoid-casts --- .../include/itkQuadEdgeMeshBaseIterator.h | 4 +--- .../include/itkQuadEdgeMeshFrontIterator.h | 11 +++-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshBaseIterator.h b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshBaseIterator.h index 0e32f3862ee1..64631eaa8812 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshBaseIterator.h +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshBaseIterator.h @@ -275,9 +275,7 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshIteratorGeom : public QuadEdgeMeshIterator using OriginRefType = typename QuadEdgeType::OriginRefType; public: - QuadEdgeMeshIteratorGeom(QuadEdgeType * e = (QuadEdgeType *)nullptr, - int op = Superclass::OperatorOnext, - bool start = true) + QuadEdgeMeshIteratorGeom(QuadEdgeType * e = nullptr, int op = Superclass::OperatorOnext, bool start = true) : Superclass(e, op, start) {} diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshFrontIterator.h b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshFrontIterator.h index 9072eda96f18..7ddc9d965811 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshFrontIterator.h +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshFrontIterator.h @@ -32,10 +32,7 @@ using FrontIterator = QuadEdgeMeshFrontIterator; \ using ConstFrontIterator = QuadEdgeMeshConstFrontIterator; \ \ - virtual FrontIterator BeginFront(QEPrimalType * seed = (QEPrimalType *)nullptr) \ - { \ - return (FrontIterator(this, true, seed)); \ - } \ + virtual FrontIterator BeginFront(QEPrimalType * seed = nullptr) { return (FrontIterator(this, true, seed)); } \ \ virtual ConstFrontIterator BeginFront(QEPrimalType * seed) const { return (ConstFrontIterator(this, true, seed)); } \ \ @@ -149,9 +146,7 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshFrontBaseIterator public: /** Object creation methods. */ - QuadEdgeMeshFrontBaseIterator(MeshType * mesh = (MeshType *)nullptr, - bool start = true, - QEType * seed = (QEType *)nullptr); + QuadEdgeMeshFrontBaseIterator(MeshType * mesh = nullptr, bool start = true, QEType * seed = nullptr); virtual ~QuadEdgeMeshFrontBaseIterator(); Self & @@ -242,7 +237,7 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshFrontIterator : public QuadEdgeMeshFrontBa public: /** Object creation methods. */ - QuadEdgeMeshFrontIterator(MeshType * mesh = (MeshType *)0, bool start = true, QEType * seed = (QEType *)nullptr) + QuadEdgeMeshFrontIterator(MeshType * mesh = (MeshType *)0, bool start = true, QEType * seed = nullptr) : Superclass(mesh, start, seed) {} ~QuadEdgeMeshFrontIterator() override = default;