Skip to content

Commit

Permalink
Fixed GCC warning "declaration shadows a member" (issue #103)
Browse files Browse the repository at this point in the history
  • Loading branch information
bblanchon committed Sep 1, 2015
1 parent 5a4d993 commit 04b8781
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions include/ArduinoJson/Internals/BlockJsonBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class BlockJsonBuffer : public JsonBuffer {
}

bool addNewBlock(size_t capacity) {
size_t size = sizeof(EmptyBlock) + capacity;
Block* block = static_cast<Block*>(_allocator.allocate(size));
size_t bytes = sizeof(EmptyBlock) + capacity;
Block* block = static_cast<Block*>(_allocator.allocate(bytes));
if (block == NULL) return false;
block->capacity = capacity;
block->size = 0;
Expand Down
6 changes: 3 additions & 3 deletions include/ArduinoJson/JsonSubscriptBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class JsonSubscriptBase : public JsonVariantBase<TImpl> {
private:
template <typename TValue>
FORCE_INLINE TImpl& assign(TValue value) {
TImpl* impl = static_cast<TImpl*>(this);
impl->template set<TValue>(value);
return *impl;
TImpl* that = static_cast<TImpl*>(this);
that->template set<TValue>(value);
return *that;
}
};
}

0 comments on commit 04b8781

Please sign in to comment.