From 15773cbf93b9059b2dca4bbd2710658af73e68d4 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Wed, 25 Jun 2014 09:34:53 +0300 Subject: [PATCH] [algorithms][is_valid] fix some wrong usages of std::size_t (should have been int) --- .../algorithms/detail/is_valid/complement_graph.hpp | 4 ++-- .../geometry/algorithms/detail/is_valid/polygon.hpp | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp b/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp index 38b2cda1e..0a4d67e30 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp @@ -198,7 +198,7 @@ public: // inserts a ring vertex in the graph and returns its handle // ring id's are zero-based (so the first interior ring has id 1) - vertex_handle add_vertex(std::size_t id) + vertex_handle add_vertex(int id) { return m_vertices.insert(vertex(id)).first; } @@ -212,7 +212,7 @@ public: if ( res.second ) { // a new element is inserted - res.first->id( m_num_rings + m_num_turns ); + res.first->id( static_cast(m_num_rings + m_num_turns) ); ++m_num_turns; } return res.first; diff --git a/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp b/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp index b9f3e9ca0..cdd1b2dc1 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp @@ -155,11 +155,6 @@ protected: - static inline std::size_t get_vertex_id(int ring_id) - { - return static_cast(ring_id + 1); - } - template static inline bool has_connected_interior(Polygon const& polygon, TurnIterator first, @@ -175,9 +170,9 @@ protected: for (TurnIterator tit = first; tit != beyond; ++tit) { typename graph::vertex_handle v1 = g.add_vertex - ( get_vertex_id(tit->operations[0].seg_id.ring_index) ); + ( tit->operations[0].seg_id.ring_index + 1 ); typename graph::vertex_handle v2 = g.add_vertex - ( get_vertex_id(tit->operations[0].other_id.ring_index) ); + ( tit->operations[0].other_id.ring_index + 1 ); typename graph::vertex_handle vip = g.add_vertex(tit->point); g.add_edge(v1, vip);