Skip to content

Commit

Permalink
fixed win32 compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
LeadRDRK committed Apr 17, 2021
1 parent d99711e commit 2a5cf57
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
win32-build/
compile_commands.json
.clangd/
.cache/
Expand Down
1 change: 0 additions & 1 deletion lib/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

#include "zpack.h"
using namespace ZPack;

const char* ZPack::getErrorMessage(int error)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ int Reader::unpackFileStream(const FileInfo *info, std::ostream &dst)

char* charInBuf = (char*)inBuffer->src;
char* charOutBuf = (char*)outBuffer->dst;
size_t toRead = std::min(info->compSize, ZSTD_DStreamInSize());
size_t toRead = std::min(info->compSize, (uint64_t)ZSTD_DStreamInSize());
size_t lastRet = 0;
size_t totalRead = 0;
CRC32 crc;
Expand All @@ -271,7 +271,7 @@ int Reader::unpackFileStream(const FileInfo *info, std::ostream &dst)
outBuffer->pos = 0;

// reduce reading size if needed
toRead = std::min(toRead, info->compSize - totalRead);
toRead = std::min(toRead, (size_t)(info->compSize - totalRead));

// read part of the file
file.read(charInBuf, toRead);
Expand Down
2 changes: 1 addition & 1 deletion lib/zpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace ZPack
* @param error The error code.
* @return The error message corresponding to the error code.
*/
const char* getErrorMessage(int error);
ZPACK_API const char* getErrorMessage(int error);

// structs

Expand Down

0 comments on commit 2a5cf57

Please sign in to comment.