From 544aec554cbdc02439f4205dd78ec648de211906 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Thu, 12 Jul 2012 19:56:59 +0200 Subject: [PATCH] fixed compiler warnings --- poly2tri/common/shapes.cc | 13 ++++++------- poly2tri/sweep/sweep.cc | 6 ++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/poly2tri/common/shapes.cc b/poly2tri/common/shapes.cc index 77bafa1..fce2bf6 100644 --- a/poly2tri/common/shapes.cc +++ b/poly2tri/common/shapes.cc @@ -1,4 +1,4 @@ -/* +/* * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors * http://code.google.com/p/poly2tri/ * @@ -96,14 +96,14 @@ void Triangle::ClearNeighbor(Triangle *triangle ) } else if( neighbors_[1] == triangle ) { - neighbors_[1] = NULL; + neighbors_[1] = NULL; } else { neighbors_[2] = NULL; } } - + void Triangle::ClearNeighbors() { neighbors_[0] = NULL; @@ -119,10 +119,6 @@ void Triangle::ClearDelunayEdges() Point* Triangle::OppositePoint(Triangle& t, Point& p) { Point *cw = t.PointCW(p); - double x = cw->x; - double y = cw->y; - x = p.x; - y = p.y; return PointCW(*cw); } @@ -164,6 +160,7 @@ int Triangle::Index(const Point* p) return 2; } assert(0); + return -1; } int Triangle::EdgeIndex(const Point* p1, const Point* p2) @@ -223,6 +220,7 @@ Point* Triangle::PointCW(Point& point) return points_[1]; } assert(0); + return NULL; } // The point counter-clockwise to given point @@ -236,6 +234,7 @@ Point* Triangle::PointCCW(Point& point) return points_[0]; } assert(0); + return NULL; } // The neighbor clockwise to given point diff --git a/poly2tri/sweep/sweep.cc b/poly2tri/sweep/sweep.cc index 992f0e5..ff439ab 100644 --- a/poly2tri/sweep/sweep.cc +++ b/poly2tri/sweep/sweep.cc @@ -765,10 +765,8 @@ Point& Sweep::NextFlipPoint(Point& ep, Point& eq, Triangle& ot, Point& op) } else if (o2d == CCW) { // Left return *ot.PointCW(op); - } else{ - //throw new RuntimeException("[Unsupported] Opposing point on constrained edge"); - assert(0); } + throw std::runtime_error("[Unsupported] Opposing point on constrained edge"); } void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& flip_triangle, @@ -803,7 +801,7 @@ void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& Sweep::~Sweep() { // Clean up memory - for(int i = 0; i < nodes_.size(); i++) { + for(size_t i = 0; i < nodes_.size(); i++) { delete nodes_[i]; }