Use size_t instead of int for number of points

This squashes warnings under Visual Studio 12
pull/447/head
Joe Hermaszewski 2015-01-26 15:38:12 +00:00 committed by Joe Hermaszewski
parent 1cf81227c4
commit 00d561982c
2 changed files with 4 additions and 4 deletions

View File

@ -96,8 +96,8 @@ void SweepContext::InitTriangulation()
void SweepContext::InitEdges(std::vector<Point*> polyline)
{
int num_points = polyline.size();
for (int i = 0; i < num_points - 1; i++) {
std::size_t num_points = polyline.size();
for (std::size_t i = 0; i < num_points - 1; i++) {
edge_list.push_back(new Edge(*polyline[i], *polyline[i + 1]));
}
edge_list.push_back(new Edge(*polyline.back(), *polyline.front()));

View File

@ -64,7 +64,7 @@ void set_tail(Point* p1);
Point* tail();
int point_count();
std::size_t point_count();
Node& LocateNode(Point& point);
@ -156,7 +156,7 @@ inline AdvancingFront* SweepContext::front()
return front_;
}
inline int SweepContext::point_count()
inline std::size_t SweepContext::point_count()
{
return points_.size();
}