From 02d6107c97b48888362e7c6a70dcac323c89d741 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 17 Dec 2023 21:23:58 +0100 Subject: ZipArchive: Update to the 4.6.9 release --- zip/ZipArchive/ZipMemFile.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'zip/ZipArchive/ZipMemFile.cpp') 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; -- cgit v1.2.3