From 4c408bff171785f4731f9e8bce0eaa04ee22b529 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Wed, 12 Jun 2024 14:40:46 +0100 Subject: [PATCH] Support 64-bit build --- src/include/FlashString/Object.hpp | 2 +- src/include/FlashString/ObjectBase.hpp | 2 +- test/app/array.cpp | 2 +- test/app/map.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/FlashString/Object.hpp b/src/include/FlashString/Object.hpp index d52725d..b2b88b5 100644 --- a/src/include/FlashString/Object.hpp +++ b/src/include/FlashString/Object.hpp @@ -66,7 +66,7 @@ */ #define FSTR_CHECK_STRUCT(name) \ static_assert(std::is_standard_layout::value, "FSTR structure not Standard Layout"); \ - static_assert(offsetof(decltype(name), data) == sizeof(uint32_t), "FSTR structure alignment error"); + static_assert(offsetof(decltype(name), data) % sizeof(uint32_t) == 0, "FSTR structure alignment error"); /** * @brief Import an object from an external file with reference diff --git a/src/include/FlashString/ObjectBase.hpp b/src/include/FlashString/ObjectBase.hpp index 7301f3a..4bb4410 100644 --- a/src/include/FlashString/ObjectBase.hpp +++ b/src/include/FlashString/ObjectBase.hpp @@ -103,7 +103,7 @@ class ObjectBase /* Member data must be public for initialisation to work but DO NOT ACCESS DIRECTLY !! */ - const uint32_t flashLength_; + const size_t flashLength_; // const uint8_t data[] protected: diff --git a/test/app/array.cpp b/test/app/array.cpp index 863e90e..3280058 100644 --- a/test/app/array.cpp +++ b/test/app/array.cpp @@ -60,7 +60,7 @@ struct Item { size_t printTo(Print& p) const { - return p.printf("%s=%u, %ux%ux%u cm", toString(kind).c_str(), count, size.cx, size.cy, size.cz); + return p.printf("%s=%u, %lux%lux%lu cm", toString(kind).c_str(), count, size.cx, size.cy, size.cz); } }; diff --git a/test/app/map.cpp b/test/app/map.cpp index 1f6924e..ac8333f 100644 --- a/test/app/map.cpp +++ b/test/app/map.cpp @@ -85,7 +85,7 @@ class MapTest : public TestGroup TEST_CASE("Map of enum MapKey => String") { - Serial.printf(_F("enumMap[%u]\n"), enumMap.length()); + Serial.printf(_F("enumMap[%lu]\n"), enumMap.length()); Serial.println(_F(" for-loop:")); for(unsigned i = 0; i < enumMap.length(); ++i) {