From 06fffb4f83a18eb420755fe64f6ddd369c13d010 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 24 Jan 2022 20:05:25 +0100 Subject: [PATCH] ASE: Fix warning unreachable code --- code/AssetLib/ASE/ASEParser.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/AssetLib/ASE/ASEParser.cpp b/code/AssetLib/ASE/ASEParser.cpp index f684b56d3..14eb720f4 100644 --- a/code/AssetLib/ASE/ASEParser.cpp +++ b/code/AssetLib/ASE/ASEParser.cpp @@ -112,6 +112,7 @@ using namespace Assimp::ASE; // ------------------------------------------------------------------------------------------------ Parser::Parser(const char *szFile, unsigned int fileFormatDefault) { ai_assert(nullptr != szFile); + filePtr = szFile; iFileFormat = fileFormatDefault; @@ -486,7 +487,7 @@ void Parser::ParseLV1MaterialListBlock() { ParseLV4MeshLong(iIndex); if (iIndex >= iMaterialCount) { - LogError("Out of range: material index is too large"); + LogWarning("Out of range: material index is too large"); iIndex = iMaterialCount - 1; return; } @@ -905,7 +906,6 @@ void Parser::ParseLV2LightSettingsBlock(ASE::Light &light) { } AI_ASE_HANDLE_SECTION("2", "LIGHT_SETTINGS"); } - return; } // ------------------------------------------------------------------------------------------------ @@ -1782,7 +1782,9 @@ void Parser::ParseLV4MeshFace(ASE::Face &out) { // *MESH_MTLID is optional, too while (true) { - if ('*' == *filePtr) break; + if ('*' == *filePtr) { + break; + } if (IsLineEnd(*filePtr)) { return; } @@ -1831,8 +1833,9 @@ void Parser::ParseLV4MeshFloatTriple(ai_real *apOut, unsigned int &rIndexOut) { void Parser::ParseLV4MeshFloatTriple(ai_real *apOut) { ai_assert(nullptr != apOut); - for (unsigned int i = 0; i < 3; ++i) + for (unsigned int i = 0; i < 3; ++i) { ParseLV4MeshFloat(apOut[i]); + } } // ------------------------------------------------------------------------------------------------ void Parser::ParseLV4MeshFloat(ai_real &fOut) {