diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index 698382c6f..845e982a9 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -676,7 +676,7 @@ namespace Slic3r { // select the geometry associated with the original model object const Geometry* geometry = nullptr; for (const IdToModelObjectMap::value_type& object : m_objects) { - if (static_cast(object.second) == i) { + if (object.second == int(i)) { IdToGeometryMap::const_iterator obj_geometry = m_geometries.find(object.first); if (obj_geometry == m_geometries.end()) { add_error("Unable to find object geometry"); @@ -1875,7 +1875,6 @@ namespace Slic3r { } else { std::cout << "non-single instance !!!\n"; - int a = 0; } } #endif // ENABLE_RELOAD_FROM_DISK_FOR_3MF diff --git a/src/libslic3r/SupportMaterial.cpp b/src/libslic3r/SupportMaterial.cpp index 1695075c8..33e74254e 100644 --- a/src/libslic3r/SupportMaterial.cpp +++ b/src/libslic3r/SupportMaterial.cpp @@ -1683,7 +1683,7 @@ size_t idx_higher_or_equal(IT begin, IT end, size_t idx, FN_HIGHER_EQUAL fn_high (fn_higher_equal(begin[idx_high]) ? idx_high : size); } else { // For the other layers of this batch of layers, search incrementally, which is cheaper than the binary search. - while (idx < size && ! fn_higher_equal(begin[idx])) + while (int(idx) < size && ! fn_higher_equal(begin[idx])) ++ idx; } return idx; diff --git a/src/libslic3r/VoronoiOffset.cpp b/src/libslic3r/VoronoiOffset.cpp index 7ad0f7af4..2108388f5 100644 --- a/src/libslic3r/VoronoiOffset.cpp +++ b/src/libslic3r/VoronoiOffset.cpp @@ -666,19 +666,21 @@ void annotate_inside_outside(VD &vd, const Lines &lines) // Set a VertexCategory, verify validity of the operation. auto annotate_vertex = [](const VD::vertex_type *vertex, VertexCategory new_vertex_category) { +#ifndef NDEBUG VertexCategory vc = vertex_category(vertex); assert(vc == VertexCategory::Unknown || vc == new_vertex_category); assert(new_vertex_category == VertexCategory::Inside || new_vertex_category == VertexCategory::Outside || new_vertex_category == VertexCategory::OnContour); +#endif // NDEBUG set_vertex_category(const_cast(vertex), new_vertex_category); }; // Set an EdgeCategory, verify validity of the operation. auto annotate_edge = [](const VD::edge_type *edge, EdgeCategory new_edge_category) { +#ifndef NDEBUG EdgeCategory ec = edge_category(edge); assert(ec == EdgeCategory::Unknown || ec == new_edge_category); -#ifndef NDEBUG switch (new_edge_category) { case EdgeCategory::PointsInside: assert(edge->vertex0() != nullptr); @@ -693,7 +695,6 @@ void annotate_inside_outside(VD &vd, const Lines &lines) default: assert(false); } - #endif // NDEBUG set_edge_category(const_cast(edge), new_edge_category); }; @@ -760,10 +761,12 @@ void annotate_inside_outside(VD &vd, const Lines &lines) // Only one of the two vertices may lie on input contour. const VD::vertex_type *v0 = edge.vertex0(); const VD::vertex_type *v1 = edge.vertex1(); +#ifndef NDEBUG VertexCategory v0_category = vertex_category(v0); VertexCategory v1_category = vertex_category(v1); assert(v0_category != VertexCategory::OnContour || v1_category != VertexCategory::OnContour); assert(! (on_contour(v0) && on_contour(v1))); +#endif // NDEBUG if (on_contour(v0)) annotate_vertex(v0, VertexCategory::OnContour); else { diff --git a/tests/libslic3r/test_voronoi.cpp b/tests/libslic3r/test_voronoi.cpp index 189dde7ce..bbcea7301 100644 --- a/tests/libslic3r/test_voronoi.cpp +++ b/tests/libslic3r/test_voronoi.cpp @@ -176,13 +176,13 @@ TEST_CASE("Voronoi missing edges - Alessandro gapfill 12707", "[Voronoi]") std::mt19937 gen; std::uniform_int_distribution dist(-100, 100); - for (Point &p : poly.points) { #if 0 + for (Point &p : poly.points) { // Wiggle the points a bit to find out whether this fixes the voronoi diagram for this particular polygon. p.x() = (p.x() += dist(gen)); p.y() = (p.y() += dist(gen)); -#endif } +#endif REQUIRE(intersecting_edges({ poly }).empty()); @@ -267,7 +267,7 @@ TEST_CASE("Voronoi weirdness", "[Voronoi]") }; // coord_t shift = 35058881; - coord_t shift_ok = 17000000; +// coord_t shift_ok = 17000000; coord_t shift = 35058881; Polygon poly { // <-4, 0>: bug