Fix Compile Warnings (#5963)

* Fix calls to depreciated wxPen constructor

* Fix use of wxTimerEvent

* Fix unrecognized character escape sequence

* Fix signed/unsigned mismatch

At least as much as possible without significantly altering parts of the application

* Clean unreferenced variables

* fix mistyped namespace selector

* Update deprecated calls

* Fix preprocessor statement

* Remove empty switch statements

* Change int vector used as bool to bool vector

* Remove empty control statements and related unused code

* Change multi character constant to string constant

* Fix discarded return value

json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured.

* Rename ICON_SIZE def used by MultiMachine

By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future.

* Remove unused includes

* Fix linux/macOS compilation

* Hide unused-function errors on non-Windows systems

* Disable signed/unsigned comparison mismatch error

* Remove/Disable more unused variables

Still TODO: check double for loop in Print.cpp

* Remove unused variable that was missed

* Remove unused variables in libraries in the src folder

* Apply temporary fix for subobject linkage error

* Remove/Disable last set of unused variables reported by GCC

* remove redundant for loop

* fix misspelled ifdef check

* Update message on dialog

* Fix hard-coded platform specific modifier keys

* Remove duplicate for loop

* Disable -Wmisleading-indentation warning

* disable -Wswitch warning

* Remove unused local typedefs

* Fix -Wunused-value

* Fix pragma error on Windows from subobject linkage fix

* Fix -Waddress

* Fix null conversions (-Wconversion-null)

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Ocraftyone 2024-07-29 09:00:26 -04:00 committed by GitHub
parent b40853af94
commit b83e16dbdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
187 changed files with 494 additions and 1101 deletions

View file

@ -1221,7 +1221,7 @@ void Tab::msw_rescale()
// recreate and set new ImageList for tree_ctrl
m_icons->RemoveAll();
m_icons = new wxImageList(m_scaled_icons_list.front().bmp().GetWidth(), m_scaled_icons_list.front().bmp().GetHeight(), false);
for (ScalableBitmap& bmp : m_scaled_icons_list)
// for (ScalableBitmap& bmp : m_scaled_icons_list)
//m_icons->Add(bmp.bmp());
m_tabctrl->AssignImageList(m_icons);
@ -1255,7 +1255,7 @@ void Tab::sys_color_changed()
// recreate and set new ImageList for tree_ctrl
m_icons->RemoveAll();
m_icons = new wxImageList(m_scaled_icons_list.front().bmp().GetWidth(), m_scaled_icons_list.front().bmp().GetHeight(), false);
for (ScalableBitmap& bmp : m_scaled_icons_list)
// for (ScalableBitmap& bmp : m_scaled_icons_list)
//m_icons->Add(bmp.bmp());
m_tabctrl->AssignImageList(m_icons);
@ -1609,19 +1609,6 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
}
// -1 means caculate all
auto update_flush_volume = [](int idx = -1) {
if (idx < 0) {
size_t filament_size = wxGetApp().plater()->get_extruder_colors_from_plater_config().size();
for (size_t i = 0; i < filament_size; ++i)
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(i);
}
else
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(idx);
};
string opt_key_without_idx = opt_key.substr(0, opt_key.find('#'));
if (opt_key_without_idx == "long_retractions_when_cut") {
@ -2588,8 +2575,6 @@ void TabPrintModel::update_model_config()
// Reset m_config manually because there's no corresponding config in m_parent_tab->m_config
for (auto plate_item : m_object_configs) {
const DynamicPrintConfig& plate_config = plate_item.second->get();
BedType plate_bed_type = (BedType)0;
PrintSequence plate_print_seq = (PrintSequence)0;
if (!plate_config.has("curr_bed_type")) {
// same as global
DynamicConfig& global_cfg = wxGetApp().preset_bundle->project_config;
@ -2900,7 +2885,6 @@ void TabPrintPlate::on_value_change(const std::string& opt_key, const boost::any
void TabPrintPlate::notify_changed(ObjectBase* object)
{
auto plate = dynamic_cast<PartPlate*>(object);
auto objects_list = wxGetApp().obj_list();
wxDataViewItemArray items;
objects_list->GetSelections(items);
@ -4680,14 +4664,14 @@ void Tab::rebuild_page_tree()
if (sel_item == m_last_select_item)
m_last_select_item = item;
else
m_last_select_item = NULL;
m_last_select_item = 0;
// allow activate page before selection of a page_tree item
m_disable_tree_sel_changed_event = false;
//BBS: GUI refactor
if (item >= 0)
{
bool ret = update_current_page_in_background(item);
update_current_page_in_background(item);
//if m_active_page is changed in update_current_page_in_background
//will just update the selected item of the treectrl
if (m_parent->is_active_and_shown_tab(this)) // FIX: modify state not update
@ -5507,7 +5491,6 @@ void Tab::delete_preset()
if (m_presets->get_preset_base(current_preset) == &current_preset) { //root preset
is_base_preset = true;
if (current_preset.type == Preset::Type::TYPE_PRINTER && !current_preset.is_system) { //Customize third-party printers
Preset &current_preset = m_presets->get_selected_preset();
int filament_preset_num = 0;
int process_preset_num = 0;
for (const Preset &preset : m_preset_bundle->filaments.get_presets()) {
@ -5771,7 +5754,6 @@ wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
sizer->Add(btn, 0, wxALIGN_CENTER_VERTICAL);
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) {
bool is_configed_by_BBL = PresetUtils::system_printer_bed_model(m_preset_bundle->printers.get_edited_preset()).size() > 0;
BedShapeDialog dlg(this);
dlg.build_dialog(*m_config->option<ConfigOptionPoints>("printable_area"),
*m_config->option<ConfigOptionString>("bed_custom_texture"),