From 8f2e8160424e086c59d0dd4b693b4b529e650d46 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Mon, 8 Apr 2013 19:36:24 +0200 Subject: [PATCH 1/5] - LWS: fix bugs pointed out by clang leading to path strings being incorrectly build. --- code/LWSLoader.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/LWSLoader.cpp b/code/LWSLoader.cpp index cfd72766b..0ff3f9e10 100644 --- a/code/LWSLoader.cpp +++ b/code/LWSLoader.cpp @@ -464,7 +464,7 @@ std::string LWSImporter::FindLWOFile(const std::string& in) std::string tmp; if (in.length() > 3 && in[1] == ':'&& in[2] != '\\' && in[2] != '/') { - tmp = in[0] + ":\\" + in.substr(2); + tmp = in[0] + (":\\" + in.substr(2)); } else tmp = in; @@ -480,11 +480,12 @@ std::string LWSImporter::FindLWOFile(const std::string& in) // \Scenes\\<*>.lws // where is optional. - std::string test = ".." + io->getOsSeparator() + tmp; - if (io->Exists(test)) + std::string test = ".." + (io->getOsSeparator() + tmp); + if (io->Exists(test)) { return test; + } - test = ".." + io->getOsSeparator() + test; + test = ".." + (io->getOsSeparator() + test); if (io->Exists(test)) { return test; } From 67472f3feb129461b29ad9d969dc7a7eb6bb7173 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Mon, 8 Apr 2013 19:37:08 +0200 Subject: [PATCH 2/5] - remove self-assignment in MD5Loader.cpp --- code/MD5Loader.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/code/MD5Loader.cpp b/code/MD5Loader.cpp index cd6f6a155..858cdcacf 100644 --- a/code/MD5Loader.cpp +++ b/code/MD5Loader.cpp @@ -187,7 +187,6 @@ void MD5Importer::LoadFileIntoMemory (IOStream* file) ai_assert(fileSize); // allocate storage and copy the contents of the file to a memory buffer - pScene = pScene; mBuffer = new char[fileSize+1]; file->Read( (void*)mBuffer, 1, fileSize); iLineNumber = 1; From d25715ad2c0fa6bd29acebd53928abbf68494b13 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Mon, 8 Apr 2013 19:39:15 +0200 Subject: [PATCH 3/5] - Ifc: fix issue pointed out by clang that caused an epsilon check to go totally wrong. A pair of extra parentheses invoked C++ expression evaluation instead of argument passing. --- code/IFCBoolean.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/IFCBoolean.cpp b/code/IFCBoolean.cpp index 911f23a44..7330ed940 100644 --- a/code/IFCBoolean.cpp +++ b/code/IFCBoolean.cpp @@ -245,7 +245,7 @@ bool IntersectsBoundaryProfile( const IfcVector3& e0, const IfcVector3& e1, cons // directly on the vertex between two segments. if (!intersected_boundary_points.empty() && intersected_boundary_segments.back()==i-1 ) { const IfcVector3 diff = intersected_boundary_points.back() - p; - if(IfcVector3((diff.x, diff.y)).SquareLength() < 1e-7) { + if(IfcVector2(diff.x, diff.y).SquareLength() < 1e-7) { continue; } } From 47b2832dd8a54feaf1456a193ddd3708e04eeef9 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Mon, 8 Apr 2013 19:41:18 +0200 Subject: [PATCH 4/5] - XGL: fix non isocpp-compliant definition of LogFunctions::log_prefix outside the namespace where the class resides. --- code/XGLLoader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/XGLLoader.cpp b/code/XGLLoader.cpp index 8e8424726..b00c9a5f2 100644 --- a/code/XGLLoader.cpp +++ b/code/XGLLoader.cpp @@ -77,8 +77,11 @@ struct free_it void* free; }; +namespace Assimp { // this has to be in here because LogFunctions is in ::Assimp template<> const std::string LogFunctions::log_prefix = "XGL: "; +} + static const aiImporterDesc desc = { "XGL Importer", "", From 5fe03f692e80033e186e03fe6c25e0463a4bc5f5 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Mon, 8 Apr 2013 19:45:09 +0200 Subject: [PATCH 5/5] - FBX: silence some warnings produced by clang about missing switch cases. Add TokenType_BINARY_DATA to TokenTypeString() function. --- code/FBXConverter.cpp | 7 +++++++ code/FBXUtil.cpp | 3 +++ 2 files changed, 10 insertions(+) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index e91e61c28..b04d8881c 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -419,6 +419,8 @@ private: return "Scaling"; case TransformationComp_ScalingPivotInverse: return "ScalingPivotInverse"; + case TransformationComp_MAXIMUM: // this is to silence compiler warnings + break; } ai_assert(false); @@ -454,6 +456,8 @@ private: return "Lcl Scaling"; case TransformationComp_ScalingPivotInverse: return "ScalingPivotInverse"; + case TransformationComp_MAXIMUM: // this is to silence compiler warnings + break; } ai_assert(false); @@ -1608,6 +1612,9 @@ private: case FileGlobalSettings::FrameRate_CUSTOM: return customFPSVal; + + case FileGlobalSettings::FrameRate_MAX: // this is to silence compiler warnings + break; } ai_assert(false); diff --git a/code/FBXUtil.cpp b/code/FBXUtil.cpp index 8b6e9c806..aaf311d03 100644 --- a/code/FBXUtil.cpp +++ b/code/FBXUtil.cpp @@ -72,6 +72,9 @@ const char* TokenTypeString(TokenType t) case TokenType_KEY: return "TOK_KEY"; + + case TokenType_BINARY_DATA: + return "TOK_BINARY_DATA"; } ai_assert(false);