mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-05-21 12:23:30 +02:00
Rename variable empty to emptyString
Rename variable empty to emptyString in Value constructor to avoid shadowing of Value::empty(). GCC 4.8 produces the warning about this: lib_json/json_value.cpp: In constructor ‘Json::Value::Value(Json::ValueType)’: lib_json/json_value.cpp:346:27: warning: declaration of ‘empty’ shadows a member of 'this' [-Wshadow]
This commit is contained in:
parent
d8cd848ede
commit
1572539bec
@ -343,7 +343,7 @@ bool Value::CZString::isStaticString() const { return storage_.policy_ == noDupl
|
||||
* This optimization is used in ValueInternalMap fast allocator.
|
||||
*/
|
||||
Value::Value(ValueType vtype) {
|
||||
static char const empty[] = "";
|
||||
static char const emptyString[] = "";
|
||||
initBasic(vtype);
|
||||
switch (vtype) {
|
||||
case nullValue:
|
||||
@ -357,7 +357,7 @@ Value::Value(ValueType vtype) {
|
||||
break;
|
||||
case stringValue:
|
||||
// allocated_ == false, so this is safe.
|
||||
value_.string_ = const_cast<char*>(static_cast<char const*>(empty));
|
||||
value_.string_ = const_cast<char*>(static_cast<char const*>(emptyString));
|
||||
break;
|
||||
case arrayValue:
|
||||
case objectValue:
|
||||
|
Loading…
x
Reference in New Issue
Block a user