From 1572539bece6e7963774c67e9add0b1051c1ff02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 14 Oct 2016 11:59:28 +0200 Subject: [PATCH] Rename variable empty to emptyString MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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] --- src/lib_json/json_value.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index 88c630f..cf09337 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -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(static_cast(empty)); + value_.string_ = const_cast(static_cast(emptyString)); break; case arrayValue: case objectValue: