Skip to content

Commit

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

Fix warning related to unreachable-code-break.
  • Loading branch information
kimkulling authored Apr 20, 2023
2 parents b1afa41 + 1b826af commit 87a288e
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion code/AssetLib/Collada/ColladaParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,6 @@ size_t ColladaParser::ReadPrimitives(XmlNode &node, Mesh &pMesh, std::vector<Inp
default:
// LineStrip is not supported due to expected index unmangling
throw DeadlyImportError("Unsupported primitive type.");
break;
}

// store the face size to later reconstruct the face from
Expand Down
1 change: 0 additions & 1 deletion code/AssetLib/LWO/LWOBLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ void LWOImporter::LoadLWOBFile()
if (mFileBuffer + head.length > end)
{
throw DeadlyImportError("LWOB: Invalid chunk length");
break;
}
uint8_t* const next = mFileBuffer+head.length;
switch (head.type)
Expand Down
1 change: 0 additions & 1 deletion code/AssetLib/LWO/LWOLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,6 @@ void LWOImporter::LoadLWO2File() {

if (mFileBuffer + head.length > end) {
throw DeadlyImportError("LWO2: Chunk length points behind the file");
break;
}
uint8_t *const next = mFileBuffer + head.length;
mFileBuffer += bufOffset;
Expand Down
2 changes: 1 addition & 1 deletion code/AssetLib/Obj/ObjFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void ObjFileParser::parseFile(IOStreamBuffer<char> &streamBuffer) {
getNameNoSpace(m_DataIt, m_DataItEnd, name);
insideCstype = name == "cstype";
goto pf_skip_line;
} break;
}

default: {
pf_skip_line:
Expand Down
3 changes: 1 addition & 2 deletions code/AssetLib/Q3D/Q3DLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,10 @@ void Q3DImporter::InternReadFile(const std::string &pFile,

// TODO
goto outer;
} break;
}

default:
throw DeadlyImportError("Quick3D: Unknown chunk");
break;
};
}
outer:
Expand Down
1 change: 0 additions & 1 deletion code/AssetLib/X/XFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,6 @@ void XFileParser::ParseDataObjectAnimationKey(AnimBone *pAnimBone) {

default:
ThrowException("Unknown key type ", keyType, " in animation.");
break;
} // end switch

// key separator
Expand Down
1 change: 0 additions & 1 deletion code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,6 @@ IF (ASSIMP_WARNINGS_AS_ERRORS)
-Wno-deprecated
-Wno-format-nonliteral
-Wno-comma
-Wno-unreachable-code-break
-Wno-implicit-fallthrough
-Wno-unused-template
-Wno-undefined-func-template
Expand Down
1 change: 0 additions & 1 deletion code/PostProcessing/ValidateDataStructure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ void ValidateDSProcess::Validate(const aiMesh *pMesh) {
switch (face.mNumIndices) {
case 0:
ReportError("aiMesh::mFaces[%i].mNumIndices is 0", i);
break;
case 1:
if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_POINT)) {
ReportError("aiMesh::mFaces[%i] is a POINT but aiMesh::mPrimitiveTypes "
Expand Down

0 comments on commit 87a288e

Please sign in to comment.