From 099f83c023c938c322cc0724517eed51a26a2d5d Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 3 Oct 2023 15:55:45 +0000 Subject: [PATCH] Fix compiler warning in COBJMeshFileLoader Caused by recent patches for 1.8 - which still had different parameter types in IReadFile::read git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6557 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/COBJMeshFileLoader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Irrlicht/COBJMeshFileLoader.cpp b/source/Irrlicht/COBJMeshFileLoader.cpp index 398bd9a..f13a003 100644 --- a/source/Irrlicht/COBJMeshFileLoader.cpp +++ b/source/Irrlicht/COBJMeshFileLoader.cpp @@ -67,8 +67,8 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file) { if (!file) return 0; - long filesize = file->getSize(); - if (!filesize) + size_t filesize = file->getSize(); + if (filesize == 0 || filesize == -1L) return 0; const io::path fullName = file->getFileName(); @@ -76,7 +76,7 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file) c8* buf = new c8[filesize+1]; // plus null-terminator (some string functions used in parsing) filesize = file->read((void*)buf, filesize); - if ( filesize <= 0 ) + if ( filesize == 0 ) { delete[] buf; return 0;