aboutsummaryrefslogtreecommitdiff
path: root/pd/src/d_math.c
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2007-07-20 03:25:21 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2007-07-20 03:25:21 +0000
commit1e45c6bafc8419930958103cc1651ff86cf5d84d (patch)
tree260d94049e3302f7fc833abd7a8d3479f0631e49 /pd/src/d_math.c
parentdaa1933fed59113296b8e044fc370587b068aea9 (diff)
various bug fixes.
svn path=/trunk/; revision=8186
Diffstat (limited to 'pd/src/d_math.c')
-rw-r--r--pd/src/d_math.c13
1 files changed, 11 insertions, 2 deletions
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 <sys/types.h>
+#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++)