From 14b8930f791318365a55ac48d3ff226d8554ea7a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 31 Jan 2020 14:49:31 +0100 Subject: [PATCH] Fix a clang-tidy warning by using nullptr instead of 0 --- Spatial_sorting/include/CGAL/spatial_sort.h | 3 ++- TDS_2/include/CGAL/Triangulation_data_structure_2.h | 2 +- .../include/CGAL/Constrained_triangulation_2.h | 10 +++++----- Triangulation_2/include/CGAL/Triangulation_2.h | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Spatial_sorting/include/CGAL/spatial_sort.h b/Spatial_sorting/include/CGAL/spatial_sort.h index 8aa44ff6af7..891889e4b50 100644 --- a/Spatial_sorting/include/CGAL/spatial_sort.h +++ b/Spatial_sorting/include/CGAL/spatial_sort.h @@ -118,7 +118,8 @@ void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end, typedef std::iterator_traits ITraits; typedef typename ITraits::value_type value_type; - internal::spatial_sort(begin, end, k, policy, static_cast (0), + internal::spatial_sort(begin, end, k, policy, + static_cast (nullptr), threshold_hilbert,threshold_multiscale,ratio); } diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index 9eb67f85818..680ab3579e9 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -822,7 +822,7 @@ is_edge(Vertex_handle va, Vertex_handle vb, { Face_handle fc = va->face(); Face_handle start = fc; - if (fc == 0) return false; + if (fc == nullptr) return false; int inda, indb; do { inda=fc->index(va); diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index 4805a68e33e..9fe6473e79a 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -556,7 +556,7 @@ public: { Edge_circulator ec=incident_edges(v), done(ec); bool are_there = false; - if (ec == 0) return are_there; + if (ec == nullptr) return are_there; do { if(is_constrained(*ec)) { *out++ = *ec; @@ -572,7 +572,7 @@ public: OutputItEdges incident_constraints(Vertex_handle v, OutputItEdges out) const { Edge_circulator ec=incident_edges(v), done(ec); - if (ec == 0) return out; + if (ec == nullptr) return out; do { if(is_constrained(*ec)) *out++ = *ec; ec++; @@ -1064,7 +1064,7 @@ update_constraints_incident(Vertex_handle va, //dimension() ==2 int cwi, ccwi, indf; Face_circulator fc=incident_faces(va), done(fc); - CGAL_triangulation_assertion(fc != 0); + CGAL_triangulation_assertion(fc != nullptr); do { indf = fc->index(va); cwi=cw(indf); @@ -1091,7 +1091,7 @@ clear_constraints_incident(Vertex_handle va) Edge_circulator ec=incident_edges(va), done(ec); Face_handle f; int indf; - if ( ec != 0){ + if ( ec != nullptr){ do { f = (*ec).first ; indf = (*ec).second; @@ -1278,7 +1278,7 @@ Constrained_triangulation_2:: remove_incident_constraints(Vertex_handle v) { Edge_circulator ec=incident_edges(v), done(ec); - if (ec == 0) return; + if (ec == nullptr) return; do { if(is_constrained(*ec)) { remove_constrained_edge((*ec).first, (*ec).second);} diff --git a/Triangulation_2/include/CGAL/Triangulation_2.h b/Triangulation_2/include/CGAL/Triangulation_2.h index de91b826848..62c1d72902d 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -625,7 +625,7 @@ std::ptrdiff_t insert(InputIterator first, InputIterator last, typename std::iterator_traits::value_type, Point > - >::type* = NULL) + >::type* = nullptr) #else template < class InputIterator > std::ptrdiff_t @@ -1013,7 +1013,7 @@ includes_edge(Vertex_handle va, Vertex_handle vb, Orientation orient; int indv; Edge_circulator ec = incident_edges(va), done(ec); - if (ec != 0) { + if (ec != nullptr) { do { //find the index of the other vertex of *ec indv = 3 - ((*ec).first)->index(va) - (*ec).second ; @@ -2602,7 +2602,7 @@ march_locate_2D_LFC(Face_handle start, }else { lfc = Line_face_circulator(start->vertex(0), this, t); } - if(lfc==0 || lfc.collinear_outside()){ + if(lfc==nullptr || lfc.collinear_outside()){ // point t lies outside or on the convex hull // we walk on the convex hull to find it out Face_circulator fc = incident_faces(infinite_vertex());