From 60e13272bdb06351aab8dff78672e3be7d43e221 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Thu, 25 May 2023 18:22:34 +0200 Subject: [PATCH] Fixed some more compilation warnings. --- src/libslic3r/Fill/FillEnsuring.cpp | 14 +++++++------- src/libslic3r/Support/OrganicSupport.cpp | 4 ++-- src/slic3r/GUI/GLCanvas3D.cpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoCut.cpp | 4 ++-- src/slic3r/GUI/NotificationManager.cpp | 1 - src/slic3r/GUI/Plater.cpp | 1 - src/slic3r/GUI/Tab.cpp | 2 +- src/slic3r/Utils/Mainsail.cpp | 2 +- src/slic3r/Utils/PresetUpdater.cpp | 2 +- 9 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/libslic3r/Fill/FillEnsuring.cpp b/src/libslic3r/Fill/FillEnsuring.cpp index 4838ad8d2..18911081f 100644 --- a/src/libslic3r/Fill/FillEnsuring.cpp +++ b/src/libslic3r/Fill/FillEnsuring.cpp @@ -106,15 +106,15 @@ ThickPolylines make_fill_polylines( coord_t length_filter = scale_(4); size_t skips_allowed = 2; size_t min_removal_conut = 5; - for (int section_idx = 0; section_idx < polygon_sections.size(); section_idx++) { - for (int line_idx = 0; line_idx < polygon_sections[section_idx].size(); line_idx++) { + for (int section_idx = 0; section_idx < int(polygon_sections.size()); ++ section_idx) { + for (int line_idx = 0; line_idx < int(polygon_sections[section_idx].size()); ++ line_idx) { if (const Line &line = polygon_sections[section_idx][line_idx]; line.a != line.b && line.length() < length_filter) { std::set> to_remove{{section_idx, line_idx}}; std::vector to_visit{{section_idx, line_idx}}; bool initial_touches_long_lines = false; if (section_idx > 0) { - for (int prev_line_idx = 0; prev_line_idx < polygon_sections[section_idx - 1].size(); prev_line_idx++) { + for (int prev_line_idx = 0; prev_line_idx < int(polygon_sections[section_idx - 1].size()); ++ prev_line_idx) { if (const Line &nl = polygon_sections[section_idx - 1][prev_line_idx]; nl.a != nl.b && segments_overlap(line.a.y(), line.b.y(), nl.a.y(), nl.b.y())) { initial_touches_long_lines = true; @@ -127,7 +127,7 @@ ThickPolylines make_fill_polylines( const Line &curr_l = polygon_sections[curr.section_idx][curr.line_idx]; if (curr.neighbours_explored) { bool is_valid_for_removal = (curr_l.length() < length_filter) && - ((int(to_remove.size()) - curr.skips_taken > min_removal_conut) || + ((int(to_remove.size()) - curr.skips_taken > int(min_removal_conut)) || (curr.neighbours.empty() && !initial_touches_long_lines)); if (!is_valid_for_removal) { for (const auto &n : curr.neighbours) { @@ -144,9 +144,9 @@ ThickPolylines make_fill_polylines( } else { to_visit.back().neighbours_explored = true; int curr_index = to_visit.size() - 1; - bool can_use_skip = curr_l.length() <= length_filter && curr.skips_taken < skips_allowed; - if (curr.section_idx + 1 < polygon_sections.size()) { - for (int lidx = 0; lidx < polygon_sections[curr.section_idx + 1].size(); lidx++) { + bool can_use_skip = curr_l.length() <= length_filter && curr.skips_taken < int(skips_allowed); + if (curr.section_idx + 1 < int(polygon_sections.size())) { + for (int lidx = 0; lidx < int(polygon_sections[curr.section_idx + 1].size()); ++ lidx) { if (const Line &nl = polygon_sections[curr.section_idx + 1][lidx]; nl.a != nl.b && segments_overlap(curr_l.a.y(), curr_l.b.y(), nl.a.y(), nl.b.y()) && (nl.length() < length_filter || can_use_skip)) { diff --git a/src/libslic3r/Support/OrganicSupport.cpp b/src/libslic3r/Support/OrganicSupport.cpp index e3c09d0cc..f5d66168d 100644 --- a/src/libslic3r/Support/OrganicSupport.cpp +++ b/src/libslic3r/Support/OrganicSupport.cpp @@ -819,7 +819,7 @@ static void organic_smooth_branches_avoid_collisions( collision_sphere.prev_position = collision_sphere.position; std::atomic num_moved{ 0 }; tbb::parallel_for(tbb::blocked_range(0, collision_spheres.size()), - [&collision_spheres, &layer_collision_cache, &slicing_params, &config, &move_bounds, &linear_data_layers, &num_moved, &throw_on_cancel](const tbb::blocked_range range) { + [&collision_spheres, &layer_collision_cache, &slicing_params, &config, &linear_data_layers, &num_moved, &throw_on_cancel](const tbb::blocked_range range) { for (size_t collision_sphere_id = range.begin(); collision_sphere_id < range.end(); ++ collision_sphere_id) if (CollisionSphere &collision_sphere = collision_spheres[collision_sphere_id]; ! collision_sphere.locked) { // Calculate collision of multiple 2D layers against a collision sphere. @@ -1187,7 +1187,7 @@ void organic_draw_branches( mesh_slicing_params.mode = MeshSlicingParams::SlicingMode::Positive; tbb::parallel_for(tbb::blocked_range(0, trees.size(), 1), - [&trees, &volumes, &config, &slicing_params, &move_bounds, &interface_placer, &mesh_slicing_params, &throw_on_cancel](const tbb::blocked_range &range) { + [&trees, &volumes, &config, &slicing_params, &move_bounds, &mesh_slicing_params, &throw_on_cancel](const tbb::blocked_range &range) { indexed_triangle_set partial_mesh; std::vector slice_z; std::vector bottom_contacts; diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 23b7931d1..fa7c55213 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1303,7 +1303,7 @@ void GLCanvas3D::SLAView::render_switch_button() imgui.begin(std::string("SLAViewSwitch"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDecoration); const float icon_size = 1.5 * ImGui::GetTextLineHeight(); if (imgui.draw_radio_button(_u8L("SLA view"), 1.5f * icon_size, true, - [this, &imgui, sel_instance](ImGuiWindow& window, const ImVec2& pos, float size) { + [&imgui, sel_instance](ImGuiWindow& window, const ImVec2& pos, float size) { const wchar_t icon_id = (sel_instance->second == ESLAViewType::Original) ? ImGui::SlaViewProcessed : ImGui::SlaViewOriginal; imgui.draw_icon(window, pos, size, icon_id); })) { diff --git a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp index 9f919af72..7478f5f66 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp @@ -502,7 +502,7 @@ bool GLGizmoCut3D::render_slider_double_input(const std::string& label, float& v constexpr float UndefMinVal = -0.1f; const float f_mm_to_in = static_cast(ObjectManipulation::mm_to_in); - auto render_slider = [this, UndefMinVal, f_mm_to_in] + auto render_slider = [this, f_mm_to_in] (const std::string& label, float& val, float def_val, float max_val, const wxString& tooltip) { float min_val = val < 0.f ? UndefMinVal : def_val; float value = val; @@ -1575,7 +1575,7 @@ void GLGizmoCut3D::PartSelection::toggle_selection(const Vec2d& mouse_pos) std::vector> hits_id_and_sqdist; for (size_t id=0; idvolumes[id]->get_offset(); +// const Vec3d volume_offset = model_object()->volumes[id]->get_offset(); Transform3d tr = translation_transform(model_object()->instances[m_instance_idx]->get_offset()) * translation_transform(model_object()->volumes[id]->get_offset()); if (m_parts[id].raycaster.unproject_on_mesh(mouse_pos, tr, camera, pos, normal)) { hits_id_and_sqdist.emplace_back(id, (camera_pos - tr*(pos.cast())).squaredNorm()); diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index 3f7e58b7e..c4e95d702 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -2218,7 +2218,6 @@ void NotificationManager::push_version_notification(NotificationType type, Notif for (std::unique_ptr& notification : m_pop_notifications) { // NoNewReleaseAvailable must not show if alfa / beta is on. - NotificationType nttype = notification->get_type(); if (type == NotificationType::NoNewReleaseAvailable && (notification->get_type() == NotificationType::NewAlphaAvailable || notification->get_type() == NotificationType::NewBetaAvailable)) { diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6a20f30bb..9574f6ea6 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -7041,7 +7041,6 @@ void Plater::force_filament_colors_update() if (extruders_filaments.size() > 1 && p->config->option("filament_colour")->values.size() == extruders_filaments.size()) { - const PresetCollection& filaments = wxGetApp().preset_bundle->filaments; std::vector filament_colors; filament_colors.reserve(extruders_filaments.size()); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 6d0c17fc0..51b01a5e5 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2983,7 +2983,7 @@ void TabPrinter::build_extruder_pages(size_t n_before_extruders) update(); }); - auto has_changes = [this, extruder_idx]() { + auto has_changes = [this]() { auto dirty_options = m_presets->current_dirty_options(true); #if 1 dirty_options.erase(std::remove_if(dirty_options.begin(), dirty_options.end(), diff --git a/src/slic3r/Utils/Mainsail.cpp b/src/slic3r/Utils/Mainsail.cpp index 84d329a22..303d754e3 100644 --- a/src/slic3r/Utils/Mainsail.cpp +++ b/src/slic3r/Utils/Mainsail.cpp @@ -104,7 +104,7 @@ bool Mainsail::test(wxString& msg) const res = false; msg = format_error(body, error, status); }) - .on_complete([&, this](std::string body, unsigned) { + .on_complete([&](std::string body, unsigned) { BOOST_LOG_TRIVIAL(debug) << boost::format("%1%: Got server/info: %2%") % name % body; try { diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index 995891db9..dfb72259f 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -49,7 +49,7 @@ using Slic3r::GUI::Config::SnapshotDB; namespace Slic3r { -static const char *INDEX_FILENAME = "index.idx"; +//static const char *INDEX_FILENAME = "index.idx"; static const char *TMP_EXTENSION = ".download"; namespace {