From 1e45c6bafc8419930958103cc1651ff86cf5d84d Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Fri, 20 Jul 2007 03:25:21 +0000 Subject: various bug fixes. svn path=/trunk/; revision=8186 --- pd/src/d_math.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'pd/src/d_math.c') diff --git a/pd/src/d_math.c b/pd/src/d_math.c index e04a6738..44f23e3d 100644 --- a/pd/src/d_math.c +++ b/pd/src/d_math.c @@ -67,6 +67,15 @@ static void clip_setup(void) #define DUMTAB1SIZE 256 #define DUMTAB2SIZE 1024 +#ifdef MSW +#define int32 long +#endif + +#if defined(__unix__) || defined(__APPLE__) +#include +#define int32 int32_t +#endif + static float rsqrt_exptab[DUMTAB1SIZE], rsqrt_mantissatab[DUMTAB2SIZE]; static void init_rsqrt(void) @@ -75,8 +84,8 @@ static void init_rsqrt(void) for (i = 0; i < DUMTAB1SIZE; i++) { float f; - long l = (i ? (i == DUMTAB1SIZE-1 ? DUMTAB1SIZE-2 : i) : 1)<< 23; - *(long *)(&f) = l; + int32 l = (i ? (i == DUMTAB1SIZE-1 ? DUMTAB1SIZE-2 : i) : 1)<< 23; + *(int32 *)(&f) = l; rsqrt_exptab[i] = 1./sqrt(f); } for (i = 0; i < DUMTAB2SIZE; i++) -- cgit v1.2.1