From 9105cc8317aaf3025cb1d15da2ea779fdc70620d Mon Sep 17 00:00:00 2001 From: Death Killer <884052+deathkiller@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:28:09 +0200 Subject: [PATCH] Fixed build --- Sources/Shared/IO/DeflateStream.cpp | 2 +- Sources/Shared/IO/FileSystem.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Shared/IO/DeflateStream.cpp b/Sources/Shared/IO/DeflateStream.cpp index f4968061..22ae949b 100644 --- a/Sources/Shared/IO/DeflateStream.cpp +++ b/Sources/Shared/IO/DeflateStream.cpp @@ -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; } diff --git a/Sources/Shared/IO/FileSystem.cpp b/Sources/Shared/IO/FileSystem.cpp index c7fd8d9e..7f01455a 100644 --- a/Sources/Shared/IO/FileSystem.cpp +++ b/Sources/Shared/IO/FileSystem.cpp @@ -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; @@ -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) @@ -2000,8 +2000,8 @@ namespace Death { namespace IO { } # endif - ::close(source); - ::close(dest); + ::close(sourceFd); + ::close(destFd); return success; #endif