mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 02:53:10 +01:00
GH #1050 JSON: fix gcc -Wshadow warnings
This commit is contained in:
@@ -149,10 +149,10 @@ Array::operator const Poco::Dynamic::Array& () const
|
||||
if (!_pArray)
|
||||
{
|
||||
ValueVec::const_iterator it = _values.begin();
|
||||
ValueVec::const_iterator end = _values.end();
|
||||
ValueVec::const_iterator itEnd = _values.end();
|
||||
_pArray = new Poco::Dynamic::Array;
|
||||
int index = 0;
|
||||
for (; it != end; ++it, ++index)
|
||||
for (; it != itEnd; ++it, ++index)
|
||||
{
|
||||
if (isObject(it))
|
||||
{
|
||||
|
||||
@@ -104,8 +104,8 @@ void Object::stringify(std::ostream& out, unsigned int indent, int step) const
|
||||
const std::string& Object::getKey(KeyPtrList::const_iterator& iter) const
|
||||
{
|
||||
ValueMap::const_iterator it = _values.begin();
|
||||
ValueMap::const_iterator end = _values.end();
|
||||
for (; it != end; ++it)
|
||||
ValueMap::const_iterator itEnd = _values.end();
|
||||
for (; it != itEnd; ++it)
|
||||
{
|
||||
if (it->first == **iter) return it->first;
|
||||
}
|
||||
@@ -121,8 +121,8 @@ void Object::set(const std::string& key, const Dynamic::Var& value)
|
||||
if (_preserveInsOrder)
|
||||
{
|
||||
KeyPtrList::iterator it = _keys.begin();
|
||||
KeyPtrList::iterator end = _keys.end();
|
||||
for (; it != end; ++it)
|
||||
KeyPtrList::iterator itEnd = _keys.end();
|
||||
for (; it != itEnd; ++it)
|
||||
{
|
||||
if (key == **it) return;
|
||||
}
|
||||
@@ -164,9 +164,9 @@ Object::operator const Poco::DynamicStruct& () const
|
||||
if (!_pStruct)
|
||||
{
|
||||
ValueMap::const_iterator it = _values.begin();
|
||||
ValueMap::const_iterator end = _values.end();
|
||||
ValueMap::const_iterator itEnd = _values.end();
|
||||
_pStruct = new Poco::DynamicStruct;
|
||||
for (; it != end; ++it)
|
||||
for (; it != itEnd; ++it)
|
||||
{
|
||||
if (isObject(it))
|
||||
{
|
||||
|
||||
@@ -122,20 +122,20 @@ void ParseHandler::key(const std::string& k)
|
||||
}
|
||||
|
||||
|
||||
void ParseHandler::setValue(const Var& value)
|
||||
void ParseHandler::setValue(const Var& rValue)
|
||||
{
|
||||
Var parent = _stack.top();
|
||||
|
||||
if ( parent.type() == typeid(Array::Ptr) )
|
||||
{
|
||||
Array::Ptr arr = parent.extract<Array::Ptr>();
|
||||
arr->add(value);
|
||||
arr->add(rValue);
|
||||
}
|
||||
else if ( parent.type() == typeid(Object::Ptr) )
|
||||
{
|
||||
poco_assert_dbg(!_key.empty());
|
||||
Object::Ptr obj = parent.extract<Object::Ptr>();
|
||||
obj->set(_key, value);
|
||||
obj->set(_key, rValue);
|
||||
_key.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,18 +23,18 @@ namespace Poco {
|
||||
namespace JSON {
|
||||
|
||||
|
||||
PrintHandler::PrintHandler(unsigned indent):
|
||||
PrintHandler::PrintHandler(unsigned newIndent):
|
||||
_out(std::cout),
|
||||
_indent(indent),
|
||||
_indent(newIndent),
|
||||
_array(0),
|
||||
_objStart(true)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
PrintHandler::PrintHandler(std::ostream& out, unsigned indent):
|
||||
PrintHandler::PrintHandler(std::ostream& out, unsigned newIndent):
|
||||
_out(out),
|
||||
_indent(indent),
|
||||
_indent(newIndent),
|
||||
_array(0),
|
||||
_objStart(true)
|
||||
{
|
||||
@@ -172,10 +172,10 @@ void PrintHandler::value(UInt64 v)
|
||||
#endif
|
||||
|
||||
|
||||
void PrintHandler::value(const std::string& value)
|
||||
void PrintHandler::value(const std::string& rValue)
|
||||
{
|
||||
arrayValue();
|
||||
Stringifier::formatString(value, _out);
|
||||
Stringifier::formatString(rValue, _out);
|
||||
_objStart = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user