fix compiler warnings about size_t to int conversion

This commit is contained in:
Jan Niklas Hasse 2012-08-17 23:23:36 +02:00
parent c08527deb3
commit f4f6ab5ab1
2 changed files with 6 additions and 6 deletions

View File

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

View File

@ -64,7 +64,7 @@ void set_tail(Point* p1);
Point* tail();
int point_count();
size_t point_count();
Node& LocateNode(Point& point);
@ -92,7 +92,7 @@ AdvancingFront* front();
void MeshClean(Triangle& triangle);
std::vector<Triangle*> GetTriangles();
std::list<Triangle*> GetMap();
std::list<Triangle*> GetMap();
std::vector<Edge*> edge_list;
@ -156,7 +156,7 @@ inline AdvancingFront* SweepContext::front()
return front_;
}
inline int SweepContext::point_count()
inline size_t SweepContext::point_count()
{
return points_.size();
}