summaryrefslogtreecommitdiff
path: root/zinflate.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2005-07-12 04:23:32 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2005-07-12 04:23:32 +0000
commitd5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47 (patch)
tree4b03760892a97a9bc452ebe8b7793bbebd402ad4 /zinflate.cpp
parentfa39f51809b4da54a5c2adb3e183b1a625cefb92 (diff)
downloadcryptopp-d5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47.tar.gz
port to MSVC .NET 2005 beta 2
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@198 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'zinflate.cpp')
-rw-r--r--zinflate.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/zinflate.cpp b/zinflate.cpp
index 864a3e5..e0be8ba 100644
--- a/zinflate.cpp
+++ b/zinflate.cpp
@@ -238,11 +238,11 @@ void Inflator::OutputByte(byte b)
}
}
-void Inflator::OutputString(const byte *string, unsigned int length)
+void Inflator::OutputString(const byte *string, size_t length)
{
while (length)
{
- unsigned int len = STDMIN(length, (unsigned int)(m_window.size() - m_current));
+ size_t len = STDMIN(length, m_window.size() - m_current);
memcpy(m_window + m_current, string, len);
m_current += len;
if (m_current == m_window.size())
@@ -259,7 +259,7 @@ void Inflator::OutputString(const byte *string, unsigned int length)
void Inflator::OutputPast(unsigned int length, unsigned int distance)
{
- unsigned int start;
+ size_t start;
if (distance <= m_current)
start = m_current - distance;
else if (m_wrappedAround && distance <= m_window.size())
@@ -286,7 +286,7 @@ void Inflator::OutputPast(unsigned int length, unsigned int distance)
}
}
-unsigned int Inflator::Put2(const byte *inString, unsigned int length, int messageEnd, bool blocking)
+size_t Inflator::Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
{
if (!blocking)
throw BlockingInputOnly("Inflator");
@@ -333,7 +333,7 @@ void Inflator::ProcessInput(bool flush)
case WAIT_HEADER:
{
// maximum number of bytes before actual compressed data starts
- const unsigned int MAX_HEADER_SIZE = BitsToBytes(3+5+5+4+19*7+286*15+19*15);
+ const size_t MAX_HEADER_SIZE = BitsToBytes(3+5+5+4+19*7+286*15+19*15);
if (m_inQueue.CurrentSize() < (flush ? 1 : MAX_HEADER_SIZE))
return;
DecodeHeader();
@@ -470,12 +470,12 @@ bool Inflator::DecodeBody()
assert(m_reader.BitsBuffered() == 0);
while (!m_inQueue.IsEmpty() && !blockEnd)
{
- unsigned int size;
+ size_t size;
const byte *block = m_inQueue.Spy(size);
- size = STDMIN(size, (unsigned int)m_storedLen);
+ size = UnsignedMin(m_storedLen, size);
OutputString(block, size);
m_inQueue.Skip(size);
- m_storedLen -= size;
+ m_storedLen -= (word16)size;
if (m_storedLen == 0)
blockEnd = true;
}