summaryrefslogtreecommitdiff
path: root/zip/ZipArchive/ZipMemFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zip/ZipArchive/ZipMemFile.cpp')
-rw-r--r--zip/ZipArchive/ZipMemFile.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/zip/ZipArchive/ZipMemFile.cpp b/zip/ZipArchive/ZipMemFile.cpp
index 4fae328..f06f853 100644
--- a/zip/ZipArchive/ZipMemFile.cpp
+++ b/zip/ZipArchive/ZipMemFile.cpp
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyrighted 2000 - 2007 by Artpol Software - Tadeusz Dracz
+// This source file is part of the ZipArchive Library Open Source distribution
+// and is Copyrighted 2000 - 2022 by Artpol Software - Tadeusz Dracz
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -9,7 +9,7 @@
//
// For the licensing details refer to the License.txt file.
//
-// Web Site: http://www.artpol-software.com
+// Web Site: https://www.artpol-software.com
////////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
@@ -20,9 +20,13 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
+#if defined _ZIP_IMPL_MFC && (_MSC_VER >= 1300 || _ZIP_FILE_IMPLEMENTATION != ZIP_ZFI_WIN)
+IMPLEMENT_DYNAMIC(CZipMemFile, CFile)
+#endif
+
void CZipMemFile::Grow(size_t nGrowTo)
{
- if (m_nBufSize < (UINT)nGrowTo)
+ if (m_nBufSize < nGrowTo)
{
if (m_nGrowBy == 0)
CZipException::Throw(CZipException::memError);
@@ -41,7 +45,6 @@ void CZipMemFile::Grow(size_t nGrowTo)
m_lpBuf = lpNew;
}
}
-
void CZipMemFile::SetLength(ZIP_FILE_USIZE nNewLen)
{
if (m_nBufSize < (size_t)nNewLen)
@@ -51,18 +54,18 @@ void CZipMemFile::SetLength(ZIP_FILE_USIZE nNewLen)
m_nDataSize = (size_t)nNewLen;
}
-UINT CZipMemFile::Read(void *lpBuf, UINT nCount)
+size_t CZipMemFile::Read(void *lpBuf, size_t nCount)
{
if (m_nPos >= m_nDataSize)
return 0;
- UINT nToRead = (m_nPos + nCount > m_nDataSize) ? (UINT)(m_nDataSize - m_nPos) : nCount;
+ size_t nToRead = (m_nPos + nCount > m_nDataSize) ? (size_t)(m_nDataSize - m_nPos) : nCount;
memcpy(lpBuf, m_lpBuf + m_nPos, nToRead);
m_nPos += nToRead;
return nToRead;
}
-void CZipMemFile::Write(const void *lpBuf, UINT nCount)
+void CZipMemFile::Write(const void *lpBuf, size_t nCount)
{
if (!nCount)
return;