msvc 32bit: Fix C4244 warning

On 32 bit msvc compilers with warnings on, there are C4244 warnings about  from 'std::streamoff' to size_t to vector::size_type
This commit is contained in:
Sandy 2024-05-10 08:36:41 -04:00 committed by Sandy Carter
parent cde43ef668
commit 2191085580
No known key found for this signature in database
GPG Key ID: CBEF579D87B6E212

View File

@ -3042,7 +3042,7 @@ bool GetFileSizeInBytes(size_t *filesize_out, std::string *err,
return false; return false;
} }
(*filesize_out) = sz; (*filesize_out) = static_cast<size_t>(sz);
return true; return true;
#endif #endif
} }
@ -3067,7 +3067,7 @@ bool ReadWholeFile(std::vector<unsigned char> *out, std::string *err,
} }
return false; return false;
} }
out->resize(size); out->resize(static_cast<size_t>(size));
AAsset_read(asset, reinterpret_cast<char *>(&out->at(0)), size); AAsset_read(asset, reinterpret_cast<char *>(&out->at(0)), size);
AAsset_close(asset); AAsset_close(asset);
return true; return true;