diff --git a/extras/tests/Misc/TypeTraits.cpp b/extras/tests/Misc/TypeTraits.cpp index bf1e4f58..a54a69a1 100644 --- a/extras/tests/Misc/TypeTraits.cpp +++ b/extras/tests/Misc/TypeTraits.cpp @@ -80,7 +80,7 @@ TEST_CASE("Polyfills/type_traits") { CHECK(is_integral::value == true); CHECK(is_integral::value == true); - CHECK(is_integral::value == true); + CHECK(is_integral::value == true); } SECTION("is_signed") { diff --git a/src/ArduinoJson.hpp b/src/ArduinoJson.hpp index ab70d3c1..3c9488bf 100644 --- a/src/ArduinoJson.hpp +++ b/src/ArduinoJson.hpp @@ -56,7 +56,7 @@ using ARDUINOJSON_NAMESPACE::JsonObjectConst; using ARDUINOJSON_NAMESPACE::JsonPair; using ARDUINOJSON_NAMESPACE::JsonPairConst; typedef ARDUINOJSON_NAMESPACE::String JsonString; -typedef ARDUINOJSON_NAMESPACE::UInt JsonUInt; +using ARDUINOJSON_NAMESPACE::JsonUInt; typedef ARDUINOJSON_NAMESPACE::VariantConstRef JsonVariantConst; typedef ARDUINOJSON_NAMESPACE::VariantRef JsonVariant; using ARDUINOJSON_NAMESPACE::BasicJsonDocument; diff --git a/src/ArduinoJson/Json/JsonSerializer.hpp b/src/ArduinoJson/Json/JsonSerializer.hpp index a56cbc32..2b484d64 100644 --- a/src/ArduinoJson/Json/JsonSerializer.hpp +++ b/src/ArduinoJson/Json/JsonSerializer.hpp @@ -83,7 +83,7 @@ class JsonSerializer : public Visitor { return bytesWritten(); } - size_t visitUnsignedInteger(UInt value) { + size_t visitUnsignedInteger(JsonUInt value) { _formatter.writeInteger(value); return bytesWritten(); } diff --git a/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp b/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp index f7c904ea..39b80aef 100644 --- a/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp +++ b/src/ArduinoJson/MsgPack/MsgPackSerializer.hpp @@ -109,7 +109,7 @@ class MsgPackSerializer : public Visitor { size_t visitSignedInteger(JsonInteger value) { if (value > 0) { - visitUnsignedInteger(static_cast(value)); + visitUnsignedInteger(static_cast(value)); } else if (value >= -0x20) { writeInteger(int8_t(value)); } else if (value >= -0x80) { @@ -137,7 +137,7 @@ class MsgPackSerializer : public Visitor { return bytesWritten(); } - size_t visitUnsignedInteger(UInt value) { + size_t visitUnsignedInteger(JsonUInt value) { if (value <= 0x7F) { writeInteger(uint8_t(value)); } else if (value <= 0xFF) { diff --git a/src/ArduinoJson/Numbers/JsonInteger.hpp b/src/ArduinoJson/Numbers/JsonInteger.hpp index 8fc12dc1..ccf852bd 100644 --- a/src/ArduinoJson/Numbers/JsonInteger.hpp +++ b/src/ArduinoJson/Numbers/JsonInteger.hpp @@ -13,10 +13,10 @@ namespace ARDUINOJSON_NAMESPACE { #if ARDUINOJSON_USE_LONG_LONG typedef int64_t JsonInteger; -typedef uint64_t UInt; +typedef uint64_t JsonUInt; #else typedef long JsonInteger; -typedef unsigned long UInt; +typedef unsigned long JsonUInt; #endif } // namespace ARDUINOJSON_NAMESPACE diff --git a/src/ArduinoJson/Numbers/arithmeticCompare.hpp b/src/ArduinoJson/Numbers/arithmeticCompare.hpp index 2c7e81b2..515bc4e6 100644 --- a/src/ArduinoJson/Numbers/arithmeticCompare.hpp +++ b/src/ArduinoJson/Numbers/arithmeticCompare.hpp @@ -90,13 +90,14 @@ CompareResult arithmeticCompare( template CompareResult arithmeticCompareNegateLeft( - UInt, const T2&, typename enable_if::value>::type* = 0) { + JsonUInt, const T2&, + typename enable_if::value>::type* = 0) { return COMPARE_RESULT_LESS; } template CompareResult arithmeticCompareNegateLeft( - UInt lhs, const T2& rhs, + JsonUInt lhs, const T2& rhs, typename enable_if::value>::type* = 0) { if (rhs > 0) return COMPARE_RESULT_LESS; @@ -105,13 +106,14 @@ CompareResult arithmeticCompareNegateLeft( template CompareResult arithmeticCompareNegateRight( - const T1&, UInt, typename enable_if::value>::type* = 0) { + const T1&, JsonUInt, + typename enable_if::value>::type* = 0) { return COMPARE_RESULT_GREATER; } template CompareResult arithmeticCompareNegateRight( - const T1& lhs, UInt rhs, + const T1& lhs, JsonUInt rhs, typename enable_if::value>::type* = 0) { if (lhs > 0) return COMPARE_RESULT_GREATER; diff --git a/src/ArduinoJson/Numbers/parseNumber.hpp b/src/ArduinoJson/Numbers/parseNumber.hpp index c06d2f57..76ccf1d8 100644 --- a/src/ArduinoJson/Numbers/parseNumber.hpp +++ b/src/ArduinoJson/Numbers/parseNumber.hpp @@ -20,7 +20,7 @@ struct choose_largest : conditional<(sizeof(A) > sizeof(B)), A, B> {}; inline bool parseNumber(const char* s, VariantData& result) { typedef FloatTraits traits; - typedef choose_largest::type mantissa_t; + typedef choose_largest::type mantissa_t; typedef traits::exponent_type exponent_t; ARDUINOJSON_ASSERT(s != 0); @@ -55,7 +55,7 @@ inline bool parseNumber(const char* s, VariantData& result) { mantissa_t mantissa = 0; exponent_t exponent_offset = 0; - const mantissa_t maxUint = UInt(-1); + const mantissa_t maxUint = JsonUInt(-1); while (isdigit(*s)) { uint8_t digit = uint8_t(*s - '0'); @@ -77,7 +77,7 @@ inline bool parseNumber(const char* s, VariantData& result) { return true; } } else { - result.setInteger(UInt(mantissa)); + result.setInteger(JsonUInt(mantissa)); return true; } } diff --git a/src/ArduinoJson/Variant/VariantCompare.hpp b/src/ArduinoJson/Variant/VariantCompare.hpp index 03b8ba03..4e13f392 100644 --- a/src/ArduinoJson/Variant/VariantCompare.hpp +++ b/src/ArduinoJson/Variant/VariantCompare.hpp @@ -60,12 +60,12 @@ struct Comparer::value || return arithmeticCompare(lhs, rhs); } - CompareResult visitUnsignedInteger(UInt lhs) { + CompareResult visitUnsignedInteger(JsonUInt lhs) { return arithmeticCompare(lhs, rhs); } CompareResult visitBoolean(bool lhs) { - return visitUnsignedInteger(static_cast(lhs)); + return visitUnsignedInteger(static_cast(lhs)); } }; @@ -162,8 +162,8 @@ struct VariantComparer : ComparerBase { return accept(comparer); } - CompareResult visitUnsignedInteger(UInt lhs) { - Comparer comparer(lhs); + CompareResult visitUnsignedInteger(JsonUInt lhs) { + Comparer comparer(lhs); return accept(comparer); } diff --git a/src/ArduinoJson/Variant/VariantContent.hpp b/src/ArduinoJson/Variant/VariantContent.hpp index c4f4611c..e904b337 100644 --- a/src/ArduinoJson/Variant/VariantContent.hpp +++ b/src/ArduinoJson/Variant/VariantContent.hpp @@ -46,7 +46,7 @@ struct RawData { union VariantContent { JsonFloat asFloat; bool asBoolean; - UInt asUnsignedInteger; + JsonUInt asUnsignedInteger; JsonInteger asSignedInteger; CollectionData asCollection; struct { diff --git a/src/ArduinoJson/Variant/VariantData.hpp b/src/ArduinoJson/Variant/VariantData.hpp index 9eb4bb47..7e0a653b 100644 --- a/src/ArduinoJson/Variant/VariantData.hpp +++ b/src/ArduinoJson/Variant/VariantData.hpp @@ -204,7 +204,7 @@ class VariantData { template typename enable_if::value>::type setInteger(T value) { setType(VALUE_IS_UNSIGNED_INTEGER); - _content.asUnsignedInteger = static_cast(value); + _content.asUnsignedInteger = static_cast(value); } template diff --git a/src/ArduinoJson/Variant/Visitor.hpp b/src/ArduinoJson/Variant/Visitor.hpp index 0c833230..6c79316a 100644 --- a/src/ArduinoJson/Variant/Visitor.hpp +++ b/src/ArduinoJson/Variant/Visitor.hpp @@ -38,7 +38,7 @@ struct Visitor { return TResult(); } - TResult visitUnsignedInteger(UInt) { + TResult visitUnsignedInteger(JsonUInt) { return TResult(); }