From 40c308af4423429452e0ee03fb3d50bc60a5d6c0 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Mon, 18 Sep 2017 15:18:45 +0300 Subject: [PATCH] glTF: Silence uninitialized variable warning This is a false positive. 'jointNamesIndex' is either set by the loop or the following conditional is false which also sets it. The undefined value is never seen by the following code. --- code/glTF2Exporter.cpp | 2 +- code/glTFExporter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp index a3940e9..bcd1e28 100644 --- a/code/glTF2Exporter.cpp +++ b/code/glTF2Exporter.cpp @@ -541,7 +541,7 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref& meshRef, Ref nodeRef = mAsset.nodes.Get(aib->mName.C_Str()); nodeRef->jointName = nodeRef->name; - unsigned int jointNamesIndex; + unsigned int jointNamesIndex = 0; bool addJointToJointNames = true; for ( unsigned int idx_joint = 0; idx_joint < skinRef->jointNames.size(); ++idx_joint) { if (skinRef->jointNames[idx_joint]->jointName.compare(nodeRef->jointName) == 0) { diff --git a/code/glTFExporter.cpp b/code/glTFExporter.cpp index 7215a98..a5df09a 100644 --- a/code/glTFExporter.cpp +++ b/code/glTFExporter.cpp @@ -444,7 +444,7 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref& meshRef, Ref nodeRef = mAsset.nodes.Get(aib->mName.C_Str()); nodeRef->jointName = nodeRef->id; - unsigned int jointNamesIndex; + unsigned int jointNamesIndex = 0; bool addJointToJointNames = true; for ( unsigned int idx_joint = 0; idx_joint < skinRef->jointNames.size(); ++idx_joint) { if (skinRef->jointNames[idx_joint]->jointName.compare(nodeRef->jointName) == 0) { -- 2.7.4