Fixes for uninitialized variable warnings.

pull/76/head^2
Sherief Farouk 2013-08-09 19:52:15 -04:00
parent a90e208e6d
commit 9b591fadb8
3 changed files with 5 additions and 4 deletions

View File

@ -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);
}

View File

@ -1848,7 +1848,7 @@ private:
}}
#endif
const AnimationCurveNode* curve_node;
const AnimationCurveNode* curve_node = NULL;
BOOST_FOREACH(const AnimationCurveNode* node, curves) {
ai_assert(node);

View File

@ -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) {