diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2015-08-06 11:07:13 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2015-08-06 11:07:13 +0300 |
commit | 5b8ed7367a2a9148c215eafa53c7e13b30cd0c36 (patch) | |
tree | 2b191be018cc25daa3c8f172b49be30923ad8ea2 /xs/src/libslic3r | |
parent | 6ac79e3ed6bf903edf45b52ee6fd68c1b0b54a9d (diff) |
Fixed potential hang in PerimeterGenerator.cpp
Diffstat (limited to 'xs/src/libslic3r')
-rw-r--r-- | xs/src/libslic3r/PerimeterGenerator.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xs/src/libslic3r/PerimeterGenerator.cpp b/xs/src/libslic3r/PerimeterGenerator.cpp index f95930e2d..a96848531 100644 --- a/xs/src/libslic3r/PerimeterGenerator.cpp +++ b/xs/src/libslic3r/PerimeterGenerator.cpp @@ -47,7 +47,7 @@ PerimeterGenerator::process() for (Surfaces::const_iterator surface = this->slices->surfaces.begin(); surface != this->slices->surfaces.end(); ++surface) { // detect how many perimeters must be generated for this island - unsigned short loop_number = this->config->perimeters + surface->extra_perimeters; + short loop_number = this->config->perimeters + surface->extra_perimeters; loop_number--; // 0-indexed loops Polygons gaps; @@ -187,7 +187,7 @@ PerimeterGenerator::process() } // if no hole contains this hole, find the contour loop that contains it - for (unsigned short t = loop_number; t >= 0; --t) { + for (short t = loop_number; t >= 0; --t) { for (unsigned short j = 0; j < contours[t].size(); ++j) { PerimeterGeneratorLoop &candidate_parent = contours[t][j]; if (candidate_parent.polygon.contains(loop.polygon.first_point())) { @@ -203,7 +203,7 @@ PerimeterGenerator::process() } // nest contour loops - for (unsigned short d = loop_number; d >= 1; --d) { + for (short d = loop_number; d >= 1; --d) { PerimeterGeneratorLoops &contours_d = contours[d]; // loop through all contours having depth == d @@ -211,7 +211,7 @@ PerimeterGenerator::process() const PerimeterGeneratorLoop &loop = contours_d[i]; // find the contour loop that contains it - for (unsigned short t = d-1; t >= 0; --t) { + for (short t = d-1; t >= 0; --t) { for (unsigned short j = 0; j < contours[t].size(); ++j) { PerimeterGeneratorLoop &candidate_parent = contours[t][j]; if (candidate_parent.polygon.contains(loop.polygon.first_point())) { |