diff --git a/coding/constants.hpp b/coding/constants.hpp index cbf0d41964..c37e681ec0 100644 --- a/coding/constants.hpp +++ b/coding/constants.hpp @@ -1,4 +1,4 @@ #pragma once static const size_t READ_FILE_BUFFER_SIZE = 512 * 1024; -static const size_t ZIP_FILE_BUFFER_SIZE = 64 * 1024; +static const unsigned int ZIP_FILE_BUFFER_SIZE = 64 * 1024; diff --git a/coding/zip_creator.cpp b/coding/zip_creator.cpp index 2a850d1f55..95330ea9ca 100644 --- a/coding/zip_creator.cpp +++ b/coding/zip_creator.cpp @@ -84,15 +84,15 @@ bool CreateZipFromPathDeflatedAndDefaultCompression(string const & filePath, str try { my::FileData file(filePath, my::FileData::OP_READ); - size_t const fileSize = file.Size(); + uint64_t const fileSize = file.Size(); - size_t currSize = 0; + uint64_t currSize = 0; while (currSize < fileSize) { - size_t const toRead = min(ZIP_FILE_BUFFER_SIZE, fileSize - currSize); + unsigned int const toRead = min(ZIP_FILE_BUFFER_SIZE, static_cast(fileSize - currSize)); file.Read(currSize, &buffer[0], toRead); - if (ZIP_OK != zipWriteInFileInZip(zip.Handle(), &buffer[0], static_cast(toRead))) + if (ZIP_OK != zipWriteInFileInZip(zip.Handle(), &buffer[0], toRead)) return false; currSize += toRead;