Solve some compilation warnings in libslic3r

This commit is contained in:
Victor Lamoine 2019-05-16 09:58:27 +02:00 committed by Joseph Lenox
parent bd575f15c5
commit 6bb8a750bc
4 changed files with 2 additions and 7 deletions

View File

@ -322,7 +322,6 @@ ExPolygon::medial_axis(const ExPolygon &bounds, double max_width, double min_wid
// Loop through all returned polylines in order to extend their endpoints to the // Loop through all returned polylines in order to extend their endpoints to the
// expolygon boundaries // expolygon boundaries
bool removed = false;
for (size_t i = 0; i < pp.size(); ++i) { for (size_t i = 0; i < pp.size(); ++i) {
ThickPolyline& polyline = pp[i]; ThickPolyline& polyline = pp[i];
@ -422,7 +421,6 @@ ExPolygon::medial_axis(const ExPolygon &bounds, double max_width, double min_wid
&& polyline.length() < max_w * 2) { && polyline.length() < max_w * 2) {
pp.erase(pp.begin() + i); pp.erase(pp.begin() + i);
--i; --i;
removed = true;
continue; continue;
} }

View File

@ -139,14 +139,11 @@ static inline Point hilbert_n_to_xy(const size_t n)
} }
} }
int state = (ndigits & 1) ? 4 : 0; int state = (ndigits & 1) ? 4 : 0;
int dirstate = (ndigits & 1) ? 0 : 4;
coord_t x = 0; coord_t x = 0;
coord_t y = 0; coord_t y = 0;
for (int i = (int)ndigits - 1; i >= 0; -- i) { for (int i = (int)ndigits - 1; i >= 0; -- i) {
int digit = (n >> (i * 2)) & 3; int digit = (n >> (i * 2)) & 3;
state += digit; state += digit;
if (digit != 3)
dirstate = state; // lowest non-3 digit
x |= digit_to_x[state] << i; x |= digit_to_x[state] << i;
y |= digit_to_y[state] << i; y |= digit_to_y[state] << i;
state = next_state[state]; state = next_state[state];

View File

@ -543,7 +543,7 @@ AMF::write(const Model& model, std::string output_file)
volume->mesh.require_shared_vertices(); volume->mesh.require_shared_vertices();
vertices_offsets.push_back(num_vertices); vertices_offsets.push_back(num_vertices);
const auto &stl = volume->mesh.stl; const auto &stl = volume->mesh.stl;
for (size_t i = 0; i < stl.stats.shared_vertices; ++i) for (size_t i = 0; i < static_cast<size_t>(stl.stats.shared_vertices); ++i)
// Subtract origin_translation in order to restore the coordinates of the parts // Subtract origin_translation in order to restore the coordinates of the parts
// before they were imported. Otherwise, when this AMF file is reimported parts // before they were imported. Otherwise, when this AMF file is reimported parts
// will be placed in the plater correctly, but we will have lost origin_translation // will be placed in the plater correctly, but we will have lost origin_translation

View File

@ -213,7 +213,7 @@ SurfaceCollection::keep_types(const SurfaceType *types, size_t ntypes)
size_t j = 0; size_t j = 0;
for (size_t i = 0; i < surfaces.size(); ++ i) { for (size_t i = 0; i < surfaces.size(); ++ i) {
bool keep = false; bool keep = false;
for (int k = 0; k < ntypes; ++ k) { for (size_t k = 0; k < ntypes; ++ k) {
if (surfaces[i].surface_type == types[k]) { if (surfaces[i].surface_type == types[k]) {
keep = true; keep = true;
break; break;