From 1dcb5da1cd0e40e65bdeabb118d9a9fec3aa9e8a Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:01:22 +0800 Subject: [PATCH 1/4] Fix warning related to unreachable-code. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- code/AssetLib/B3D/B3DImporter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/code/AssetLib/B3D/B3DImporter.cpp b/code/AssetLib/B3D/B3DImporter.cpp index e877446032..bf8145798e 100644 --- a/code/AssetLib/B3D/B3DImporter.cpp +++ b/code/AssetLib/B3D/B3DImporter.cpp @@ -418,7 +418,6 @@ void B3DImporter::ReadTRIS(int v0) { ASSIMP_LOG_ERROR("Bad triangle index: i0=", i0, ", i1=", i1, ", i2=", i2); #endif Fail("Bad triangle index"); - continue; } face->mNumIndices = 3; face->mIndices = new unsigned[3]; From 04066ece8e5c1f1f5fed6167ab0e1fd9564f333e Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:02:04 +0800 Subject: [PATCH 2/4] Fix warning related to unreachable-code. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- code/AssetLib/LWO/LWOMaterial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/LWO/LWOMaterial.cpp b/code/AssetLib/LWO/LWOMaterial.cpp index 50bac884bc..8d83dfb676 100644 --- a/code/AssetLib/LWO/LWOMaterial.cpp +++ b/code/AssetLib/LWO/LWOMaterial.cpp @@ -345,7 +345,7 @@ void LWOImporter::ConvertMaterial(const LWO::Surface &surf, aiMaterial *pcMat) { // (the diffuse value is just a scaling factor) // If a diffuse texture is set, we set this value to 1.0 - clr = (b && false ? aiColor3D(1.0, 1.0, 1.0) : surf.mColor); + clr = (b ? aiColor3D(1.0, 1.0, 1.0) : surf.mColor); clr.r *= surf.mDiffuseValue; clr.g *= surf.mDiffuseValue; clr.b *= surf.mDiffuseValue; From 4d2512dcae8b181a8f61e2d068f3f331ea0e935a Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:03:02 +0800 Subject: [PATCH 3/4] Fix warning related to unreachable-code. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- contrib/poly2tri/poly2tri/sweep/sweep.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/poly2tri/poly2tri/sweep/sweep.cc b/contrib/poly2tri/poly2tri/sweep/sweep.cc index 8e3d794c0a..565a198d8a 100644 --- a/contrib/poly2tri/poly2tri/sweep/sweep.cc +++ b/contrib/poly2tri/poly2tri/sweep/sweep.cc @@ -118,8 +118,8 @@ void Sweep::EdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* triangl Point* p1 = triangle->PointCCW(point); Orientation o1 = Orient2d(eq, *p1, ep); if (o1 == COLLINEAR) { - // ASSIMP_CHANGE (aramis_acg) - throw std::runtime_error("EdgeEvent - collinear points not supported"); + + if( triangle->Contains(&eq, p1)) { triangle->MarkConstrainedEdge(&eq, p1 ); // We are modifying the constraint maybe it would be better to @@ -137,8 +137,8 @@ void Sweep::EdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* triangl Point* p2 = triangle->PointCW(point); Orientation o2 = Orient2d(eq, *p2, ep); if (o2 == COLLINEAR) { - // ASSIMP_CHANGE (aramis_acg) - throw std::runtime_error("EdgeEvent - collinear points not supported"); + + if( triangle->Contains(&eq, p2)) { triangle->MarkConstrainedEdge(&eq, p2 ); From 20b2f857c592ea5594a9c53b45a75333e8ae49ca Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:04:13 +0800 Subject: [PATCH 4/4] Remove -Wno-unreachable-code Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- code/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index fd3b1cb881..aead2d1a09 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1250,7 +1250,6 @@ IF (ASSIMP_WARNINGS_AS_ERRORS) -Wno-comma -Wno-unreachable-code-break -Wno-unreachable-code-return - -Wno-unreachable-code -Wno-implicit-fallthrough -Wno-unused-template -Wno-undefined-func-template