From d4efb54284f0781aee40cb660712fa15256676df Mon Sep 17 00:00:00 2001 From: Andrew Plumb Date: Mon, 13 Feb 2012 11:23:18 -0500 Subject: Cleaned up unsigned int compiler warnings diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc index c1bdea4..7afb359 100644 --- a/src/PolySetCGALEvaluator.cc +++ b/src/PolySetCGALEvaluator.cc @@ -116,7 +116,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node) double z = ps3->polygons[i][j][2]; if (z != 0) goto next_ps3_polygon_cut_mode; - if (conversion_grid.align(x, y) == i+1) + if ((unsigned) conversion_grid.align(x, y) == i+1) goto next_ps3_polygon_cut_mode; conversion_grid.data(x, y) = i+1; } diff --git a/src/dxfdata.cc b/src/dxfdata.cc index 52493ac..65996d9 100644 --- a/src/dxfdata.cc +++ b/src/dxfdata.cc @@ -526,9 +526,9 @@ void DxfData::fixup_path_direction() } } // rotate points if the path is in non-standard rotation - int b = min_x_point; - int a = b == 0 ? this->paths[i].indices.size() - 2 : b - 1; - int c = b == this->paths[i].indices.size() - 1 ? 1 : b + 1; + unsigned int b = min_x_point; + unsigned int a = b == 0 ? this->paths[i].indices.size() - 2 : b - 1; + unsigned int c = b == this->paths[i].indices.size() - 1 ? 1 : b + 1; double ax = this->points[this->paths[i].indices[a]][0] - this->points[this->paths[i].indices[b]][0]; double ay = this->points[this->paths[i].indices[a]][1] - this->points[this->paths[i].indices[b]][1]; double cx = this->points[this->paths[i].indices[c]][0] - this->points[this->paths[i].indices[b]][0]; diff --git a/src/expr.cc b/src/expr.cc index 66a0d11..671553c 100644 --- a/src/expr.cc +++ b/src/expr.cc @@ -86,8 +86,8 @@ Value Expression::evaluate(const Context *context) const return *v1.vec[i]; } if (v1.type == Value::STRING && v2.type == Value::NUMBER) { - int i = int(v2.num); - if (i >= 0 && i < v1.text.size()) + unsigned int i = int(v2.num); + if (i < v1.text.size()) return Value(v1.text.substr(i, 1)); } return Value(); diff --git a/src/primitives.cc b/src/primitives.cc index feaa1a4..ce52550 100644 --- a/src/primitives.cc +++ b/src/primitives.cc @@ -530,7 +530,7 @@ sphere_next_r2: { dd.paths.push_back(DxfData::Path()); for (size_t j=0; jpaths.vec[i]->vec.size(); j++) { - int idx = this->paths.vec[i]->vec[j]->num; + unsigned int idx = this->paths.vec[i]->vec[j]->num; if (idx < dd.points.size()) { dd.paths.back().indices.push_back(idx); } -- cgit v0.10.1