From 57a51fd5db7a13be1f00b0f08e0214b3dc1f5421 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Sat, 10 Jun 2017 16:39:48 -0500
Subject: [PATCH] Tweak some else clauses
---
Marlin/G26_Mesh_Validation_Tool.cpp | 7 +++++--
Marlin/MarlinSerial.cpp | 3 ++-
Marlin/nozzle.cpp | 6 ++++--
Marlin/planner.cpp | 11 +++--------
4 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/Marlin/G26_Mesh_Validation_Tool.cpp b/Marlin/G26_Mesh_Validation_Tool.cpp
index afbf2b1103..18a28b3c41 100644
--- a/Marlin/G26_Mesh_Validation_Tool.cpp
+++ b/Marlin/G26_Mesh_Validation_Tool.cpp
@@ -684,7 +684,8 @@
SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD.");
return UBL_ERR;
#endif
- } else {
+ }
+ else {
g26_prime_flag++;
g26_prime_length = parser.value_linear_units();
if (!WITHIN(g26_prime_length, 0.0, 25.0)) {
@@ -727,7 +728,9 @@
if (!parser.seen('R')) {
SERIAL_PROTOCOLLNPGM("?(R)epeat must be specified when not using an LCD.");
return UBL_ERR;
- } else g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1;
+ }
+ else
+ g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1;
#endif
if (g26_repeats < 1) {
SERIAL_PROTOCOLLNPGM("?(R)epeat value not plausible; must be at least 1.");
diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp
index 2ee83def0a..235e018094 100644
--- a/Marlin/MarlinSerial.cpp
+++ b/Marlin/MarlinSerial.cpp
@@ -320,7 +320,8 @@
// space for us.
if (TEST(M_UCSRxA, M_UDREx))
_tx_udr_empty_irq();
- } else {
+ }
+ else {
// nop, the interrupt handler will free up space for us
}
}
diff --git a/Marlin/nozzle.cpp b/Marlin/nozzle.cpp
index 569fba62a6..e5706e862a 100644
--- a/Marlin/nozzle.cpp
+++ b/Marlin/nozzle.cpp
@@ -136,7 +136,8 @@ void Nozzle::circle(
// Order of movement is pretty darn important here
do_blocking_move_to_xy(start.x, start.y);
do_blocking_move_to_z(start.z);
- } else {
+ }
+ else {
do_blocking_move_to_z(start.z);
do_blocking_move_to_xy(start.x, start.y);
}
@@ -160,7 +161,8 @@ void Nozzle::circle(
// As above order is important
do_blocking_move_to_z(initial.z);
do_blocking_move_to_xy(initial.x, initial.y);
- } else {
+ }
+ else {
do_blocking_move_to_xy(initial.x, initial.y);
do_blocking_move_to_z(initial.z);
}
diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp
index dee6eaad02..a755db5767 100644
--- a/Marlin/planner.cpp
+++ b/Marlin/planner.cpp
@@ -470,14 +470,9 @@ void Planner::check_axes_activity() {
if (fan_kick_end[f] == 0) { \
fan_kick_end[f] = ms + FAN_KICKSTART_TIME; \
tail_fan_speed[f] = 255; \
- } else { \
- if (PENDING(ms, fan_kick_end[f])) { \
- tail_fan_speed[f] = 255; \
- } \
- } \
- } else { \
- fan_kick_end[f] = 0; \
- }
+ } else if (PENDING(ms, fan_kick_end[f])) \
+ tail_fan_speed[f] = 255; \
+ } else fan_kick_end[f] = 0
#if HAS_FAN0
KICKSTART_FAN(0);
--
GitLab