From ec7df03c867d28316708e9b91bec5cef0aee832e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 8 Feb 2010 13:55:31 +0000 Subject: Warning fixes, one actual bug found in sequencer sound wave drawing. Also changed some malloc to MEM_mallocN while trying to track down a memory leak. --- intern/audaspace/FX/AUD_FaderReader.cpp | 2 +- intern/opennl/superlu/get_perm_c.c | 1 + intern/smoke/intern/FLUID_3D.cpp | 6 +----- intern/smoke/intern/FLUID_3D_STATIC.cpp | 6 ++---- 4 files changed, 5 insertions(+), 10 deletions(-) (limited to 'intern') diff --git a/intern/audaspace/FX/AUD_FaderReader.cpp b/intern/audaspace/FX/AUD_FaderReader.cpp index 6c7ea6e0a01..4e919fff323 100644 --- a/intern/audaspace/FX/AUD_FaderReader.cpp +++ b/intern/audaspace/FX/AUD_FaderReader.cpp @@ -78,7 +78,7 @@ void AUD_FaderReader::read(int & length, sample_t* & buffer) else { sample_t* buf = m_buffer->getBuffer(); - float volume; + float volume = 1.0f; for(int i = 0; i < length * specs.channels; i++) { diff --git a/intern/opennl/superlu/get_perm_c.c b/intern/opennl/superlu/get_perm_c.c index 4c0ee95c4c6..64061725f10 100644 --- a/intern/opennl/superlu/get_perm_c.c +++ b/intern/opennl/superlu/get_perm_c.c @@ -409,6 +409,7 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c) return; default: ABORT("Invalid ISPEC"); + return; } if ( bnz != 0 ) { diff --git a/intern/smoke/intern/FLUID_3D.cpp b/intern/smoke/intern/FLUID_3D.cpp index 25673630fc4..4ac960b5ef0 100644 --- a/intern/smoke/intern/FLUID_3D.cpp +++ b/intern/smoke/intern/FLUID_3D.cpp @@ -204,16 +204,13 @@ void FLUID_3D::initBlenderRNA(float *alpha, float *beta) ////////////////////////////////////////////////////////////////////// void FLUID_3D::step() { - - int threadval = 1; #if PARALLEL==1 + int threadval = 1; threadval = omp_get_max_threads(); -#endif int stepParts = 1; float partSize = _zRes; -#if PARALLEL==1 stepParts = threadval*2; // Dividing parallelized sections into numOfThreads * 2 sections partSize = (float)_zRes/stepParts; // Size of one part; @@ -935,7 +932,6 @@ void FLUID_3D::addVorticity(int zBegin, int zEnd) float *_xVorticity, *_yVorticity, *_zVorticity, *_vorticity; - int _vIndex = _slabSize + _xRes + 1; int bb=0; int bt=0; int bb1=-1; diff --git a/intern/smoke/intern/FLUID_3D_STATIC.cpp b/intern/smoke/intern/FLUID_3D_STATIC.cpp index 89ac2c74e15..6a27541f432 100644 --- a/intern/smoke/intern/FLUID_3D_STATIC.cpp +++ b/intern/smoke/intern/FLUID_3D_STATIC.cpp @@ -57,7 +57,6 @@ void FLUID_3D::addSmokeTestCase(float* field, Vec3Int res) float xTotal = dx * res[0]; float yTotal = dx * res[1]; - float zTotal = dx * res[2]; float heighMin = 0.05; float heighMax = 0.10; @@ -408,11 +407,11 @@ void FLUID_3D::advectFieldSemiLagrange(const float dt, const float* velx, const void FLUID_3D::advectFieldMacCormack1(const float dt, const float* xVelocity, const float* yVelocity, const float* zVelocity, float* oldField, float* tempResult, Vec3Int res, int zBegin, int zEnd) { - const int sx= res[0]; + /*const int sx= res[0]; const int sy= res[1]; const int sz= res[2]; - /*for (int x = 0; x < sx * sy * sz; x++) + for (int x = 0; x < sx * sy * sz; x++) phiHatN[x] = phiHatN1[x] = oldField[x];*/ // not needed as all the values are written first float*& phiN = oldField; @@ -433,7 +432,6 @@ void FLUID_3D::advectFieldMacCormack2(const float dt, const float* xVelocity, co float* t1 = temp1; const int sx= res[0]; const int sy= res[1]; - const int sz= res[2]; float*& phiN = oldField; float*& phiN1 = newField; -- cgit v1.2.3