From 07d3a7d5b075ad091403bd3330b0af9fc1457658 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Fri, 12 Jul 2019 16:02:51 +0100 Subject: [PATCH] Fix some warnings Hopefully the sorts out the MSVC2013 compiler --- code/Common/ZipArchiveIOSystem.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/code/Common/ZipArchiveIOSystem.cpp b/code/Common/ZipArchiveIOSystem.cpp index cff1109c2..8079db0b8 100644 --- a/code/Common/ZipArchiveIOSystem.cpp +++ b/code/Common/ZipArchiveIOSystem.cpp @@ -199,20 +199,23 @@ namespace Assimp { explicit ZipFileInfo(unzFile zip_handle, size_t size); // Allocate and Extract data from the ZIP - ZipFile * Extract(unzFile zip_handle, const std::string & file) const; + ZipFile * Extract(unzFile zip_handle) const; private: size_t m_Size = 0; - unz_file_pos_s m_ZipFilePos = { 0,0 }; + unz_file_pos_s m_ZipFilePos; }; ZipFileInfo::ZipFileInfo(unzFile zip_handle, size_t size) : m_Size(size) { ai_assert(m_Size != 0); + // Workaround for MSVC 2013 - C2797 + m_ZipFilePos.num_of_file = 0; + m_ZipFilePos.pos_in_zip_directory = 0; unzGetFilePos(zip_handle, &(m_ZipFilePos)); } - ZipFile * ZipFileInfo::Extract(unzFile zip_handle, const std::string & file) const { + ZipFile * ZipFileInfo::Extract(unzFile zip_handle) const { // Find in the ZIP. This cannot fail unz_file_pos_s *filepos = const_cast(&(m_ZipFilePos)); if (unzGoToFilePos(zip_handle, filepos) != UNZ_OK) @@ -385,8 +388,6 @@ namespace Assimp { MapArchive(); ZipFileMap::const_iterator it = m_ArchiveMap.find(filename); - bool exist(false); - return (it != m_ArchiveMap.end()); } @@ -401,7 +402,7 @@ namespace Assimp { return nullptr; const ZipFileInfo &zip_file = (*zip_it).second; - return zip_file.Extract(m_ZipFileHandle, filename); + return zip_file.Extract(m_ZipFileHandle); } inline void ReplaceAll(std::string& data, const std::string& before, const std::string& after) {