Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMP: Fix zero as null pointer constant #4681

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Modules/Core/Common/test/itkSmartPointerGTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,34 @@ TEST(SmartPointer, EmptyAndNull)
cptr = nullptr;
EXPECT_TRUE(cptr.IsNull());

#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wzero-as-null-pointer-constant")
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
# endif
#endif
// NOLINTNEXTLINE(modernize-use-nullptr)
ptr = NULL; // Do not change NULL, null, Null in this file. This file intentionally contains usage of legacy NULL
#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wzero-as-null-pointer-constant")
# pragma clang diagnostic pop
# endif
#endif
EXPECT_TRUE(ptr.IsNull());

#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wzero-as-null-pointer-constant")
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
# endif
#endif
// NOLINTNEXTLINE(modernize-use-nullptr)
cptr = NULL; // Do not change NULL, null, Null in this file. This file intentionally contains usage of legacy NULL
#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wzero-as-null-pointer-constant")
# pragma clang diagnostic pop
# endif
#endif
EXPECT_TRUE(cptr.IsNull());


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
using FrontIterator = QuadEdgeMeshFrontIterator<MeshTypeArg, QEPrimalType>; \
using ConstFrontIterator = QuadEdgeMeshConstFrontIterator<MeshTypeArg, QEPrimalType>; \
\
virtual FrontIterator BeginFront(QEPrimalType * seed = (QEPrimalType *)0) \
virtual FrontIterator BeginFront(QEPrimalType * seed = (QEPrimalType *)nullptr) \
{ \
return (FrontIterator(this, true, seed)); \
} \
Expand Down