mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-03 01:10:37 +08:00
Merge pull request #482 from jam3sward/fix-c4018-warnings-msvc-win32
Fix C4018 warnings in MSVC on WIN32
This commit is contained in:
commit
cde43ef668
12
tiny_gltf.h
12
tiny_gltf.h
@ -3019,18 +3019,18 @@ bool GetFileSizeInBytes(size_t *filesize_out, std::string *err,
|
|||||||
}
|
}
|
||||||
|
|
||||||
f.seekg(0, f.end);
|
f.seekg(0, f.end);
|
||||||
size_t sz = static_cast<size_t>(f.tellg());
|
const auto sz = f.tellg();
|
||||||
|
|
||||||
// std::cout << "sz = " << sz << "\n";
|
// std::cout << "sz = " << sz << "\n";
|
||||||
f.seekg(0, f.beg);
|
f.seekg(0, f.beg);
|
||||||
|
|
||||||
if (int64_t(sz) < 0) {
|
if (sz < 0) {
|
||||||
if (err) {
|
if (err) {
|
||||||
(*err) += "Invalid file size : " + filepath +
|
(*err) += "Invalid file size : " + filepath +
|
||||||
" (does the path point to a directory?)";
|
" (does the path point to a directory?)";
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else if (sz == 0) {
|
} else if (sz == std::streamoff(0)) {
|
||||||
if (err) {
|
if (err) {
|
||||||
(*err) += "File is empty : " + filepath + "\n";
|
(*err) += "File is empty : " + filepath + "\n";
|
||||||
}
|
}
|
||||||
@ -3114,18 +3114,18 @@ bool ReadWholeFile(std::vector<unsigned char> *out, std::string *err,
|
|||||||
}
|
}
|
||||||
|
|
||||||
f.seekg(0, f.end);
|
f.seekg(0, f.end);
|
||||||
size_t sz = static_cast<size_t>(f.tellg());
|
const auto sz = f.tellg();
|
||||||
|
|
||||||
// std::cout << "sz = " << sz << "\n";
|
// std::cout << "sz = " << sz << "\n";
|
||||||
f.seekg(0, f.beg);
|
f.seekg(0, f.beg);
|
||||||
|
|
||||||
if (int64_t(sz) < 0) {
|
if (sz < 0) {
|
||||||
if (err) {
|
if (err) {
|
||||||
(*err) += "Invalid file size : " + filepath +
|
(*err) += "Invalid file size : " + filepath +
|
||||||
" (does the path point to a directory?)";
|
" (does the path point to a directory?)";
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else if (sz == 0) {
|
} else if (sz == std::streamoff(0)) {
|
||||||
if (err) {
|
if (err) {
|
||||||
(*err) += "File is empty : " + filepath + "\n";
|
(*err) += "File is empty : " + filepath + "\n";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user