mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-03-04 17:44:46 -07:00
Fixes 1 Bug and 8 Compiler Warnings (#10654)
* fixes: keys_map is initialized with itself [-Winit-self] * fixes: operation on repeats may be undefined [-Wsequence-point] * fixes: warning: suggest parentheses around && within || [-Wparentheses] * fixes: moving brim_points to itself [-Wself-move] * fixes: operation on unprintability may be undefined [-Wsequence-point] * fixes: extra tokens at end of #endif directive [-Wendif-labels] * fixes: converting to non-pointer type int from NULL [-Wconversion-null] * review result: simplifies fix 'operation on repeats may be undefined'
This commit is contained in:
parent
8e84d21b7f
commit
aa8b8620da
7 changed files with 10 additions and 10 deletions
|
|
@ -2085,11 +2085,11 @@ class ConfigOptionEnumsGenericTempl : public ConfigOptionInts
|
|||
public:
|
||||
ConfigOptionEnumsGenericTempl(const t_config_enum_values *keys_map = nullptr) : keys_map(keys_map) {}
|
||||
explicit ConfigOptionEnumsGenericTempl(const t_config_enum_values *keys_map, size_t size, int value) : ConfigOptionInts(size, value), keys_map(keys_map) {}
|
||||
explicit ConfigOptionEnumsGenericTempl(std::initializer_list<int> il) : ConfigOptionInts(std::move(il)), keys_map(keys_map) {}
|
||||
explicit ConfigOptionEnumsGenericTempl(std::initializer_list<int> il) : ConfigOptionInts(std::move(il)) {}
|
||||
explicit ConfigOptionEnumsGenericTempl(const std::vector<int> &vec) : ConfigOptionInts(vec) {}
|
||||
explicit ConfigOptionEnumsGenericTempl(std::vector<int> &&vec) : ConfigOptionInts(std::move(vec)) {}
|
||||
|
||||
const t_config_enum_values* keys_map = nullptr;
|
||||
const t_config_enum_values* keys_map { nullptr };
|
||||
|
||||
static ConfigOptionType static_type() { return coEnums; }
|
||||
ConfigOptionType type() const override { return static_type(); }
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ double calculate_infill_rotation_angle(const PrintObject* object,
|
|||
idx = std::min(idx, (int) object->layers().size() - 1);
|
||||
limit_fill_z = object->get_layer(idx)->print_z + sdx * object->config().layer_height;
|
||||
}
|
||||
repeats = std::max(--repeats, 0);
|
||||
repeats = std::max(repeats - 1, 0);
|
||||
} else
|
||||
_noop = true; // set the dumb cycle
|
||||
if (_absolute) { // is absolute
|
||||
|
|
|
|||
|
|
@ -5915,9 +5915,9 @@ bool GCode::_needSAFC(const ExtrusionPath &path)
|
|||
};
|
||||
|
||||
return std::any_of(std::begin(supported_patterns), std::end(supported_patterns), [&](const InfillPattern pattern) {
|
||||
return this->on_first_layer() && this->config().bottom_surface_pattern == pattern ||
|
||||
path.role() == erSolidInfill && this->config().internal_solid_infill_pattern == pattern ||
|
||||
path.role() == erTopSolidInfill && this->config().top_surface_pattern == pattern;
|
||||
return (this->on_first_layer() && this->config().bottom_surface_pattern == pattern) ||
|
||||
(path.role() == erSolidInfill && this->config().internal_solid_infill_pattern == pattern) ||
|
||||
(path.role() == erTopSolidInfill && this->config().top_surface_pattern == pattern);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1170,7 +1170,7 @@ ModelObject& ModelObject::assign_copy(ModelObject &&rhs)
|
|||
this->sla_support_points = std::move(rhs.sla_support_points);
|
||||
this->sla_points_status = std::move(rhs.sla_points_status);
|
||||
this->sla_drain_holes = std::move(rhs.sla_drain_holes);
|
||||
this->brim_points = std::move(brim_points);
|
||||
this->brim_points = std::move(rhs.brim_points);
|
||||
this->layer_config_ranges = std::move(rhs.layer_config_ranges);
|
||||
this->layer_height_profile = std::move(rhs.layer_height_profile);
|
||||
this->printable = std::move(rhs.printable);
|
||||
|
|
|
|||
|
|
@ -464,7 +464,7 @@ public:
|
|||
}
|
||||
cost += (costs.bottom < params.BOTTOM_MIN) * 100;// +(costs.height_to_bottom_hull_ratio > params.height_to_bottom_hull_ratio_MIN) * 110;
|
||||
|
||||
costs.unprintability = costs.unprintability = cost;
|
||||
costs.unprintability = cost;
|
||||
|
||||
return cost;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -709,7 +709,7 @@ GLGizmoRotate3D::RotoptimzeWindow::RotoptimzeWindow(ImGuiWrapper * imgui,
|
|||
wxGetApp().app_config->set("sla_auto_rotate",
|
||||
"method_id",
|
||||
std::to_string(state.method_id));
|
||||
#endif SUPPORT_SLA_AUTO_ROTATE
|
||||
#endif // SUPPORT_SLA_AUTO_ROTATE
|
||||
}
|
||||
|
||||
if (ImGui::IsItemHovered())
|
||||
|
|
|
|||
|
|
@ -5613,7 +5613,7 @@ 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue