Skip to content

Commit

Permalink
Merge pull request assimp#5042 from Jackie9527/msvc-clang-unreachable…
Browse files Browse the repository at this point in the history
…-code

Fix warning related to unreachable-code.
  • Loading branch information
kimkulling authored Apr 4, 2023
2 parents 17d8e99 + 1733d9f commit 8705940
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion code/AssetLib/B3D/B3DImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/LWO/LWOMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,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
Expand Down
8 changes: 4 additions & 4 deletions contrib/poly2tri/poly2tri/sweep/sweep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 );
Expand Down

0 comments on commit 8705940

Please sign in to comment.