From 2772e660640f1d06b30d90f5182c923d9e4b3f99 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Fri, 14 Jul 2017 11:14:50 +0200 Subject: [PATCH] Fixed warning "this statement may fall through" (issue #539) --- CHANGELOG.md | 1 + src/ArduinoJson/Polyfills/parseFloat.hpp | 3 +++ src/ArduinoJson/Polyfills/parseInteger.hpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1985e92d..43b8f941 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ HEAD * Removed dependency on `PGM_P` as Particle 0.6.2 doesn't define it (issue #546) * Fixed warning "dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]" * Fixed warning "floating constant exceeds range of 'float' [-Woverflow]" (issue #544) +* Fixed warning "this statement may fall through" [-Wimplicit-fallthrough=] (issue #539) * Removed `ARDUINOJSON_DOUBLE_IS_64BITS` as it became useless. * Fixed too many decimals places in float serialization (issue #543) diff --git a/src/ArduinoJson/Polyfills/parseFloat.hpp b/src/ArduinoJson/Polyfills/parseFloat.hpp index d3ed2397..e5d99f1b 100644 --- a/src/ArduinoJson/Polyfills/parseFloat.hpp +++ b/src/ArduinoJson/Polyfills/parseFloat.hpp @@ -26,8 +26,11 @@ inline T parseFloat(const char* s) { switch (*s) { case '-': negative_result = true; + s++; + break; case '+': s++; + break; } if (*s == 't') return 1; // true diff --git a/src/ArduinoJson/Polyfills/parseInteger.hpp b/src/ArduinoJson/Polyfills/parseInteger.hpp index 7d353fb4..023d7bcb 100644 --- a/src/ArduinoJson/Polyfills/parseInteger.hpp +++ b/src/ArduinoJson/Polyfills/parseInteger.hpp @@ -26,6 +26,8 @@ T parseInteger(const char *s) { switch (*s) { case '-': negative_result = true; + s++; + break; case '+': s++; break;