mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-17 05:52:39 +00:00
build: clear 8 warnings - && inside || without parentheses (#15587)
Every edit makes the precedence the compiler already applies explicit. None of them regroups an expression, so behavior is unchanged at all eight sites. Strip parentheses and whitespace from the diff and the token stream matches. GCodeProcessor.cpp:1472 tests == where the symmetric clause below tests !=, which reads like a typo and is not one. A comment now explains why. OrcaSlicer.cpp:4760 was the only judgment call. Its leading !is_seq_print is bare while both operands are parenthesized, so the written form matches what the compiler does. Kept rather than guessed at.
This commit is contained in:
@@ -1468,9 +1468,11 @@ void GCodeProcessor::run_post_process()
|
||||
|
||||
// Append a per-filament usage block at a filament change.
|
||||
auto handle_filament_change = [&](int filament_id, int cur_line_id, int nozzle_id) {
|
||||
// skip filament changes emitted inside the machine start / end gcode
|
||||
if (m_machine_start_gcode_end_line_id == (unsigned int) (-1) && (unsigned int) (cur_line_id) < m_machine_start_gcode_end_line_id ||
|
||||
m_machine_end_gcode_start_line_id != (unsigned int) (-1) && (unsigned int) (cur_line_id) > m_machine_end_gcode_start_line_id)
|
||||
// Skip filament changes emitted inside the machine start / end gcode. One forward pass assigns
|
||||
// the tag ids and tests them in the same loop, so inside the start gcode the end tag is unseen
|
||||
// and the id still holds the sentinel. That is why the first clause tests == and the second !=.
|
||||
if ((m_machine_start_gcode_end_line_id == (unsigned int) (-1) && (unsigned int) (cur_line_id) < m_machine_start_gcode_end_line_id) ||
|
||||
(m_machine_end_gcode_start_line_id != (unsigned int) (-1) && (unsigned int) (cur_line_id) > m_machine_end_gcode_start_line_id))
|
||||
return;
|
||||
if (!m_filament_blocks.empty())
|
||||
m_filament_blocks.back().upper_gcode_id = cur_line_id;
|
||||
|
||||
Reference in New Issue
Block a user