From acf266fe781d6d4bdad7beeb387b70c24cf2e213 Mon Sep 17 00:00:00 2001
From: Ludy <Ludy87@users.noreply.github.com>
Date: Sun, 20 Jan 2019 01:47:29 +0100
Subject: [PATCH] Fix a compile warning, etc. (#12955)

---
 Marlin/src/gcode/motion/G2_G3.cpp                     |  1 +
 Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp | 10 +++-------
 Marlin/src/gcode/temperature/M106_M107.cpp            |  2 +-
 Marlin/src/lcd/menu/menu_bed_leveling.cpp             |  4 ++--
 Marlin/src/module/temperature.cpp                     |  2 +-
 Marlin/src/module/temperature.h                       |  2 +-
 6 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp
index b0473ed41f..f905a148b0 100644
--- a/Marlin/src/gcode/motion/G2_G3.cpp
+++ b/Marlin/src/gcode/motion/G2_G3.cpp
@@ -184,6 +184,7 @@ void plan_arc(
     raw[q_axis] = center_Q + r_Q;
     #if ENABLED(AUTO_BED_LEVELING_UBL)
       raw[l_axis] = start_L;
+      UNUSED(linear_per_segment);
     #else
       raw[l_axis] += linear_per_segment;
     #endif
diff --git a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp
index c54b56763c..ee493d634f 100644
--- a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp
+++ b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp
@@ -179,13 +179,9 @@ void GcodeSuite::M28() {
 
   #if ENABLED(FAST_FILE_TRANSFER)
 
-    const int16_t port =
-      #if NUM_SERIAL > 1
-        command_queue_port[cmd_queue_index_r]
-      #else
-        0
-      #endif
-    ;
+    #if NUM_SERIAL > 1
+      const int16_t port = command_queue_port[cmd_queue_index_r];
+    #endif
 
     bool binary_mode = false;
     char *p = parser.string_arg;
diff --git a/Marlin/src/gcode/temperature/M106_M107.cpp b/Marlin/src/gcode/temperature/M106_M107.cpp
index 7150f7db3b..25160669ee 100644
--- a/Marlin/src/gcode/temperature/M106_M107.cpp
+++ b/Marlin/src/gcode/temperature/M106_M107.cpp
@@ -48,7 +48,7 @@ void GcodeSuite::M106() {
   if (p < MIN(EXTRUDERS, FAN_COUNT)) {
 
     #if ENABLED(EXTRA_FAN_SPEED)
-      const int16_t t = parser.intval('T');
+      const uint16_t t = parser.intval('T');
       if (t > 0) return thermalManager.set_temp_fan_speed(p, t);
     #endif
 
diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp
index 40c51b5726..4af8866dd9 100644
--- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp
+++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp
@@ -210,8 +210,8 @@
     static uint8_t xind, yind; // =0
     START_MENU();
     MENU_BACK(MSG_BED_LEVELING);
-    MENU_ITEM_EDIT(int8, MSG_MESH_X, &xind, 0, GRID_MAX_POINTS_X - 1);
-    MENU_ITEM_EDIT(int8, MSG_MESH_Y, &yind, 0, GRID_MAX_POINTS_Y - 1);
+    MENU_ITEM_EDIT(uint8, MSG_MESH_X, &xind, 0, GRID_MAX_POINTS_X - 1);
+    MENU_ITEM_EDIT(uint8, MSG_MESH_Y, &yind, 0, GRID_MAX_POINTS_Y - 1);
     MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_MESH_EDIT_Z, &Z_VALUES(xind, yind), -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5, refresh_planner);
     END_MENU();
   }
diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp
index 93cadd0641..35086ec034 100644
--- a/Marlin/src/module/temperature.cpp
+++ b/Marlin/src/module/temperature.cpp
@@ -111,7 +111,7 @@ int16_t Temperature::current_temperature_raw[HOTENDS], // = { 0 }
   #if ENABLED(EXTRA_FAN_SPEED)
     uint8_t Temperature::old_fan_speed[FAN_COUNT], Temperature::new_fan_speed[FAN_COUNT];
 
-    void Temperature::set_temp_fan_speed(const uint8_t fan, const int16_t tmp_temp) {
+    void Temperature::set_temp_fan_speed(const uint8_t fan, const uint16_t tmp_temp) {
       switch (tmp_temp) {
         case 1:
           set_fan_speed(fan, old_fan_speed[fan]);
diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h
index 8468f059b2..0d67163cad 100644
--- a/Marlin/src/module/temperature.h
+++ b/Marlin/src/module/temperature.h
@@ -346,7 +346,7 @@ class Temperature {
 
       #if ENABLED(EXTRA_FAN_SPEED)
         static uint8_t old_fan_speed[FAN_COUNT], new_fan_speed[FAN_COUNT];
-        static void set_temp_fan_speed(const uint8_t fan, const int16_t tmp_temp);
+        static void set_temp_fan_speed(const uint8_t fan, const uint16_t tmp_temp);
       #endif
 
       #if HAS_LCD_MENU
-- 
GitLab