Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Apr 25, 2024
1 parent 2c49ff7 commit 9105cc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/Shared/IO/DeflateStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ namespace Death { namespace IO {
std::int64_t DeflateWriter::GetMaxDeflatedSize(std::int64_t uncompressedSize)
{
constexpr std::int64_t MinBlockSize = 5000;
std::int64_t maxBlocks = std::max((uncompressedSize + MinBlockSize - 1) / MinBlockSize, 1LL);
std::int64_t maxBlocks = std::max((uncompressedSize + MinBlockSize - 1) / MinBlockSize, std::int64_t(1));
return uncompressedSize + (5 * maxBlocks) + 1 + 8;
}

Expand Down
8 changes: 4 additions & 4 deletions Sources/Shared/IO/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,7 @@ namespace Death { namespace IO {
}

struct stat sb;
::fstat(source, &sb);
::fstat(sourceFd, &sb);

mode_t sourceMode = sb.st_mode;
mode_t destMode = sourceMode;
Expand Down Expand Up @@ -1950,7 +1950,7 @@ namespace Death { namespace IO {
# else
# if defined(POSIX_FADV_SEQUENTIAL) && (!defined(__ANDROID__) || __ANDROID_API__ >= 21) && !defined(DEATH_TARGET_SWITCH)
// As noted in https://eklitzke.org/efficient-file-copying-on-linux, might make the file reading faster
::posix_fadvise(source, 0, 0, POSIX_FADV_SEQUENTIAL);
::posix_fadvise(sourceFd, 0, 0, POSIX_FADV_SEQUENTIAL);
# endif

# if defined(DEATH_TARGET_EMSCRIPTEN)
Expand Down Expand Up @@ -2000,8 +2000,8 @@ namespace Death { namespace IO {
}
# endif

::close(source);
::close(dest);
::close(sourceFd);
::close(destFd);

return success;
#endif
Expand Down

0 comments on commit 9105cc8

Please sign in to comment.