forked from bblanchon/ArduinoJson
Store 64-bit numbers (double and long long) in an additional slot
This change allows slots to be twices maller on 32-bit architectures. See #1650 and #2103
This commit is contained in:
1 parent
e682337655
commit
e297932a98
20 files changed
+308
-89
No files matched your search
@@ -8,7 +8,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN");
|
||||
|
||||
static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE");
|
||||
|
||||
static_assert(sizeof(ArduinoJson::detail::VariantData) == 16,
|
||||
static_assert(sizeof(ArduinoJson::detail::VariantData) == 8,
|
||||
"sizeof(VariantData)");
|
||||
|
||||
void setup() {}
|
||||
|
||||
@@ -8,7 +8,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN");
|
||||
|
||||
static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE");
|
||||
|
||||
static_assert(sizeof(ArduinoJson::detail::VariantData) == 12,
|
||||
static_assert(sizeof(ArduinoJson::detail::VariantData) == 8,
|
||||
"sizeof(VariantData)");
|
||||
|
||||
int main() {}
|
||||
@@ -8,7 +8,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN");
|
||||
|
||||
static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE");
|
||||
|
||||
static_assert(sizeof(ArduinoJson::detail::VariantData) == 16,
|
||||
static_assert(sizeof(ArduinoJson::detail::VariantData) == 8,
|
||||
"sizeof(VariantData)");
|
||||
|
||||
int main() {}
|
||||
@@ -32,11 +32,7 @@ TEST_CASE("ARDUINOJSON_USE_LONG_LONG == 0") {
|
||||
deserializeMsgPack(doc, "\xcf\x00\x00\x00\x01\x00\x00\x00\x00"_s);
|
||||
|
||||
REQUIRE(err == DeserializationError::Ok);
|
||||
#if defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ >= 8
|
||||
REQUIRE(doc.as<JsonInteger>() == 0x100000000);
|
||||
#else
|
||||
REQUIRE(doc.isNull());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user