diff options
author | Jeffrey Walton <noloader@gmail.com> | 2021-04-09 19:16:12 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2021-04-09 19:16:12 -0400 |
commit | 5a3a71c9a412e46efad30eb6af898fea5fcbf234 (patch) | |
tree | 18fe6009c953e07a20f87a5e4a77911cbac51309 /queue.cpp | |
parent | ac730233621500d1442334ec545e8a38ec2b3095 (diff) | |
download | cryptopp-git-5a3a71c9a412e46efad30eb6af898fea5fcbf234.tar.gz |
Clear GCC warnings
Diffstat (limited to 'queue.cpp')
-rw-r--r-- | queue.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -11,7 +11,7 @@ NAMESPACE_BEGIN(CryptoPP)
-static const unsigned int s_maxAutoNodeSize = 16*1024;
+static const unsigned int s_maxAutoNodeSize = 16*1024u;
// this class for use by ByteQueue only
class ByteQueueNode
@@ -136,8 +136,9 @@ public: // ********************************************************
ByteQueue::ByteQueue(size_t nodeSize)
- : Bufferless<BufferedTransformation>(), m_autoNodeSize(!nodeSize), m_nodeSize(nodeSize)
- , m_head(NULLPTR), m_tail(NULLPTR), m_lazyString(NULLPTR), m_lazyLength(0), m_lazyStringModifiable(false)
+ : Bufferless<BufferedTransformation>()
+ , m_head(NULLPTR), m_tail(NULLPTR), m_lazyString(NULLPTR), m_lazyLength(0)
+ , m_nodeSize(nodeSize), m_lazyStringModifiable(false), m_autoNodeSize(!nodeSize)
{
// See GH #962 for the reason for this assert.
CRYPTOPP_ASSERT(nodeSize != SIZE_MAX);
@@ -476,18 +477,18 @@ bool ByteQueue::operator==(const ByteQueue &rhs) const return true;
}
-byte ByteQueue::operator[](lword i) const
+byte ByteQueue::operator[](lword index) const
{
for (ByteQueueNode *current=m_head; current; current=current->m_next)
{
- if (i < current->CurrentSize())
- return (*current)[(size_t)i];
+ if (index < current->CurrentSize())
+ return (*current)[(size_t)index];
- i -= current->CurrentSize();
+ index -= current->CurrentSize();
}
- CRYPTOPP_ASSERT(i < m_lazyLength);
- return m_lazyString[i];
+ CRYPTOPP_ASSERT(index < m_lazyLength);
+ return m_lazyString[index];
}
void ByteQueue::swap(ByteQueue &rhs)
|