Skip to content

Commit

Permalink
Merge pull request #482 from jam3sward/fix-c4018-warnings-msvc-win32
Browse files Browse the repository at this point in the history
Fix C4018 warnings in MSVC on WIN32
  • Loading branch information
syoyo authored Mar 26, 2024
2 parents ed3d1ec + e3f9a7d commit cde43ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tiny_gltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3019,18 +3019,18 @@ bool GetFileSizeInBytes(size_t *filesize_out, std::string *err,
}

f.seekg(0, f.end);
size_t sz = static_cast<size_t>(f.tellg());
const auto sz = f.tellg();

// std::cout << "sz = " << sz << "\n";
f.seekg(0, f.beg);

if (int64_t(sz) < 0) {
if (sz < 0) {
if (err) {
(*err) += "Invalid file size : " + filepath +
" (does the path point to a directory?)";
}
return false;
} else if (sz == 0) {
} else if (sz == std::streamoff(0)) {
if (err) {
(*err) += "File is empty : " + filepath + "\n";
}
Expand Down Expand Up @@ -3114,18 +3114,18 @@ bool ReadWholeFile(std::vector<unsigned char> *out, std::string *err,
}

f.seekg(0, f.end);
size_t sz = static_cast<size_t>(f.tellg());
const auto sz = f.tellg();

// std::cout << "sz = " << sz << "\n";
f.seekg(0, f.beg);

if (int64_t(sz) < 0) {
if (sz < 0) {
if (err) {
(*err) += "Invalid file size : " + filepath +
" (does the path point to a directory?)";
}
return false;
} else if (sz == 0) {
} else if (sz == std::streamoff(0)) {
if (err) {
(*err) += "File is empty : " + filepath + "\n";
}
Expand Down

0 comments on commit cde43ef

Please sign in to comment.