Skip to content

Commit

Permalink
msvc 32bit: Fix C4244 warning
Browse files Browse the repository at this point in the history
On 32 bit msvc compilers with warnings on, there are C4244 warnings about  from 'std::streamoff' to size_t to vector::size_type
  • Loading branch information
bwrsandman committed May 10, 2024
1 parent cde43ef commit 2191085
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tiny_gltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3042,7 +3042,7 @@ bool GetFileSizeInBytes(size_t *filesize_out, std::string *err,
return false;
}

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

0 comments on commit 2191085

Please sign in to comment.