From 40d1cfe7af137442135719b7300fa577f2c7ff4a Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Mon, 6 Apr 2020 18:20:12 +0200 Subject: [PATCH] Fixed "pointless integer comparison" warning on IAR (issue #1233) --- CHANGELOG.md | 1 + src/ArduinoJson/MsgPack/MsgPackSerializer.hpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ff86d2..ec270168 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ HEAD * Fixed "maybe-uninitialized" warning (issue #1217) * Fixed "statement is unreachable" warning on IAR (issue #1233) +* Fixed "pointless integer comparison" warning on IAR (issue #1233) v6.15.0 (2020-03-22) ------- diff --git a/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp b/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp index eedff5b4..b803241d 100644 --- a/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp +++ b/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp @@ -125,7 +125,13 @@ class MsgPackSerializer { } else if (value <= 0xFFFF) { writeByte(0xCD); writeInteger(uint16_t(value)); - } else if (value <= 0xFFFFFFFF) { + } +#if ARDUINOJSON_USE_LONG_LONG + else if (value <= 0xFFFFFFFF) +#else + else +#endif + { writeByte(0xCE); writeInteger(uint32_t(value)); }