Skip to content

Commit

Permalink
STYLE: Remove C-style cast from nullptr default arguments QuadEdgeMesh
Browse files Browse the repository at this point in the history
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
  • Loading branch information
N-Dekker committed Nov 12, 2024
1 parent b03240a commit aa38494
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{}

Expand Down
11 changes: 3 additions & 8 deletions Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshFrontIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
using FrontIterator = QuadEdgeMeshFrontIterator<MeshTypeArg, QEPrimalType>; \
using ConstFrontIterator = QuadEdgeMeshConstFrontIterator<MeshTypeArg, QEPrimalType>; \
\
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)); } \
\
Expand Down Expand Up @@ -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 &
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit aa38494

Please sign in to comment.