Fixes issues our internal compliance and code quality tool found:
* Adds nullptr checks and asserts to protect certain code paths * Fixes wrong integer type in a printf call * Adds const to const values * Prevents integer overflow with explicit casts
This commit is contained in:
@@ -170,7 +170,7 @@ void OptimizeGraphProcess::CollectNewChildren(aiNode *nd, std::list<aiNode *> &n
|
||||
++it;
|
||||
}
|
||||
if (join_master && !join.empty()) {
|
||||
join_master->mName.length = ::ai_snprintf(join_master->mName.data, MAXLEN, "$MergedNode_%i", count_merged++);
|
||||
join_master->mName.length = ::ai_snprintf(join_master->mName.data, MAXLEN, "$MergedNode_%u", count_merged++);
|
||||
|
||||
unsigned int out_meshes = 0;
|
||||
for (std::list<aiNode *>::const_iterator it = join.cbegin(); it != join.cend(); ++it) {
|
||||
|
||||
@@ -481,7 +481,7 @@ void PretransformVertices::Execute(aiScene *pScene) {
|
||||
pScene->mMeshes[i]->mNumBones = 0;
|
||||
}
|
||||
} else {
|
||||
apcOutMeshes.reserve(pScene->mNumMaterials << 1u);
|
||||
apcOutMeshes.reserve(static_cast<size_t>(pScene->mNumMaterials) << 1u);
|
||||
std::list<unsigned int> aiVFormats;
|
||||
|
||||
std::vector<unsigned int> s(pScene->mNumMeshes, 0);
|
||||
|
||||
@@ -127,7 +127,7 @@ void SortByPTypeProcess::Execute(aiScene *pScene) {
|
||||
unsigned int aiNumMeshesPerPType[4] = { 0, 0, 0, 0 };
|
||||
|
||||
std::vector<aiMesh *> outMeshes;
|
||||
outMeshes.reserve(pScene->mNumMeshes << 1u);
|
||||
outMeshes.reserve(static_cast<size_t>(pScene->mNumMeshes) << 1u);
|
||||
|
||||
bool bAnyChanges = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user