forked from bblanchon/ArduinoJson
Fixed GCC warning "declaration shadows a member" (issue #103)
This commit is contained in:
@ -7,6 +7,7 @@ v5.0.2
|
|||||||
* Fixed segmentation fault in `parseObject(String)` and `parseArray(String)`, when the
|
* Fixed segmentation fault in `parseObject(String)` and `parseArray(String)`, when the
|
||||||
`StaticJsonBuffer` is too small to hold a copy of the string
|
`StaticJsonBuffer` is too small to hold a copy of the string
|
||||||
* Fixed Clang warning "register specifier is deprecated" (issue #102)
|
* 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 memory alignment, which made ESP8266 crash (issue #104)
|
||||||
* Fixed compilation on Visual Studio 2010 and 2012 (issue #107)
|
* Fixed compilation on Visual Studio 2010 and 2012 (issue #107)
|
||||||
|
|
||||||
|
@ -76,8 +76,8 @@ class BlockJsonBuffer : public JsonBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool addNewBlock(size_t capacity) {
|
bool addNewBlock(size_t capacity) {
|
||||||
size_t size = sizeof(EmptyBlock) + capacity;
|
size_t bytes = sizeof(EmptyBlock) + capacity;
|
||||||
Block* block = static_cast<Block*>(_allocator.allocate(size));
|
Block* block = static_cast<Block*>(_allocator.allocate(bytes));
|
||||||
if (block == NULL) return false;
|
if (block == NULL) return false;
|
||||||
block->capacity = capacity;
|
block->capacity = capacity;
|
||||||
block->size = 0;
|
block->size = 0;
|
||||||
|
@ -74,9 +74,9 @@ class JsonSubscriptBase : public JsonVariantBase<TImpl> {
|
|||||||
private:
|
private:
|
||||||
template <typename TValue>
|
template <typename TValue>
|
||||||
FORCE_INLINE TImpl& assign(TValue value) {
|
FORCE_INLINE TImpl& assign(TValue value) {
|
||||||
TImpl* impl = static_cast<TImpl*>(this);
|
TImpl* that = static_cast<TImpl*>(this);
|
||||||
impl->template set<TValue>(value);
|
that->template set<TValue>(value);
|
||||||
return *impl;
|
return *that;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user