Change the file size field of StatusInfo to be uint64_t instead of size_t
so that we know it is always 64 bits. This prevents some overflow on
systems where size_t is 32 bits when it ought to be 64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28726
91177308-0d34-0410-b5e6-
96231b3b80d8
struct StatusInfo {
StatusInfo() : fileSize(0), modTime(0,0), mode(0777), user(999),
group(999), isDir(false) { }
- size_t fileSize; ///< Size of the file in bytes
+ uint64_t fileSize; ///< Size of the file in bytes
TimeValue modTime; ///< Time of file's modification
uint32_t mode; ///< Mode of the file, if applicable
uint32_t user; ///< User ID of owner, if applicable
ThrowError("getStatusInfo():" + std::string(path) + ": Can't get status: ");
info.fileSize = fi.nFileSizeHigh;
- info.fileSize <<= 32;
+ info.fileSize <<= sizeof(fi.nFileSizeHigh)*8;
info.fileSize += fi.nFileSizeLow;
info.mode = fi.dwFileAttributes & FILE_ATTRIBUTE_READONLY ? 0555 : 0777;