From 77700344920684c199f1068756e3a2eaf47089e4 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Tue, 2 Aug 2022 13:29:30 +0200 Subject: [PATCH] Fix warnings --- src/libslic3r/CutSurface.cpp | 3 +-- src/libslic3r/NSVGUtils.cpp | 1 + src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp | 14 +------------- src/slic3r/GUI/Jobs/CreateFontStyleImagesJob.cpp | 4 ++-- src/slic3r/GUI/Jobs/EmbossJob.cpp | 2 +- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/libslic3r/CutSurface.cpp b/src/libslic3r/CutSurface.cpp index cc45a7d899..dea1a22dde 100644 --- a/src/libslic3r/CutSurface.cpp +++ b/src/libslic3r/CutSurface.cpp @@ -2986,7 +2986,7 @@ std::vector priv::select_patches( if (d.patch_index == std::numeric_limits::max()) continue; if (result[d.patch_index]) continue; // Add all connected patches - // This is way to add patche without source shape point + // This is way to add patche(from other models) without source shape point // 1. Patches inside of shape // 2. Patches crossing outline between shape points @@ -3008,7 +3008,6 @@ std::vector priv::select_patches( if (patch.shape_id != patch2.shape_id) continue; BoundingBoxf3 bb2 = extend_bb(patch2.bb); if (!bb.intersects(bb2)) continue; - if (!in_distances[patch_index2]) { // TODO: check that really exist shared outline between patches diff --git a/src/libslic3r/NSVGUtils.cpp b/src/libslic3r/NSVGUtils.cpp index c5afaac6a6..3f2b766db7 100644 --- a/src/libslic3r/NSVGUtils.cpp +++ b/src/libslic3r/NSVGUtils.cpp @@ -1,4 +1,5 @@ #include "NSVGUtils.hpp" +#include "ClipperUtils.hpp" using namespace Slic3r; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index b1012b329c..80dfdd1e92 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -1607,7 +1607,6 @@ void GLGizmoEmboss::draw_style_save_as_popup() { void GLGizmoEmboss::draw_style_add_button() { - bool start_save_as = false; bool only_add_style = !m_style_manager.exist_stored_style(); bool can_add = true; if (only_add_style && @@ -1726,7 +1725,7 @@ void GLGizmoEmboss::draw_delete_style_button() { void GLGizmoEmboss::discard_changes_in_style() { - assert(m_style_manager.exist_stored_style()); + if (!m_style_manager.exist_stored_style()) return; FontItem &font_item = m_style_manager.get_font_item(); const FontItem* stored_fi = m_style_manager.get_stored_font_item(); @@ -1852,17 +1851,6 @@ void GLGizmoEmboss::draw_style_list() { ImGui::SameLine(); draw_style_rename_button(); - // Is style changed against stored one - FontItem &font_item = m_style_manager.get_font_item(); - - const FontItem *stored_fi = nullptr; - if (m_style_manager.exist_stored_style()) - stored_fi = m_style_manager.get_stored_font_item(); - - bool is_stored = stored_fi != nullptr; - bool is_changed = (is_stored) ? !(*stored_fi == font_item) : true; - // TODO: check order of font items in list to allowe save actual order - ImGui::SameLine(); draw_style_save_button(); diff --git a/src/slic3r/GUI/Jobs/CreateFontStyleImagesJob.cpp b/src/slic3r/GUI/Jobs/CreateFontStyleImagesJob.cpp index 5ae257f979..e2a446732d 100644 --- a/src/slic3r/GUI/Jobs/CreateFontStyleImagesJob.cpp +++ b/src/slic3r/GUI/Jobs/CreateFontStyleImagesJob.cpp @@ -108,8 +108,8 @@ void CreateFontStyleImagesJob::process(Ctl &ctl) // bigger value create darker image unsigned char gray_level = 5; size_t size {static_cast(w*h)}; - assert((offset.x() + width) <= w); - assert((offset.y() + height) <= h); + assert((offset.x() + width) <= (size_t)w); + assert((offset.y() + height) <= (size_t)h); const unsigned char *ptr2 = (const unsigned char *) ptr; for (size_t x = 0; x < width; ++x) for (size_t y = 0; y < height; ++y) { diff --git a/src/slic3r/GUI/Jobs/EmbossJob.cpp b/src/slic3r/GUI/Jobs/EmbossJob.cpp index 7b5575e82a..d7ccd66e44 100644 --- a/src/slic3r/GUI/Jobs/EmbossJob.cpp +++ b/src/slic3r/GUI/Jobs/EmbossJob.cpp @@ -480,7 +480,7 @@ bool priv::check(const EmbossDataCreateVolume &input, bool is_main_thread) { assert(input.object_idx >= 0); res &= input.object_idx >= 0; if (is_main_thread) - assert(input.object_idx < wxGetApp().model().objects.size()); + assert((size_t)input.object_idx < wxGetApp().model().objects.size()); assert(input.screen_coor.x() >= 0.); res &= input.screen_coor.x() >= 0.; assert(input.screen_coor.y() >= 0.);