From cd1da000fa8db43fd827ee8d07b6048ea5cac92d Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 21 Oct 2017 16:25:36 +0200 Subject: [PATCH] Prefer nullptr --- include/deal.II/base/numbers.h | 2 +- include/deal.II/fe/fe_tools_extrapolate.templates.h | 2 +- include/deal.II/grid/tria_accessor.h | 8 ++++---- include/deal.II/lac/la_parallel_block_vector.templates.h | 2 +- include/deal.II/lac/la_parallel_vector.templates.h | 2 +- include/deal.II/lac/la_vector.templates.h | 2 +- source/distributed/p4est_wrappers.cc | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/deal.II/base/numbers.h b/include/deal.II/base/numbers.h index c25eadb659..2c03b71cf6 100644 --- a/include/deal.II/base/numbers.h +++ b/include/deal.II/base/numbers.h @@ -446,7 +446,7 @@ namespace internal typename std::enable_if< !std::is_same::type,typename std::decay::type>::value && std::is_constructible::value - >::type * = 0) + >::type * = nullptr) { return T(f); } diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index 9d1f24d457..6483d48473 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -1460,7 +1460,7 @@ namespace FETools { const parallel::distributed::Triangulation *parallel_tria = dynamic_cast*>(&dh.get_triangulation()); - Assert (parallel_tria !=0, ExcNotImplemented()); + Assert (parallel_tria !=nullptr, ExcNotImplemented()); const IndexSet &locally_owned_dofs = dh.locally_owned_dofs(); vector.reinit(locally_owned_dofs, parallel_tria->get_communicator()); diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index 81828d2a3b..4e7883b149 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -511,10 +511,10 @@ public: * semantic sense, and we generate an exception when such an object is * actually generated. */ - InvalidAccessor (const Triangulation *parent = 0, - const int level = -1, - const int index = -1, - const AccessorData *local_data = 0); + InvalidAccessor (const Triangulation *parent = nullptr, + const int level = -1, + const int index = -1, + const AccessorData *local_data = nullptr); /** * Copy constructor. This class is used for iterators that do not make diff --git a/include/deal.II/lac/la_parallel_block_vector.templates.h b/include/deal.II/lac/la_parallel_block_vector.templates.h index 8902adcd7a..d427115065 100644 --- a/include/deal.II/lac/la_parallel_block_vector.templates.h +++ b/include/deal.II/lac/la_parallel_block_vector.templates.h @@ -296,7 +296,7 @@ namespace LinearAlgebra BlockVector::reinit(const VectorSpaceVector &V, const bool omit_zeroing_entries) { - Assert(dynamic_cast *>(&V)!=NULL, + Assert(dynamic_cast *>(&V)!=nullptr, ExcVectorTypeNotCompatible()); const BlockVector &down_V = dynamic_cast &>(V); reinit(down_V, omit_zeroing_entries); diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index c120889a0e..2e65d4e02f 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -742,7 +742,7 @@ namespace LinearAlgebra const bool omit_zeroing_entries) { // Downcast. Throws an exception if invalid. - Assert(dynamic_cast *>(&V)!=NULL, + Assert(dynamic_cast *>(&V)!=nullptr, ExcVectorTypeNotCompatible()); const Vector &down_V = dynamic_cast &>(V); diff --git a/include/deal.II/lac/la_vector.templates.h b/include/deal.II/lac/la_vector.templates.h index ecedcd94f5..40c5ae2e6a 100644 --- a/include/deal.II/lac/la_vector.templates.h +++ b/include/deal.II/lac/la_vector.templates.h @@ -58,7 +58,7 @@ namespace LinearAlgebra const bool omit_zeroing_entries) { // Check that casting will work. - Assert(dynamic_cast*>(&V)!=NULL, ExcVectorTypeNotCompatible()); + Assert(dynamic_cast*>(&V)!=nullptr, ExcVectorTypeNotCompatible()); // Downcast V. If fails, throws an exception. const Vector &down_V = dynamic_cast&>(V); diff --git a/source/distributed/p4est_wrappers.cc b/source/distributed/p4est_wrappers.cc index eb54838bed..e2f6f22a39 100644 --- a/source/distributed/p4est_wrappers.cc +++ b/source/distributed/p4est_wrappers.cc @@ -467,7 +467,7 @@ namespace internal p4est_iterate (reinterpret_cast::forest *>(parallel_forest), reinterpret_cast::ghost *>(parallel_ghost), static_cast(&fg), - NULL, find_ghosts_face<2,spacedim>, find_ghosts_corner<2,spacedim>); + nullptr, find_ghosts_face<2,spacedim>, find_ghosts_corner<2,spacedim>); break; case 3: -- 2.39.5