GH #1050 Foundation-tests: fix gcc -Wshadow warnings

This commit is contained in:
Miklos Vajna
2016-04-01 11:36:39 +02:00
parent fb23653f88
commit 2b6eb3fd76
21 changed files with 184 additions and 184 deletions

View File

@@ -59,7 +59,7 @@ public:
}
template <typename T>
Pair(const K& first, const T& second): _data(std::make_pair(first, second))
Pair(const K& rFirst, const T& rSecond): _data(std::make_pair(rFirst, rSecond))
/// Creates pair from two values.
{
}

View File

@@ -334,14 +334,14 @@ public:
{
if (_entries[i])
{
UInt32 size = (UInt32)_entries[i]->size();
poco_assert_dbg(size != 0);
if (size > maxEntriesPerHash)
maxEntriesPerHash = size;
UInt32 entrySize = (UInt32)_entries[i]->size();
poco_assert_dbg(entrySize != 0);
if (entrySize > maxEntriesPerHash)
maxEntriesPerHash = entrySize;
if (details)
detailedEntriesPerHash.push_back(size);
detailedEntriesPerHash.push_back(entrySize);
#ifdef _DEBUG
totalSize += size;
totalSize += entrySize;
#endif
}
else

View File

@@ -37,8 +37,8 @@ class LRUCache: public AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue>, TM
/// An LRUCache implements Least Recently Used caching. The default size for a cache is 1024 entries.
{
public:
LRUCache(long size = 1024):
AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue>, TMutex, TEventMutex>(LRUStrategy<TKey, TValue>(size))
LRUCache(long cacheSize = 1024):
AbstractCache<TKey, TValue, LRUStrategy<TKey, TValue>, TMutex, TEventMutex>(LRUStrategy<TKey, TValue>(cacheSize))
{
}

View File

@@ -132,7 +132,7 @@ class MetaObject: public AbstractMetaObject<B>
/// factory for its class.
{
public:
MetaObject(const char* name): AbstractMetaObject<B>(name)
MetaObject(const char* pName): AbstractMetaObject<B>(pName)
{
}
@@ -164,7 +164,7 @@ class MetaSingleton: public AbstractMetaObject<B>
/// the single instance of its class.
{
public:
MetaSingleton(const char* name): AbstractMetaObject<B>(name)
MetaSingleton(const char* pName): AbstractMetaObject<B>(pName)
{
}

View File

@@ -168,28 +168,28 @@ class ObjectPool
/// - If the object is not valid, it is destroyed immediately.
{
public:
ObjectPool(std::size_t capacity, std::size_t peakCapacity):
ObjectPool(std::size_t objectCapacity, std::size_t peakObjectCapacity):
/// Creates a new ObjectPool with the given capacity
/// and peak capacity.
///
/// The PoolableObjectFactory must have a public default constructor.
_capacity(capacity),
_peakCapacity(peakCapacity),
_capacity(objectCapacity),
_peakCapacity(peakObjectCapacity),
_size(0)
{
poco_assert (capacity <= peakCapacity);
poco_assert (objectCapacity <= peakObjectCapacity);
}
ObjectPool(const F& factory, std::size_t capacity, std::size_t peakCapacity):
ObjectPool(const F& factory, std::size_t objectCapacity, std::size_t peakObjectCapacity):
/// Creates a new ObjectPool with the given PoolableObjectFactory,
/// capacity and peak capacity. The PoolableObjectFactory must have
/// a public copy constructor.
_factory(factory),
_capacity(capacity),
_peakCapacity(peakCapacity),
_capacity(objectCapacity),
_peakCapacity(peakObjectCapacity),
_size(0)
{
poco_assert (capacity <= peakCapacity);
poco_assert (objectCapacity <= peakObjectCapacity);
}
~ObjectPool()

View File

@@ -59,7 +59,7 @@ class RecursiveDirectoryIterator
/// * SiblingsFirstRecursiveDirectoryIterator.
///
/// The depth of traversal can be limited by constructor
/// parameter maxDepth (which sets the infinite depth by default).
/// parameter maxTraversalDepth (which sets the infinite depth by default).
{
public:
typedef RecursiveDirectoryIterator<TTravStr> MyType;
@@ -75,9 +75,9 @@ public:
{
}
RecursiveDirectoryIterator(const std::string& path, UInt16 maxDepth = D_INFINITE)
RecursiveDirectoryIterator(const std::string& rPath, UInt16 maxTraversalDepth = D_INFINITE)
/// Creates a recursive directory iterator for the given path.
: _pImpl(new ImplType(path, maxDepth)), _path(Path(_pImpl->get())), _file(_path)
: _pImpl(new ImplType(rPath, maxTraversalDepth)), _path(Path(_pImpl->get())), _file(_path)
{
}
@@ -87,22 +87,22 @@ public:
{
}
RecursiveDirectoryIterator(const DirectoryIterator& iterator, UInt16 maxDepth = D_INFINITE):
RecursiveDirectoryIterator(const DirectoryIterator& iterator, UInt16 maxTraversalDepth = D_INFINITE):
/// Creates a recursive directory iterator for the path of
/// non-recursive directory iterator.
_pImpl(new ImplType(iterator->path(), maxDepth)), _path(Path(_pImpl->get())), _file(_path)
_pImpl(new ImplType(iterator->path(), maxTraversalDepth)), _path(Path(_pImpl->get())), _file(_path)
{
}
RecursiveDirectoryIterator(const File& file, UInt16 maxDepth = D_INFINITE):
RecursiveDirectoryIterator(const File& file, UInt16 maxTraversalDepth = D_INFINITE):
/// Creates a recursive directory iterator for the given path.
_pImpl(new ImplType(file.path(), maxDepth)), _path(Path(_pImpl->get())), _file(_path)
_pImpl(new ImplType(file.path(), maxTraversalDepth)), _path(Path(_pImpl->get())), _file(_path)
{
}
RecursiveDirectoryIterator(const Path& path, UInt16 maxDepth = D_INFINITE):
RecursiveDirectoryIterator(const Path& rPath, UInt16 maxTraversalDepth = D_INFINITE):
/// Creates a recursive directory iterator for the given path.
_pImpl(new ImplType(path.toString(), maxDepth)), _path(Path(_pImpl->get())), _file(_path)
_pImpl(new ImplType(rPath.toString(), maxTraversalDepth)), _path(Path(_pImpl->get())), _file(_path)
{
}
@@ -163,21 +163,21 @@ public:
}
MyType& operator = (const Path& path)
MyType& operator = (const Path& rPath)
{
if (_pImpl)
_pImpl->release();
_pImpl = new ImplType(path.toString());
_pImpl = new ImplType(rPath.toString());
_path = Path(_pImpl->get());
_file = _path;
return *this;
}
MyType& operator = (const std::string& path)
MyType& operator = (const std::string& rPath)
{
if (_pImpl)
_pImpl->release();
_pImpl = new ImplType(path);
_pImpl = new ImplType(rPath);
_path = Path(_pImpl->get());
_file = _path;
return *this;

View File

@@ -42,8 +42,8 @@ public:
D_INFINITE = 0 /// Special value for infinite traverse depth.
};
RecursiveDirectoryIteratorImpl(const std::string& path, UInt16 maxDepth = D_INFINITE)
: _maxDepth(maxDepth), _traverseStrategy(std::ptr_fun(depthFun), _maxDepth), _isFinished(false), _rc(1)
RecursiveDirectoryIteratorImpl(const std::string& path, UInt16 maxTraversalDepth = D_INFINITE)
: _maxDepth(maxTraversalDepth), _traverseStrategy(std::ptr_fun(depthFun), _maxDepth), _isFinished(false), _rc(1)
{
_itStack.push(DirectoryIterator(path));
_current = _itStack.top()->path();

View File

@@ -58,7 +58,7 @@ public:
typedef std::vector<HashEntry*> HashTableVector;
SimpleHashTable(UInt32 capacity = 251): _entries(capacity, 0), _size(0), _capacity(capacity)
SimpleHashTable(UInt32 tableCapacity = 251): _entries(tableCapacity, 0), _size(0), _capacity(tableCapacity)
/// Creates the SimpleHashTable.
{
}
@@ -366,11 +366,11 @@ public:
if (_entries[i])
{
maxEntriesPerHash = 1;
UInt32 size = 1;
UInt32 entrySize = 1;
if (details)
detailedEntriesPerHash.push_back(size);
detailedEntriesPerHash.push_back(entrySize);
#ifdef _DEBUG
totalSize += size;
totalSize += entrySize;
#endif
}
else

View File

@@ -30,8 +30,8 @@ template <class TKey>
class ValidArgs
{
public:
ValidArgs(const TKey& key):
_key(key),
ValidArgs(const TKey& rKey):
_key(rKey),
_isValid(true)
{
}