Explicitly use nullptr
This commit is contained in:
@@ -44,23 +44,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
aiNode::aiNode()
|
||||
: mName("")
|
||||
, mParent(NULL)
|
||||
, mParent(nullptr)
|
||||
, mNumChildren(0)
|
||||
, mChildren(NULL)
|
||||
, mChildren(nullptr)
|
||||
, mNumMeshes(0)
|
||||
, mMeshes(NULL)
|
||||
, mMetaData(NULL) {
|
||||
, mMeshes(nullptr)
|
||||
, mMetaData(nullptr) {
|
||||
// empty
|
||||
}
|
||||
|
||||
aiNode::aiNode(const std::string& name)
|
||||
: mName(name)
|
||||
, mParent(NULL)
|
||||
, mParent(nullptr)
|
||||
, mNumChildren(0)
|
||||
, mChildren(NULL)
|
||||
, mChildren(nullptr)
|
||||
, mNumMeshes(0)
|
||||
, mMeshes(NULL)
|
||||
, mMetaData(NULL) {
|
||||
, mMeshes(nullptr)
|
||||
, mMetaData(nullptr) {
|
||||
// empty
|
||||
}
|
||||
|
||||
|
||||
@@ -1134,7 +1134,7 @@ namespace Assimp {
|
||||
binormals = &tempBinormals;
|
||||
}
|
||||
else {
|
||||
binormals = NULL;
|
||||
binormals = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1184,7 +1184,7 @@ namespace Assimp {
|
||||
ConvertMaterialForMesh(out_mesh, model, mesh, mindices[0]);
|
||||
}
|
||||
|
||||
if (doc.Settings().readWeights && mesh.DeformerSkin() != NULL) {
|
||||
if (doc.Settings().readWeights && mesh.DeformerSkin() != nullptr) {
|
||||
ConvertWeights(out_mesh, model, mesh, absolute_transform, parent, root_node, NO_MATERIAL_SEPARATION,
|
||||
nullptr);
|
||||
}
|
||||
@@ -1264,7 +1264,7 @@ namespace Assimp {
|
||||
const std::vector<aiVector3D>& vertices = mesh.GetVertices();
|
||||
const std::vector<unsigned int>& faces = mesh.GetFaceIndexCounts();
|
||||
|
||||
const bool process_weights = doc.Settings().readWeights && mesh.DeformerSkin() != NULL;
|
||||
const bool process_weights = doc.Settings().readWeights && mesh.DeformerSkin() != nullptr;
|
||||
|
||||
unsigned int count_faces = 0;
|
||||
unsigned int count_vertices = 0;
|
||||
@@ -1324,7 +1324,7 @@ namespace Assimp {
|
||||
binormals = &tempBinormals;
|
||||
}
|
||||
else {
|
||||
binormals = NULL;
|
||||
binormals = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1513,9 +1513,9 @@ namespace Assimp {
|
||||
|
||||
unsigned int count = 0;
|
||||
const unsigned int* const out_idx = geo.ToOutputVertexIndex(index, count);
|
||||
// ToOutputVertexIndex only returns NULL if index is out of bounds
|
||||
// ToOutputVertexIndex only returns nullptr if index is out of bounds
|
||||
// which should never happen
|
||||
ai_assert(out_idx != NULL);
|
||||
ai_assert(out_idx != nullptr);
|
||||
|
||||
index_out_indices.push_back(no_index_sentinel);
|
||||
count_out_indices.push_back(0);
|
||||
@@ -1586,7 +1586,7 @@ namespace Assimp {
|
||||
std::string deformer_name = cl->TargetNode()->Name();
|
||||
aiString bone_name = aiString(FixNodeName(deformer_name));
|
||||
|
||||
aiBone *bone = NULL;
|
||||
aiBone *bone = nullptr;
|
||||
|
||||
if (bone_map.count(deformer_name)) {
|
||||
std::cout << "retrieved bone from lookup " << bone_name.C_Str() << ". Deformer: " << deformer_name
|
||||
@@ -2740,7 +2740,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa
|
||||
// sanity check whether the input is ok
|
||||
static void validateAnimCurveNodes(const std::vector<const AnimationCurveNode*>& curves,
|
||||
bool strictMode) {
|
||||
const Object* target(NULL);
|
||||
const Object* target(nullptr);
|
||||
for (const AnimationCurveNode* node : curves) {
|
||||
if (!target) {
|
||||
target = node->Target();
|
||||
@@ -2771,7 +2771,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa
|
||||
#ifdef ASSIMP_BUILD_DEBUG
|
||||
validateAnimCurveNodes(curves, doc.Settings().strictMode);
|
||||
#endif
|
||||
const AnimationCurveNode* curve_node = NULL;
|
||||
const AnimationCurveNode* curve_node = nullptr;
|
||||
for (const AnimationCurveNode* node : curves) {
|
||||
ai_assert(node);
|
||||
|
||||
@@ -3619,7 +3619,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa
|
||||
ai_assert(!out->mMeshes);
|
||||
ai_assert(!out->mNumMeshes);
|
||||
|
||||
// note: the trailing () ensures initialization with NULL - not
|
||||
// note: the trailing () ensures initialization with nullptr - not
|
||||
// many C++ users seem to know this, so pointing it out to avoid
|
||||
// confusion why this code works.
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ aiNode *ArmaturePopulate::GetArmatureRoot(aiNode *bone_node,
|
||||
|
||||
ASSIMP_LOG_WARN("GetArmatureRoot() can't find armature!");
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Simple IsBoneNode check if this could be a bone */
|
||||
@@ -139,7 +139,7 @@ bool ArmaturePopulate::IsBoneNode(const aiString &bone_name,
|
||||
aiNode *ArmaturePopulate::GetNodeFromStack(const aiString &node_name,
|
||||
std::vector<aiNode *> &nodes) {
|
||||
std::vector<aiNode *>::iterator iter;
|
||||
aiNode *found = NULL;
|
||||
aiNode *found = nullptr;
|
||||
for (iter = nodes.begin(); iter < nodes.end(); ++iter) {
|
||||
aiNode *element = *iter;
|
||||
ai_assert(element);
|
||||
@@ -150,13 +150,13 @@ aiNode *ArmaturePopulate::GetNodeFromStack(const aiString &node_name,
|
||||
}
|
||||
}
|
||||
|
||||
if (found != NULL) {
|
||||
if (found != nullptr) {
|
||||
// now pop the element from the node list
|
||||
nodes.erase(iter);
|
||||
|
||||
return found;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Prepare flat node list which can be used for non recursive lookups later */
|
||||
@@ -233,10 +233,10 @@ void ArmaturePopulate::BuildBoneStack(aiNode *current_node,
|
||||
for (aiBone *bone : bones) {
|
||||
ai_assert(bone);
|
||||
aiNode *node = GetNodeFromStack(bone->mName, node_stack);
|
||||
if (node == NULL) {
|
||||
if (node == nullptr) {
|
||||
node_stack.clear();
|
||||
BuildNodeList(root_node, node_stack);
|
||||
ASSIMP_LOG_DEBUG_F("Resetting bone stack: null element %s\n", bone->mName.C_Str());
|
||||
ASSIMP_LOG_DEBUG_F("Resetting bone stack: nullptr element %s\n", bone->mName.C_Str());
|
||||
|
||||
node = GetNodeFromStack(bone->mName, node_stack);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user