Skip to content

Commit

Permalink
Avoid 32 vs 64 warnings on some win compiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Aug 6, 2023
1 parent 8bd0937 commit d9ca701
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/engine/filesys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <assert.h>
#include <sys/stat.h>
#include <cstdio>
#include <cstdint>

#ifdef OS_NT
#define WIN32_LEAN_AND_MEAN
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d9ca701

Please sign in to comment.