Fix a clang-tidy warning by using nullptr instead of 0

This commit is contained in:
Laurent Rineau 2020-01-31 14:49:31 +01:00
parent aed73efb46
commit 14b8930f79
4 changed files with 11 additions and 10 deletions

View File

@ -118,7 +118,8 @@ void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end,
typedef std::iterator_traits<RandomAccessIterator> ITraits;
typedef typename ITraits::value_type value_type;
internal::spatial_sort(begin, end, k, policy, static_cast<value_type *> (0),
internal::spatial_sort(begin, end, k, policy,
static_cast<value_type *> (nullptr),
threshold_hilbert,threshold_multiscale,ratio);
}

View File

@ -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);

View File

@ -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<Gt,Tds,Itag>::
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);}

View File

@ -625,7 +625,7 @@ std::ptrdiff_t insert(InputIterator first, InputIterator last,
typename std::iterator_traits<InputIterator>::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());