Skip to content

Commit d399101

Browse files
committedMay 17, 2023
🧑‍💻 Apply simplified ?:
1 parent 02178bd commit d399101

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed
 

‎Marlin/src/feature/tmc_util.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,8 @@
601601
case TMC_STEALTHCHOP: serialprint_truefalse(st.en_pwm_mode()); break;
602602
case TMC_GLOBAL_SCALER:
603603
{
604-
uint16_t value = st.GLOBAL_SCALER();
605-
SERIAL_ECHO(value ? value : 256);
604+
const uint16_t value = st.GLOBAL_SCALER();
605+
SERIAL_ECHO(value ?: 256);
606606
SERIAL_ECHOPGM("/256");
607607
}
608608
break;

‎Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -629,14 +629,14 @@ void ST7920_Lite_Status_Screen::draw_position(const xyze_pos_t &pos, const bool
629629
#endif
630630
}
631631
else {
632-
write_byte(alt_label ? alt_label : 'X');
632+
write_byte(alt_label ?: 'X');
633633
write_str(dtostrf(pos.x, -4, 0, str), 4);
634634

635-
write_byte(alt_label ? alt_label : 'Y');
635+
write_byte(alt_label ?: 'Y');
636636
write_str(dtostrf(pos.y, -4, 0, str), 4);
637637
}
638638

639-
write_byte(alt_label ? alt_label : 'Z');
639+
write_byte(alt_label ?: 'Z');
640640
write_str(dtostrf(pos.z, -5, 1, str), 5);
641641
}
642642

‎Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/command_processor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class CommandProcessor : public CLCD::CommandFifo {
125125
}
126126

127127
inline CommandProcessor& set_button_style_callback(const btn_style_func_t *func) {
128-
_btn_style_callback = func ? func : default_button_style_func;
128+
_btn_style_callback = func ?: default_button_style_func;
129129
return *this;
130130
}
131131

‎Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace FTDI {
4141
#endif
4242

4343
// Play the note
44-
CLCD::mem_write_16(REG::SOUND, (note == REST) ? 0 : (((note ? note : NOTE_C4) << 8) | effect));
44+
CLCD::mem_write_16(REG::SOUND, (note == REST) ? 0 : (((note ?: NOTE_C4) << 8) | effect));
4545
CLCD::mem_write_8(REG::PLAY, 1);
4646
}
4747

‎Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/dialog_box_base_class.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void DialogBoxBaseClass::drawMessage(T message, const int16_t font) {
3939
.cmd(CLEAR(true,true,true))
4040
.cmd(COLOR_RGB(bg_text_enabled))
4141
.tag(0);
42-
draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(2,6), message, OPT_CENTER, font ? font : font_large);
42+
draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(2,6), message, OPT_CENTER, font ?: font_large);
4343
cmd.colors(normal_btn);
4444
}
4545

0 commit comments

Comments
 (0)