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

@ -116,7 +116,6 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
if (excluse_area.size() != 4)
return out_points;
double cutter_area_x = excluse_area[2].x() + 2;
double cutter_area_y = excluse_area[2].y() + 2;
double start_x_position = start_point.x();
@ -2587,7 +2586,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
m_avoid_crossing_perimeters.use_external_mp_once();
// BBS. change tool before moving to origin point.
if (m_writer.need_toolchange(initial_extruder_id)) {
const PrintObjectConfig& object_config = object.config();
coordf_t initial_layer_print_height = print.config().initial_layer_print_height.value;
file.write(this->set_extruder(initial_extruder_id, initial_layer_print_height, true));
prime_extruder = true;
@ -3370,14 +3368,17 @@ namespace ProcessLayer
const PrintConfig &config)
{
std::string gcode;
// BBS
bool single_filament_print = config.filament_diameter.size() == 1;
if (custom_gcode != nullptr) {
// Extruder switches are processed by LayerTools, they should be filtered out.
assert(custom_gcode->type != CustomGCode::ToolChange);
CustomGCode::Type gcode_type = custom_gcode->type;
//BBS: inserting color gcode is removed
#if 0
// BBS
bool single_filament_print = config.filament_diameter.size() == 1;
bool color_change = gcode_type == CustomGCode::ColorChange;
bool tool_change = gcode_type == CustomGCode::ToolChange;
// Tool Change is applied as Color Change for a single extruder printer only.
@ -3389,8 +3390,7 @@ namespace ProcessLayer
m600_extruder_before_layer = custom_gcode->extruder - 1;
else if (gcode_type == CustomGCode::PausePrint)
pause_print_msg = custom_gcode->extra;
//BBS: inserting color gcode is removed
#if 0
// we should add or not colorprint_change in respect to nozzle_diameter count instead of really used extruders count
if (color_change || tool_change)
{
@ -3453,8 +3453,8 @@ namespace Skirt {
{
// Prime all extruders printing over the 1st layer over the skirt lines.
size_t n_loops = print.skirt().entities.size();
size_t n_tools = layer_tools.extruders.size();
size_t lines_per_extruder = (n_loops + n_tools - 1) / n_tools;
// size_t n_tools = layer_tools.extruders.size();
// size_t lines_per_extruder = (n_loops + n_tools - 1) / n_tools;
// BBS. Extrude skirt with first extruder if min_skirt_length is zero
//ORCA: Always extrude skirt with first extruder, independantly of if the minimum skirt length is zero or not. The code below
@ -3809,7 +3809,8 @@ LayerResult GCode::process_layer(
Skirt::make_skirt_loops_per_extruder_other_layers(print, layer_tools, m_skirt_done);
// BBS: get next extruder according to flush and soluble
auto get_next_extruder = [&](int current_extruder,const std::vector<unsigned int>&extruders) {
// Orca: Left unused due to removed code below
/* auto get_next_extruder = [&](int current_extruder,const std::vector<unsigned int>&extruders) {
std::vector<float> flush_matrix(cast<float>(m_config.flush_volumes_matrix.values));
const unsigned int number_of_extruders = (unsigned int)(sqrt(flush_matrix.size()) + EPSILON);
// Extract purging volumes for each extruder pair:
@ -3827,7 +3828,7 @@ LayerResult GCode::process_layer(
}
}
return next_extruder;
};
}; */
if (m_config.enable_overhang_speed && !m_config.overhang_speed_classic) {
for (const auto &layer_to_print : layers) {
@ -4960,8 +4961,8 @@ std::string GCode::extrude_support(const ExtrusionEntityCollection &support_fill
std::string gcode;
if (! support_fills.entities.empty()) {
const double support_speed = m_config.support_speed.value;
const double support_interface_speed = m_config.get_abs_value("support_interface_speed");
// const double support_speed = m_config.support_speed.value;
// const double support_interface_speed = m_config.get_abs_value("support_interface_speed");
for (const ExtrusionEntity *ee : support_fills.entities) {
ExtrusionRole role = ee->role();
assert(role == erSupportMaterial || role == erSupportMaterialInterface || role == erSupportTransition);
@ -6127,7 +6128,6 @@ bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role, LiftTyp
for (int i = 0; i < m_config.z_hop.size(); i++)
max_z_hop = std::max(max_z_hop, (float)m_config.z_hop.get_at(i));
float travel_len_thresh = scale_(max_z_hop / tan(this->writer().extruder()->travel_slope()));
float accum_len = 0.f;
Polyline clipped_travel;
clipped_travel.append(Polyline(travel.points[0], travel.points[1]));
@ -6229,7 +6229,6 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li
}
if (needs_lift && can_lift) {
size_t extruder_id = m_writer.extruder()->id();
gcode += m_writer.lift(!m_spiral_vase ? lift_type : LiftType::NormalLift);
}