From 0e58b291b5434ca426675bcaa9441b2449ec941b Mon Sep 17 00:00:00 2001 From: ellensp Date: Mon, 2 Mar 2020 23:36:56 +1300 Subject: [PATCH 1/2] Fix warning unused variable valptr --- Marlin/src/gcode/parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index 0fac65300fb4..45106bdabfed 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -312,7 +312,9 @@ void GCodeParser::parse(char *p) { char * const valptr = has_val ? is_str ? unescape_string(p) : p : nullptr; #else const bool has_val = valid_float(p); - char * const valptr = has_val ? p : nullptr; + #if ENABLED(FASTER_GCODE_PARSER) + char * const valptr = has_val ? p : nullptr; + #endif #endif #if ENABLED(DEBUG_GCODE_PARSER) From a6cb454e9d4ab8d54a7ca789c3318043bb931c22 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 2 Mar 2020 13:16:43 -0600 Subject: [PATCH 2/2] Update parser.cpp --- Marlin/src/gcode/parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index 45106bdabfed..4ece6ede469e 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -313,7 +313,7 @@ void GCodeParser::parse(char *p) { #else const bool has_val = valid_float(p); #if ENABLED(FASTER_GCODE_PARSER) - char * const valptr = has_val ? p : nullptr; + char * const valptr = has_val ? p : nullptr; #endif #endif