From 9b591fadb870dbd7b09a0858d4976ff7cda9ae3d Mon Sep 17 00:00:00 2001 From: Sherief Farouk Date: Fri, 9 Aug 2013 19:52:15 -0400 Subject: [PATCH] Fixes for uninitialized variable warnings. --- code/FBXBinaryTokenizer.cpp | 3 ++- code/FBXConverter.cpp | 2 +- code/MaterialSystem.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/FBXBinaryTokenizer.cpp b/code/FBXBinaryTokenizer.cpp index c7fdb8374..b5f151c15 100644 --- a/code/FBXBinaryTokenizer.cpp +++ b/code/FBXBinaryTokenizer.cpp @@ -232,7 +232,7 @@ void ReadData(const char*& sbegin_out, const char*& send_out, const char* input, // compute length based on type and check against the stored value if(encoding == 0) { - uint32_t stride; + uint32_t stride = 0; switch(type) { case 'f': @@ -248,6 +248,7 @@ void ReadData(const char*& sbegin_out, const char*& send_out, const char* input, default: ai_assert(false); }; + ai_assert(stride > 0); if(length * stride != comp_len) { TokenizeError("cannot ReadData, calculated data stride differs from what the file claims",input, cursor); } diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 3ad6790f7..342c5f144 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -1848,7 +1848,7 @@ private: }} #endif - const AnimationCurveNode* curve_node; + const AnimationCurveNode* curve_node = NULL; BOOST_FOREACH(const AnimationCurveNode* node, curves) { ai_assert(node); diff --git a/code/MaterialSystem.cpp b/code/MaterialSystem.cpp index 36100ec48..50c403fe1 100644 --- a/code/MaterialSystem.cpp +++ b/code/MaterialSystem.cpp @@ -102,7 +102,7 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, } // data is given in floats, simply copy it - unsigned int iWrite; + unsigned int iWrite = 0; if( aiPTI_Float == prop->mType || aiPTI_Buffer == prop->mType) { iWrite = prop->mDataLength / sizeof(float); if (pMax) { @@ -175,7 +175,7 @@ aiReturn aiGetMaterialIntegerArray(const aiMaterial* pMat, } // data is given in ints, simply copy it - unsigned int iWrite; + unsigned int iWrite = 0; if( aiPTI_Integer == prop->mType || aiPTI_Buffer == prop->mType) { iWrite = prop->mDataLength / sizeof(int32_t); if (pMax) {