From 766c6e004145325bcc7a6addfce27842ee9504de Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Thu, 13 Mar 2025 17:01:52 +0800 Subject: [PATCH] FIX: remove some warnings jira: [none] Change-Id: I0e74b7316d0efe38c65e1f695b2a09eb09103552 --- src/libslic3r/GCode/ConflictChecker.hpp | 3 ++- src/libslic3r/PresetBundle.cpp | 10 +++++----- src/libslic3r/Print.cpp | 8 ++++---- src/libslic3r/PrintConfig.cpp | 2 +- src/slic3r/GUI/DeviceManager.cpp | 2 +- src/slic3r/GUI/DeviceManager.hpp | 2 +- src/slic3r/GUI/Jobs/BindJob.cpp | 6 +++--- src/slic3r/GUI/Jobs/PrintJob.cpp | 10 +++++----- src/slic3r/GUI/Jobs/RotoptimizeJob.cpp | 2 +- src/slic3r/GUI/Jobs/SendJob.cpp | 7 ++----- src/slic3r/GUI/Jobs/UpgradeNetworkJob.cpp | 4 ++-- src/slic3r/GUI/ModelMall.cpp | 12 ++++++------ src/slic3r/GUI/Monitor.cpp | 4 ++-- src/slic3r/GUI/MonitorBasePanel.cpp | 1 - src/slic3r/GUI/Project.cpp | 2 +- src/slic3r/GUI/Search.cpp | 2 +- src/slic3r/GUI/SelectMachinePop.cpp | 8 +++++++- src/slic3r/GUI/SendSystemInfoDialog.cpp | 2 +- src/slic3r/GUI/WebDownPluginDlg.cpp | 8 ++++---- src/slic3r/GUI/Widgets/AMSItem.cpp | 2 +- src/slic3r/GUI/Widgets/DropDown.cpp | 2 +- src/slic3r/GUI/Widgets/StateColor.cpp | 2 -- src/slic3r/GUI/Widgets/StateHandler.cpp | 4 ++-- src/slic3r/GUI/Widgets/WebView.cpp | 2 +- 24 files changed, 54 insertions(+), 53 deletions(-) diff --git a/src/libslic3r/GCode/ConflictChecker.hpp b/src/libslic3r/GCode/ConflictChecker.hpp index eac10aac4..30a83676e 100644 --- a/src/libslic3r/GCode/ConflictChecker.hpp +++ b/src/libslic3r/GCode/ConflictChecker.hpp @@ -33,8 +33,9 @@ struct ExtrusionLayer enum class ExtrusionLayersType { INFILL, PERIMETERS, SUPPORT, WIPE_TOWER }; -struct ExtrusionLayers : public std::vector +class ExtrusionLayers : public std::vector { +public: ExtrusionLayersType type; }; diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index d67392dbb..f65ca27bf 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -1791,7 +1791,7 @@ void PresetBundle::export_selections(AppConfig &config) // BBS void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) { - int old_filament_count = this->filament_presets.size(); + unsigned old_filament_count = this->filament_presets.size(); if (n > old_filament_count && old_filament_count != 0) filament_presets.resize(n, filament_presets.back()); else { @@ -1807,7 +1807,7 @@ void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) //BBS set new filament color to new_color if (old_filament_count < n) { if (!new_color.empty()) { - for (int i = old_filament_count; i < n; i++) { + for (unsigned i = old_filament_count; i < n; i++) { filament_color->values[i] = new_color; } } @@ -1818,7 +1818,7 @@ void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) void PresetBundle::update_num_filaments(unsigned int to_del_flament_id) { - int old_filament_count = this->filament_presets.size(); + unsigned old_filament_count = this->filament_presets.size(); assert(to_del_flament_id < old_filament_count); filament_presets.erase(filament_presets.begin() + to_del_flament_id); @@ -2291,7 +2291,7 @@ Preset *PresetBundle::get_similar_printer_preset(std::string printer_model, std: //BBS: check whether this is the only edited filament bool PresetBundle::is_the_only_edited_filament(unsigned int filament_index) { - int n = this->filament_presets.size(); + unsigned n = this->filament_presets.size(); if (filament_index >= n) return false; @@ -2300,7 +2300,7 @@ bool PresetBundle::is_the_only_edited_filament(unsigned int filament_index) if (edited_preset.name != name) return false; - int index = 0; + unsigned index = 0; while (index < n) { if (index == filament_index) { diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 1de4bc243..77f2903d8 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -3456,7 +3456,7 @@ static void convert_layer_region_from_json(const json& j, LayerRegion& layer_reg if (!ret) { BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":error parsing thin_fills found at layer %1%, print_z %2%") %layer_region.layer()->id() %layer_region.layer()->print_z; char error_buf[1024]; - ::sprintf(error_buf, "Error while parsing thin_fills at layer %d, print_z %f", layer_region.layer()->id(), layer_region.layer()->print_z); + ::sprintf(error_buf, "Error while parsing thin_fills at layer %zu, print_z %f", layer_region.layer()->id(), layer_region.layer()->print_z); throw Slic3r::FileIOError(error_buf); } } @@ -3511,7 +3511,7 @@ static void convert_layer_region_from_json(const json& j, LayerRegion& layer_reg if (!ret) { BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(": error parsing perimeters found at layer %1%, print_z %2%") %layer_region.layer()->id() %layer_region.layer()->print_z; char error_buf[1024]; - ::sprintf(error_buf, "Error while parsing perimeters at layer %d, print_z %f", layer_region.layer()->id(), layer_region.layer()->print_z); + ::sprintf(error_buf, "Error while parsing perimeters at layer %zu, print_z %f", layer_region.layer()->id(), layer_region.layer()->print_z); throw Slic3r::FileIOError(error_buf); } } @@ -3526,7 +3526,7 @@ static void convert_layer_region_from_json(const json& j, LayerRegion& layer_reg if (!ret) { BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(": error parsing fills found at layer %1%, print_z %2%") %layer_region.layer()->id() %layer_region.layer()->print_z; char error_buf[1024]; - ::sprintf(error_buf, "Error while parsing fills at layer %d, print_z %f", layer_region.layer()->id(), layer_region.layer()->print_z); + ::sprintf(error_buf, "Error while parsing fills at layer %zu, print_z %f", layer_region.layer()->id(), layer_region.layer()->print_z); throw Slic3r::FileIOError(error_buf); } } @@ -3606,7 +3606,7 @@ void extract_support_layer(const json& support_layer_json, SupportLayer& support if (!ret) { BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(": error parsing fills found at support_layer %1%, print_z %2%")%support_layer.id() %support_layer.print_z; char error_buf[1024]; - ::sprintf(error_buf, "Error while parsing fills at support_layer %d, print_z %f", support_layer.id(), support_layer.print_z); + ::sprintf(error_buf, "Error while parsing fills at support_layer %zu, print_z %f", support_layer.id(), support_layer.print_z); throw Slic3r::FileIOError(error_buf); } } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 04b904f8b..6b5e089b3 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6568,7 +6568,7 @@ std::vector DynamicPrintConfig::update_values_to_printer_extruders(DynamicP auto opt_nozzle_volume_type = dynamic_cast(printer_config.option("nozzle_volume_type")); - if (extruder_id > 0 && extruder_id <= extruder_count) { + if (extruder_id > 0 && extruder_id <= static_cast (extruder_count)) { variant_index.resize(1); ExtruderType extruder_type = (ExtruderType)(opt_extruder_type->get_at(extruder_id - 1)); NozzleVolumeType nozzle_volume_type = (NozzleVolumeType)(opt_nozzle_volume_type->get_at(extruder_id - 1)); diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index ea98a96f2..94ab2dc41 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -5765,7 +5765,7 @@ NozzleFlowType MachineObject::get_nozzle_flow_type(int extruder_id) const return NozzleFlowType::NONE_FLOWTYPE; } -const Extder& MachineObject::get_current_extruder() const +Extder MachineObject::get_current_extruder() const { if (m_extder_data.extders.size() <= m_extder_data.current_extder_id) { diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index d1aa7e0d1..e70d1d553 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -773,7 +773,7 @@ public: /*extruder*/ [[nodiscard]] bool is_nozzle_flow_type_supported() const { return is_enable_np; }; [[nodiscard]] NozzleFlowType get_nozzle_flow_type(int extruder_id) const; - [[nodiscard]] const Extder& get_current_extruder() const; + [[nodiscard]] Extder get_current_extruder() const; //new fan data AirDuctData m_air_duct_data; diff --git a/src/slic3r/GUI/Jobs/BindJob.cpp b/src/slic3r/GUI/Jobs/BindJob.cpp index f60900414..e88d870f8 100644 --- a/src/slic3r/GUI/Jobs/BindJob.cpp +++ b/src/slic3r/GUI/Jobs/BindJob.cpp @@ -32,7 +32,7 @@ void BindJob::on_exception(const std::exception_ptr &eptr) try { if (eptr) std::rethrow_exception(eptr); - } catch (std::exception &e) { + } catch (std::exception &/*e*/) { PlaterJob::on_exception(eptr); } } @@ -67,7 +67,7 @@ void BindJob::process() wxDateTime::TimeZone tz(wxDateTime::Local); long offset = tz.GetOffset(); std::string timezone = get_timezone_utc_hm(offset); - + m_agent->track_update_property("ssdp_version", m_ssdp_version, "string"); int result = m_agent->bind(m_dev_ip, m_dev_id, m_sec_link, timezone, m_improved, [this, &curr_percent, &msg, &result_code, &result_info](int stage, int code, std::string info) { @@ -123,7 +123,7 @@ void BindJob::process() ; } } - + post_fail_event(result_code, result_info); return; } diff --git a/src/slic3r/GUI/Jobs/PrintJob.cpp b/src/slic3r/GUI/Jobs/PrintJob.cpp index cc7473fa6..69b0b207b 100644 --- a/src/slic3r/GUI/Jobs/PrintJob.cpp +++ b/src/slic3r/GUI/Jobs/PrintJob.cpp @@ -60,7 +60,7 @@ void PrintJob::on_exception(const std::exception_ptr &eptr) try { if (eptr) std::rethrow_exception(eptr); - } catch (std::exception &e) { + } catch (std::exception &/*e*/) { PlaterJob::on_exception(eptr); } } @@ -113,9 +113,9 @@ wxString PrintJob::get_http_error_msg(unsigned int status, std::string body) if (!j["message"].is_null()) message = j["message"].get(); } - switch (status) { - ; - } + //switch (status) { + // ; + //} } catch (...) { ; @@ -157,7 +157,7 @@ void PrintJob::process() } int result = -1; - unsigned int http_code; + //unsigned int http_code; std::string http_body; int total_plate_num = plate_data.plate_count; diff --git a/src/slic3r/GUI/Jobs/RotoptimizeJob.cpp b/src/slic3r/GUI/Jobs/RotoptimizeJob.cpp index 8cb5dc6c3..edf72bfb0 100644 --- a/src/slic3r/GUI/Jobs/RotoptimizeJob.cpp +++ b/src/slic3r/GUI/Jobs/RotoptimizeJob.cpp @@ -114,7 +114,7 @@ void RotoptimizeJob::finalize() if (!was_canceled()) m_plater->update(); - + Job::finalize(); } diff --git a/src/slic3r/GUI/Jobs/SendJob.cpp b/src/slic3r/GUI/Jobs/SendJob.cpp index a8ee0f6ed..1c1658db6 100644 --- a/src/slic3r/GUI/Jobs/SendJob.cpp +++ b/src/slic3r/GUI/Jobs/SendJob.cpp @@ -50,7 +50,7 @@ void SendJob::on_exception(const std::exception_ptr &eptr) try { if (eptr) std::rethrow_exception(eptr); - } catch (std::exception &e) { + } catch (std::exception &/*e*/) { PlaterJob::on_exception(eptr); } } @@ -76,9 +76,6 @@ wxString SendJob::get_http_error_msg(unsigned int status, std::string body) if (!j["message"].is_null()) message = j["message"].get(); } - switch (status) { - ; - } } catch (...) { ; @@ -120,7 +117,7 @@ void SendJob::process() NetworkAgent* m_agent = wxGetApp().getAgent(); AppConfig* config = wxGetApp().app_config; int result = -1; - unsigned int http_code; + //unsigned int http_code; std::string http_body; diff --git a/src/slic3r/GUI/Jobs/UpgradeNetworkJob.cpp b/src/slic3r/GUI/Jobs/UpgradeNetworkJob.cpp index 000edf854..91330e3f2 100644 --- a/src/slic3r/GUI/Jobs/UpgradeNetworkJob.cpp +++ b/src/slic3r/GUI/Jobs/UpgradeNetworkJob.cpp @@ -25,7 +25,7 @@ void UpgradeNetworkJob::on_exception(const std::exception_ptr &eptr) try { if (eptr) std::rethrow_exception(eptr); - } catch (std::exception &e) { + } catch (std::exception &/*e*/) { UpgradeNetworkJob::on_exception(eptr); } } @@ -68,7 +68,7 @@ void UpgradeNetworkJob::process() return was_canceled(); }; int curr_percent = 0; - result = wxGetApp().download_plugin(name, package_name, + result = wxGetApp().download_plugin(name, package_name, [this, &curr_percent](int state, int percent, bool &cancel) { if (state == InstallStatusNormal) { update_status(percent, _L("Downloading")); diff --git a/src/slic3r/GUI/ModelMall.cpp b/src/slic3r/GUI/ModelMall.cpp index 8fabd073e..6cc75552c 100644 --- a/src/slic3r/GUI/ModelMall.cpp +++ b/src/slic3r/GUI/ModelMall.cpp @@ -73,14 +73,14 @@ namespace GUI { m_control_back->SetToolTip(_L("Click to return (Alt + Left Arrow)")); m_control_forward->SetToolTip(_L("Click to continue (Alt + Right Arrow)")); #endif - + m_control_refresh->SetToolTip(_L("Refresh")); /* auto m_textCtrl1 = new wxTextCtrl(m_web_control_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(600, 30), 0); auto m_button1 = new wxButton(m_web_control_panel, wxID_ANY, wxT("GO"), wxDefaultPosition, wxDefaultSize, 0); m_button1->Bind(wxEVT_BUTTON, [this,m_textCtrl1](auto& e) { go_to_url(m_textCtrl1->GetValue()); });*/ - + m_sizer_web_control->Add( m_control_back, 0, wxALIGN_CENTER | wxLEFT, FromDIP(26) ); m_sizer_web_control->Add(m_control_forward, 0, wxALIGN_CENTER | wxLEFT, FromDIP(26)); m_sizer_web_control->Add(m_control_refresh, 0, wxALIGN_CENTER | wxLEFT, FromDIP(26)); @@ -127,13 +127,13 @@ namespace GUI { json j = json::parse(strInput); wxString strCmd = j["command"]; - + if(strCmd == "request_close_publish_window") { this->Hide(); } - + } - catch (std::exception& e) { + catch (std::exception& /*e*/) { // wxMessageBox(e.what(), "json Exception", MB_OK); } } @@ -181,7 +181,7 @@ namespace GUI { WebView::LoadUrl(m_browser, url); } - void ModelMallDialog::show_control(bool show) + void ModelMallDialog::show_control(bool show) { m_web_control_panel->Show(show); Layout(); diff --git a/src/slic3r/GUI/Monitor.cpp b/src/slic3r/GUI/Monitor.cpp index 775eb5173..baaa0e38b 100644 --- a/src/slic3r/GUI/Monitor.cpp +++ b/src/slic3r/GUI/Monitor.cpp @@ -160,7 +160,7 @@ MonitorPanel::~MonitorPanel() m_refresh_timer = new wxTimer(); m_refresh_timer->SetOwner(this); m_refresh_timer->Start(REFRESH_INTERVAL); - wxPostEvent(this, wxTimerEvent()); + if (update_flag) { update_all();} Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); if (!dev) return; @@ -468,7 +468,7 @@ bool MonitorPanel::Show(bool show) m_refresh_timer->Stop(); m_refresh_timer->SetOwner(this); m_refresh_timer->Start(REFRESH_INTERVAL); - wxPostEvent(this, wxTimerEvent()); + if (update_flag) { update_all(); } if (dev) { //set a default machine when obj is null diff --git a/src/slic3r/GUI/MonitorBasePanel.cpp b/src/slic3r/GUI/MonitorBasePanel.cpp index 553b8f099..a63a86f99 100644 --- a/src/slic3r/GUI/MonitorBasePanel.cpp +++ b/src/slic3r/GUI/MonitorBasePanel.cpp @@ -21,7 +21,6 @@ MonitorBasePanel::MonitorBasePanel(wxWindow* parent, wxWindowID id, const wxPoin m_splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D | wxSP_BORDER); m_splitter->SetSashGravity(0); - m_splitter->SetSashSize(0); m_splitter->Connect(wxEVT_IDLE, wxIdleEventHandler(MonitorBasePanel::m_splitterOnIdle), NULL, this); m_splitter->SetMinimumPaneSize(182); diff --git a/src/slic3r/GUI/Project.cpp b/src/slic3r/GUI/Project.cpp index 935ed47ae..c66f292a4 100644 --- a/src/slic3r/GUI/Project.cpp +++ b/src/slic3r/GUI/Project.cpp @@ -324,7 +324,7 @@ void ProjectPanel::OnScriptMessage(wxWebViewEvent& evt) } } - catch (std::exception& e) { + catch (std::exception& /*e*/) { // wxMessageBox(e.what(), "json Exception", MB_OK); } } diff --git a/src/slic3r/GUI/Search.cpp b/src/slic3r/GUI/Search.cpp index 41a4b9e30..17d7d5cd5 100644 --- a/src/slic3r/GUI/Search.cpp +++ b/src/slic3r/GUI/Search.cpp @@ -855,7 +855,7 @@ void SearchDialog::OnCheck(wxCommandEvent &event) void SearchDialog::OnMotion(wxMouseEvent &event) { wxDataViewItem item; - wxDataViewColumn *col; + //wxDataViewColumn *col; wxWindow * win = this; // search_list->HitTest(wxGetMousePosition() - win->GetScreenPosition(), item, col); diff --git a/src/slic3r/GUI/SelectMachinePop.cpp b/src/slic3r/GUI/SelectMachinePop.cpp index 2f6f1681c..34049f0af 100644 --- a/src/slic3r/GUI/SelectMachinePop.cpp +++ b/src/slic3r/GUI/SelectMachinePop.cpp @@ -406,7 +406,13 @@ void SelectMachinePopup::Popup(wxWindow *WXUNUSED(focus)) } } - wxPostEvent(this, wxTimerEvent()); + { + wxGetApp().reset_to_active(); + wxCommandEvent user_event(EVT_UPDATE_USER_MACHINE_LIST); + user_event.SetEventObject(this); + wxPostEvent(this, user_event); + } + PopupWindow::Popup(); } diff --git a/src/slic3r/GUI/SendSystemInfoDialog.cpp b/src/slic3r/GUI/SendSystemInfoDialog.cpp index b8fe67dd2..ddd4f5fa0 100644 --- a/src/slic3r/GUI/SendSystemInfoDialog.cpp +++ b/src/slic3r/GUI/SendSystemInfoDialog.cpp @@ -442,7 +442,7 @@ static std::string generate_system_info_json() pt::ptree hw_node; { - hw_node.put("ArchName", wxPlatformInfo::Get().GetArchName()); + hw_node.put("ArchName", wxPlatformInfo::Get().GetBitnessName()); size_t num = std::round(Slic3r::total_physical_memory()/107374100.); hw_node.put("RAM_GiB", std::to_string(num / 10) + "." + std::to_string(num % 10)); } diff --git a/src/slic3r/GUI/WebDownPluginDlg.cpp b/src/slic3r/GUI/WebDownPluginDlg.cpp index 1e3827d06..b915d6cc3 100644 --- a/src/slic3r/GUI/WebDownPluginDlg.cpp +++ b/src/slic3r/GUI/WebDownPluginDlg.cpp @@ -218,16 +218,16 @@ void DownPluginFrame::OnScriptMessage(wxWebViewEvent &evt) wxGetApp().restart_networking(); this->EndModal(wxID_OK); this->Close(); - } + } else if (strCmd == "close_download_dialog") { this->EndModal(wxID_OK); this->Close(); - } + } else if (strCmd == "open_plugin_folder") { auto plugin_folder = (boost::filesystem::path(wxStandardPaths::Get().GetUserDataDir().ToUTF8().data()) / "plugins").make_preferred().string(); desktop_open_any_folder(plugin_folder); } - } catch (std::exception &e) { + } catch (std::exception &/*e*/) { // wxMessageBox(e.what(), "json Exception", MB_OK); } } @@ -322,7 +322,7 @@ int DownPluginFrame::InstallPlugin() int DownPluginFrame::ShowPluginStatus(int status, int percent, bool &cancel) { static int nPercent = 0; - if (nPercent == percent) + if (nPercent == percent) return 0; nPercent = percent; diff --git a/src/slic3r/GUI/Widgets/AMSItem.cpp b/src/slic3r/GUI/Widgets/AMSItem.cpp index b75bae92c..343e0fb1b 100644 --- a/src/slic3r/GUI/Widgets/AMSItem.cpp +++ b/src/slic3r/GUI/Widgets/AMSItem.cpp @@ -309,11 +309,11 @@ void AMSrefresh::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, con m_playing_timer = new wxTimer(); m_playing_timer->SetOwner(this); - wxPostEvent(this, wxTimerEvent()); SetSize(AMS_REFRESH_SIZE); SetMinSize(AMS_REFRESH_SIZE); SetMaxSize(AMS_REFRESH_SIZE); + Refresh(); } void AMSrefresh::on_timer(wxTimerEvent &event) diff --git a/src/slic3r/GUI/Widgets/DropDown.cpp b/src/slic3r/GUI/Widgets/DropDown.cpp index 62f02fed2..304416a76 100644 --- a/src/slic3r/GUI/Widgets/DropDown.cpp +++ b/src/slic3r/GUI/Widgets/DropDown.cpp @@ -345,7 +345,7 @@ int DropDown::hoverIndex() return hover_item; int index = -1; std::set groups; - for (size_t i = 0; i < items.size(); ++i) { + for (int i = 0; i < items.size(); ++i) { auto &item = items[i]; // Skip by group if (group.IsEmpty()) { diff --git a/src/slic3r/GUI/Widgets/StateColor.cpp b/src/slic3r/GUI/Widgets/StateColor.cpp index 817257cfd..243646415 100644 --- a/src/slic3r/GUI/Widgets/StateColor.cpp +++ b/src/slic3r/GUI/Widgets/StateColor.cpp @@ -55,7 +55,6 @@ inline wxColour darkModeColorFor2(wxColour const &color) if (!gDarkMode) return color; auto iter = gDarkColors.find(color); - wxFAIL(iter != gDarkColors.end()); if (iter != gDarkColors.end()) return iter->second; return color; } @@ -71,7 +70,6 @@ wxColour StateColor::lightModeColorFor(wxColour const &color) { static std::map gLightColors = revert(gDarkColors); auto iter = gLightColors.find(color); - wxFAIL(iter != gLightColors.end()); if (iter != gLightColors.end()) return iter->second; return color; } diff --git a/src/slic3r/GUI/Widgets/StateHandler.cpp b/src/slic3r/GUI/Widgets/StateHandler.cpp index 10b4dcb98..de9ced6e1 100644 --- a/src/slic3r/GUI/Widgets/StateHandler.cpp +++ b/src/slic3r/GUI/Widgets/StateHandler.cpp @@ -35,7 +35,7 @@ void StateHandler::attach_child(wxWindow *child) void StateHandler::remove_child(wxWindow *child) { - children_.erase(std::remove_if(children_.begin(), children_.end(), + children_.erase(std::remove_if(children_.begin(), children_.end(), [child](auto &c) { return c->owner_ == child; }), children_.end()); states2_ = 0; for (auto & c : children_) states2_ |= c->states(); @@ -72,7 +72,7 @@ void StateHandler::update_binds() void StateHandler::set_state(int state, int mask) { - if (states_ & mask == state & mask) return; + if ((states_ & mask) == (state & mask)) return; int old = states_; states_ = states_ & ~mask | state & mask; if (old != states_ && (old | states2_) != (states_ | states2_)) { diff --git a/src/slic3r/GUI/Widgets/WebView.cpp b/src/slic3r/GUI/Widgets/WebView.cpp index dbf560bae..66552ecea 100644 --- a/src/slic3r/GUI/Widgets/WebView.cpp +++ b/src/slic3r/GUI/Widgets/WebView.cpp @@ -312,7 +312,7 @@ bool WebView::RunScript(wxWebView *webView, wxString const &javascript) }, NULL); return true; #endif - } catch (std::exception &e) { + } catch (std::exception &/*e*/) { return false; } }