diff options
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 11 | ||||
-rw-r--r-- | source/blender/blenlib/intern/graph.c | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index a21252d9aa8..a9e1e80a403 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -34,6 +34,7 @@ /* ************************ FUNKTIES **************************** */ +#include <stdlib.h> #include <math.h> #include <sys/types.h> #include <string.h> @@ -62,13 +63,13 @@ #define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } #define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c) - -#if defined(WIN32) || defined(__APPLE__) -#include <stdlib.h> +#ifndef M_PI #define M_PI 3.14159265358979323846 -#define M_SQRT2 1.41421356237309504880 +#endif -#endif /* defined(WIN32) || defined(__APPLE__) */ +#ifndef M_SQRT2 +#define M_SQRT2 1.41421356237309504880 +#endif float saacos(float fac) diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c index 03a565ef0bf..de9c8860c6a 100644 --- a/source/blender/blenlib/intern/graph.c +++ b/source/blender/blenlib/intern/graph.c @@ -279,7 +279,7 @@ void BLI_removeDoubleNodes(BGraph *graph, float limit) BNode * BLI_FindNodeByPosition(BGraph *graph, float *p, float limit) { BNode *closest_node = NULL, *node; - float min_distance; + float min_distance = 0.0f; for(node = graph->nodes.first; node; node = node->next) { |