From 1fb32fa0c226ace5fa8d8ea4d9fe039447b920d3 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 22 Sep 2019 19:44:28 +0200 Subject: [PATCH 1/2] OpenDDL: remove dead code. --- contrib/openddlparser/code/Value.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/contrib/openddlparser/code/Value.cpp b/contrib/openddlparser/code/Value.cpp index b5a35e7220f..8f084c84e3a 100644 --- a/contrib/openddlparser/code/Value.cpp +++ b/contrib/openddlparser/code/Value.cpp @@ -413,8 +413,6 @@ Value *ValueAllocator::allocPrimData( Value::ValueType type, size_t len ) { case Value::ddl_ref: data->m_size = 0; break; - case Value::ddl_none: - case Value::ddl_types_max: default: break; } From fff64055d0cb5507317b08531f158e36c0304e26 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 24 Sep 2019 17:56:46 +0200 Subject: [PATCH 2/2] some more static code analysis fixes. --- code/ASE/ASEParser.cpp | 12 ++++-------- test/unit/utASEImportExport.cpp | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/code/ASE/ASEParser.cpp b/code/ASE/ASEParser.cpp index 913e7b11821..e1cacef142b 100644 --- a/code/ASE/ASEParser.cpp +++ b/code/ASE/ASEParser.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -431,7 +429,7 @@ void Parser::ParseLV1SoftSkinBlock() std::string bone; for (unsigned int w = 0; w < numWeights;++w) { bone.clear(); - ParseString(bone,"*MESH_SOFTSKINVERTS.Bone"); + ParseString(bone, "*MESH_SOFTSKINVERTS.Bone"); // Find the bone in the mesh's list std::pair me; @@ -826,7 +824,6 @@ bool Parser::ParseString(std::string& out,const char* szName) char szBuffer[1024]; if (!SkipSpaces(&filePtr)) { - ai_snprintf(szBuffer, 1024, "Unable to parse %s block: Unexpected EOL",szName); LogWarning(szBuffer); return false; @@ -834,7 +831,6 @@ bool Parser::ParseString(std::string& out,const char* szName) // there must be '"' if ('\"' != *filePtr) { - ai_snprintf(szBuffer, 1024, "Unable to parse %s block: Strings are expected " "to be enclosed in double quotation marks",szName); LogWarning(szBuffer); @@ -842,9 +838,9 @@ bool Parser::ParseString(std::string& out,const char* szName) } ++filePtr; const char* sz = filePtr; - while (true) - { - if ('\"' == *sz)break; + while (true) { + if ('\"' == *sz) + break; else if ('\0' == *sz) { ai_snprintf(szBuffer, 1024, "Unable to parse %s block: Strings are expected to " diff --git a/test/unit/utASEImportExport.cpp b/test/unit/utASEImportExport.cpp index 313f0f83a32..703713d9103 100644 --- a/test/unit/utASEImportExport.cpp +++ b/test/unit/utASEImportExport.cpp @@ -50,7 +50,7 @@ using namespace Assimp; class utASEImportExport : public AbstractImportExportBase { public: - virtual bool importerTest() { + bool importerTest() override { Assimp::Importer importer; const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/ASE/ThreeCubesGreen.ASE", aiProcess_ValidateDataStructure ); #ifndef ASSIMP_BUILD_NO_3DS_IMPORTER