diff --git a/CHANGELOG.md b/CHANGELOG.md index 7086cf98..3f20ce84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ v5.0.2 * Fixed segmentation fault in `parseObject(String)` and `parseArray(String)`, when the `StaticJsonBuffer` is too small to hold a copy of the string * Fixed Clang warning "register specifier is deprecated" (issue #102) +* Fixed GCC warning "declaration shadows a member" (issue #103) * Fixed memory alignment, which made ESP8266 crash (issue #104) * Fixed compilation on Visual Studio 2010 and 2012 (issue #107) diff --git a/include/ArduinoJson/Internals/BlockJsonBuffer.hpp b/include/ArduinoJson/Internals/BlockJsonBuffer.hpp index b92d7bcd..0581a2e5 100644 --- a/include/ArduinoJson/Internals/BlockJsonBuffer.hpp +++ b/include/ArduinoJson/Internals/BlockJsonBuffer.hpp @@ -76,8 +76,8 @@ class BlockJsonBuffer : public JsonBuffer { } bool addNewBlock(size_t capacity) { - size_t size = sizeof(EmptyBlock) + capacity; - Block* block = static_cast(_allocator.allocate(size)); + size_t bytes = sizeof(EmptyBlock) + capacity; + Block* block = static_cast(_allocator.allocate(bytes)); if (block == NULL) return false; block->capacity = capacity; block->size = 0; diff --git a/include/ArduinoJson/JsonSubscriptBase.hpp b/include/ArduinoJson/JsonSubscriptBase.hpp index 12406156..230dbcb9 100644 --- a/include/ArduinoJson/JsonSubscriptBase.hpp +++ b/include/ArduinoJson/JsonSubscriptBase.hpp @@ -74,9 +74,9 @@ class JsonSubscriptBase : public JsonVariantBase { private: template FORCE_INLINE TImpl& assign(TValue value) { - TImpl* impl = static_cast(this); - impl->template set(value); - return *impl; + TImpl* that = static_cast(this); + that->template set(value); + return *that; } }; }