mirror of
https://github.com/minetest/minetest.git
synced 2024-07-04 15:05:27 +02:00
Fix -Wsign-compare warning
This commit is contained in:
parent
d5450c62bf
commit
50d20a854c
@ -650,8 +650,10 @@ void SelfType::MeshExtractor::copyTCoords(
|
|||||||
std::optional<tiniergltf::GlTF> SelfType::tryParseGLTF(io::IReadFile* file)
|
std::optional<tiniergltf::GlTF> SelfType::tryParseGLTF(io::IReadFile* file)
|
||||||
{
|
{
|
||||||
auto size = file->getSize();
|
auto size = file->getSize();
|
||||||
|
if (size < 0) // this can happen if `ftell` fails
|
||||||
|
return std::nullopt;
|
||||||
auto buf = std::make_unique<char[]>(size + 1);
|
auto buf = std::make_unique<char[]>(size + 1);
|
||||||
if (file->read(buf.get(), size) != size)
|
if (file->read(buf.get(), size) != static_cast<std::size_t>(size))
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
// We probably don't need this, but add it just to be sure.
|
// We probably don't need this, but add it just to be sure.
|
||||||
buf[size] = '\0';
|
buf[size] = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user