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. --- source/blender/blenlib/intern/BLI_kdopbvh.c | 8 +++++--- source/blender/blenlib/intern/noise.c | 10 ++++++---- source/blender/blenlib/intern/path_util.c | 4 ++-- source/blender/blenlib/intern/storage.c | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index a91c24471bb..39f6e7a8aba 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -196,14 +196,14 @@ int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_ // http://ralphunden.net/content/tutorials/a-guide-to-introsort/ // and he derived it from the SUN STL ////////////////////////////////////////////////////////////////////////////////////////////////////// -static int size_threshold = 16; +//static int size_threshold = 16; /* * Common methods for all algorithms */ -static int floor_lg(int a) +/*static int floor_lg(int a) { return (int)(floor(log(a)/log(2))); -} +}*/ /* * Insertion sort algorithm @@ -243,6 +243,7 @@ static int bvh_partition(BVHNode **a, int lo, int hi, BVHNode * x, int axis) /* * Heapsort algorithm */ +#if 0 static void bvh_downheap(BVHNode **a, int i, int n, int lo, int axis) { BVHNode * d = a[lo+i-1]; @@ -274,6 +275,7 @@ static void bvh_heapsort(BVHNode **a, int lo, int hi, int axis) bvh_downheap(a, 1,i-1,lo, axis); } } +#endif static BVHNode *bvh_medianof3(BVHNode **a, int lo, int mid, int hi, int axis) // returns Sortable { diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index 66e9a65dba5..53389950734 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -43,8 +43,8 @@ /* local */ static float noise3_perlin(float vec[3]); -static float turbulence_perlin(float *point, float lofreq, float hifreq); -static float turbulencep(float noisesize, float x, float y, float z, int nr); +//static float turbulence_perlin(float *point, float lofreq, float hifreq); +//static float turbulencep(float noisesize, float x, float y, float z, int nr); #define HASHVEC(x,y,z) hashvectf+3*hash[ (hash[ (hash[(z) & 255]+(y)) & 255]+(x)) & 255] @@ -976,6 +976,7 @@ static float noise3_perlin(float vec[3]) return 1.5 * lerp(sz, c, d); /* interpolate in z */ } +#if 0 static float turbulence_perlin(float *point, float lofreq, float hifreq) { float freq, t, p[3]; @@ -993,6 +994,7 @@ static float turbulence_perlin(float *point, float lofreq, float hifreq) } return t - 0.3; /* readjust to make mean value = 0.0 */ } +#endif /* for use with BLI_gNoise/gTurbulence, returns signed noise */ static float orgPerlinNoise(float x, float y, float z) @@ -1029,7 +1031,7 @@ float BLI_hnoisep(float noisesize, float x, float y, float z) return noise3_perlin(vec); } -static float turbulencep(float noisesize, float x, float y, float z, int nr) +/*static float turbulencep(float noisesize, float x, float y, float z, int nr) { float vec[3]; @@ -1038,7 +1040,7 @@ static float turbulencep(float noisesize, float x, float y, float z, int nr) vec[2]= z/noisesize; nr++; return turbulence_perlin(vec, 1.0, (float)(1<