Fixing Clang warnings 1

This commit is contained in:
Lukas Matena 2021-01-29 16:16:23 +01:00
parent cd1322ce3f
commit 0ff0444dcc
23 changed files with 90 additions and 88 deletions

View file

@ -121,7 +121,7 @@ Tab::Tab(wxNotebook* parent, const wxString& title, Preset::Type type) :
m_config_manipulation = get_config_manipulation();
Bind(wxEVT_SIZE, ([this](wxSizeEvent &evt) {
Bind(wxEVT_SIZE, ([](wxSizeEvent &evt) {
//for (auto page : m_pages)
// if (! page.get()->IsShown())
// page->layout_valid = false;
@ -242,7 +242,7 @@ void Tab::create_preset_tab()
if (dlg.ShowModal() == wxID_OK)
wxGetApp().update_label_colours();
});
m_search_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent) { wxGetApp().plater()->search(false); });
m_search_btn->Bind(wxEVT_BUTTON, [](wxCommandEvent) { wxGetApp().plater()->search(false); });
// Colors for ui "decoration"
m_sys_label_clr = wxGetApp().get_label_clr_sys();
@ -491,7 +491,7 @@ void Tab::update_label_colours()
m_modified_label_clr = wxGetApp().get_label_clr_modified();
//update options "decoration"
for (const auto opt : m_options_list)
for (const auto& opt : m_options_list)
{
const wxColour *color = &m_sys_label_clr;
@ -541,7 +541,7 @@ void Tab::update_label_colours()
void Tab::decorate()
{
for (const auto opt : m_options_list)
for (const auto& opt : m_options_list)
{
Field* field = nullptr;
wxColour* colored_label_clr = nullptr;
@ -639,7 +639,7 @@ void Tab::init_options_list()
if (!m_options_list.empty())
m_options_list.clear();
for (const auto opt_key : m_config->keys())
for (const std::string& opt_key : m_config->keys())
m_options_list.emplace(opt_key, m_opt_status_value);
}
@ -656,7 +656,7 @@ void TabPrinter::init_options_list()
if (!m_options_list.empty())
m_options_list.clear();
for (const auto opt_key : m_config->keys())
for (const std::string& opt_key : m_config->keys())
{
if (opt_key == "bed_shape" || opt_key == "thumbnails") {
m_options_list.emplace(opt_key, m_opt_status_value);
@ -709,7 +709,7 @@ void TabSLAMaterial::init_options_list()
if (!m_options_list.empty())
m_options_list.clear();
for (const auto opt_key : m_config->keys())
for (const std::string& opt_key : m_config->keys())
{
if (opt_key == "compatible_prints" || opt_key == "compatible_printers") {
m_options_list.emplace(opt_key, m_opt_status_value);
@ -1728,7 +1728,7 @@ void TabFilament::add_filament_overrides_page()
line.near_label_widget = [this, optgroup, opt_key, opt_index](wxWindow* parent) {
wxCheckBox* check_box = new wxCheckBox(parent, wxID_ANY, "");
check_box->Bind(wxEVT_CHECKBOX, [this, optgroup, opt_key, opt_index](wxCommandEvent& evt) {
check_box->Bind(wxEVT_CHECKBOX, [optgroup, opt_key, opt_index](wxCommandEvent& evt) {
const bool is_checked = evt.IsChecked();
Field* field = optgroup->get_fieldc(opt_key, opt_index);
if (field != nullptr) {
@ -3352,7 +3352,9 @@ bool Tab::tree_sel_change_delayed()
wxCheckForInterrupt(m_treectrl);
if (m_page_switch_planned)
throw UIBuildCanceled();
#endif // WIN32
#else // WIN32
(void)this; // silence warning
#endif
});
try {
@ -3924,7 +3926,7 @@ ConfigOptionsGroupShp Page::new_optgroup(const wxString& title, int noncommon_la
#else
auto tab = parent()->GetParent();// GetParent();
#endif
optgroup->m_on_change = [this, tab](t_config_option_key opt_key, boost::any value) {
optgroup->m_on_change = [tab](t_config_option_key opt_key, boost::any value) {
//! This function will be called from OptionGroup.
//! Using of CallAfter is redundant.
//! And in some cases it causes update() function to be recalled again
@ -3934,21 +3936,21 @@ ConfigOptionsGroupShp Page::new_optgroup(const wxString& title, int noncommon_la
//! });
};
optgroup->m_get_initial_config = [this, tab]() {
optgroup->m_get_initial_config = [tab]() {
DynamicPrintConfig config = static_cast<Tab*>(tab)->m_presets->get_selected_preset().config;
return config;
};
optgroup->m_get_sys_config = [this, tab]() {
optgroup->m_get_sys_config = [tab]() {
DynamicPrintConfig config = static_cast<Tab*>(tab)->m_presets->get_selected_preset_parent()->config;
return config;
};
optgroup->have_sys_config = [this, tab]() {
optgroup->have_sys_config = [tab]() {
return static_cast<Tab*>(tab)->m_presets->get_selected_preset_parent() != nullptr;
};
optgroup->rescale_extra_column_item = [this](wxWindow* win) {
optgroup->rescale_extra_column_item = [](wxWindow* win) {
auto *ctrl = dynamic_cast<wxStaticBitmap*>(win);
if (ctrl == nullptr)
return;