fixed compiler warnings

This commit is contained in:
Jan Niklas Hasse 2012-07-12 19:56:59 +02:00
parent 973280c769
commit 544aec554c
2 changed files with 8 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* /*
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/ * http://code.google.com/p/poly2tri/
* *
@ -96,14 +96,14 @@ void Triangle::ClearNeighbor(Triangle *triangle )
} }
else if( neighbors_[1] == triangle ) else if( neighbors_[1] == triangle )
{ {
neighbors_[1] = NULL; neighbors_[1] = NULL;
} }
else else
{ {
neighbors_[2] = NULL; neighbors_[2] = NULL;
} }
} }
void Triangle::ClearNeighbors() void Triangle::ClearNeighbors()
{ {
neighbors_[0] = NULL; neighbors_[0] = NULL;
@ -119,10 +119,6 @@ void Triangle::ClearDelunayEdges()
Point* Triangle::OppositePoint(Triangle& t, Point& p) Point* Triangle::OppositePoint(Triangle& t, Point& p)
{ {
Point *cw = t.PointCW(p); Point *cw = t.PointCW(p);
double x = cw->x;
double y = cw->y;
x = p.x;
y = p.y;
return PointCW(*cw); return PointCW(*cw);
} }
@ -164,6 +160,7 @@ int Triangle::Index(const Point* p)
return 2; return 2;
} }
assert(0); assert(0);
return -1;
} }
int Triangle::EdgeIndex(const Point* p1, const Point* p2) int Triangle::EdgeIndex(const Point* p1, const Point* p2)
@ -223,6 +220,7 @@ Point* Triangle::PointCW(Point& point)
return points_[1]; return points_[1];
} }
assert(0); assert(0);
return NULL;
} }
// The point counter-clockwise to given point // The point counter-clockwise to given point
@ -236,6 +234,7 @@ Point* Triangle::PointCCW(Point& point)
return points_[0]; return points_[0];
} }
assert(0); assert(0);
return NULL;
} }
// The neighbor clockwise to given point // The neighbor clockwise to given point

View File

@ -765,10 +765,8 @@ Point& Sweep::NextFlipPoint(Point& ep, Point& eq, Triangle& ot, Point& op)
} else if (o2d == CCW) { } else if (o2d == CCW) {
// Left // Left
return *ot.PointCW(op); 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, 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() { Sweep::~Sweep() {
// Clean up memory // Clean up memory
for(int i = 0; i < nodes_.size(); i++) { for(size_t i = 0; i < nodes_.size(); i++) {
delete nodes_[i]; delete nodes_[i];
} }