From d9ca70191c5c8ef416605bb67d38dae6a30f9c11 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 6 Aug 2023 08:26:03 -0500 Subject: [PATCH] Avoid 32 vs 64 warnings on some win compiles. --- src/engine/filesys.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/engine/filesys.cpp b/src/engine/filesys.cpp index f020d720f5..b930d70d09 100644 --- a/src/engine/filesys.cpp +++ b/src/engine/filesys.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef OS_NT #define WIN32_LEAN_AND_MEAN @@ -747,8 +748,10 @@ std::size_t file_query_data_size_(const std::string & filepath) if (GetFileAttributesExW(filepathw.c_str(), GetFileExInfoStandard, &file_data) == 0) return 0; } - return (std::size_t(file_data.nFileSizeHigh)<<(sizeof(file_data.nFileSizeLow)*8)) - | std::size_t(file_data.nFileSizeLow); + auto file_size = + (std::uint64_t(file_data.nFileSizeHigh)<<(sizeof(file_data.nFileSizeLow)*8)) + | std::uint64_t(file_data.nFileSizeLow); + return std::size_t(file_size); #endif return 0; }