From 46557e001ea35a8666e9551fdda550d5b9159618 Mon Sep 17 00:00:00 2001 From: Hugo Mercier Date: Fri, 8 Sep 2017 15:06:54 +0200 Subject: [PATCH] Use explicit INVALID_INDEX constant --- src/algorithm/connection.cpp | 4 ++++ src/algorithm/connection.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/algorithm/connection.cpp b/src/algorithm/connection.cpp index 0d3906f9..48ab83a3 100644 --- a/src/algorithm/connection.cpp +++ b/src/algorithm/connection.cpp @@ -28,9 +28,13 @@ #include #include +#include + namespace SFCGAL { namespace algorithm { +const size_t SurfaceGraph::INVALID_INDEX = std::numeric_limits< size_t >::max(); + void SurfaceGraph::addRing( const LineString& ring, FaceIndex faceIndex ) { const size_t numSegments = ring.numSegments() ; diff --git a/src/algorithm/connection.h b/src/algorithm/connection.h index ed9627c7..50bcec54 100644 --- a/src/algorithm/connection.h +++ b/src/algorithm/connection.h @@ -44,7 +44,7 @@ class SFCGAL_API SurfaceGraph : boost::noncopyable { typedef size_t VertexIndex; typedef size_t FaceIndex; typedef std::map< Coordinate, VertexIndex > CoordinateMap ; - static const size_t INVALID_INDEX = size_t( -1 ) ; // would use std::numeric_limits< size_t >::max() if it were constant, or SIZE_MAX if it were easier to find. + static const size_t INVALID_INDEX; // an edge is inserted with vtx ordered by the first polygon we treat, // we search the edge with reverse ordered vtx indexes. // as a result, an inconsistent orientation between polygons can be spotted by