From 33b135d7fc381a22965586e0567ede4da11eade3 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 10 Nov 2009 20:59:05 +0000 Subject: use renamed header d_math.h -> e_sqrt.h svn path=/trunk/; revision=12748 --- externals/vanilla/d_math.c | 32 -------------------------------- externals/vanilla/d_math.h | 21 --------------------- externals/vanilla/dbtopow~.c | 2 +- externals/vanilla/dbtorms~.c | 2 +- externals/vanilla/e_sqrt.c | 32 ++++++++++++++++++++++++++++++++ externals/vanilla/e_sqrt.h | 21 +++++++++++++++++++++ externals/vanilla/powtodb~.c | 2 +- externals/vanilla/rmstodb~.c | 2 +- externals/vanilla/rsqrt~.c | 2 +- externals/vanilla/sqrt~.c | 2 +- 10 files changed, 59 insertions(+), 59 deletions(-) delete mode 100644 externals/vanilla/d_math.c delete mode 100644 externals/vanilla/d_math.h create mode 100644 externals/vanilla/e_sqrt.c create mode 100644 externals/vanilla/e_sqrt.h (limited to 'externals/vanilla') diff --git a/externals/vanilla/d_math.c b/externals/vanilla/d_math.c deleted file mode 100644 index eb011a4a..00000000 --- a/externals/vanilla/d_math.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 1997-2001 Miller Puckette and others. -* For information on usage and redistribution, and for a DISCLAIMER OF ALL -* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - -/* sqrt-related functions from pd-vanilla's d_math.c */ - -#include "e_sqrt.h" - - /* these are used in externs like "bonk" */ - -t_float q8_rsqrt(t_float f) -{ - long l = *(long *)(&f); - if (f < 0) return (0); - else return (rsqrt_exptab[(l >> 23) & 0xff] * - rsqrt_mantissatab[(l >> 13) & 0x3ff]); -} - -t_float q8_sqrt(t_float f) -{ - long l = *(long *)(&f); - if (f < 0) return (0); - else return (f * rsqrt_exptab[(l >> 23) & 0xff] * - rsqrt_mantissatab[(l >> 13) & 0x3ff]); -} - - /* the old names are OK unless we're in IRIX N32 */ - -#ifndef N32 -t_float qsqrt(t_float f) {return (q8_sqrt(f)); } -t_float qrsqrt(t_float f) {return (q8_rsqrt(f)); } -#endif diff --git a/externals/vanilla/d_math.h b/externals/vanilla/d_math.h deleted file mode 100644 index 29f9725c..00000000 --- a/externals/vanilla/d_math.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (c) 1997-2001 Miller Puckette and others. -* For information on usage and redistribution, and for a DISCLAIMER OF ALL -* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - -/* these are things used in a number of objectclasses from e_sqrt.c */ - -#include "m_pd.h" - -#define LOGTEN 2.302585092994 -#define DUMTAB1SIZE 256 -#define DUMTAB2SIZE 1024 - -#ifdef _WIN32 -#define int32 long -#else -#include -#define int32 int32_t -#endif - -t_float q8_sqrt(t_float f); -t_float q8_rsqrt(t_float f); diff --git a/externals/vanilla/dbtopow~.c b/externals/vanilla/dbtopow~.c index 777c5bf5..a50dfeb4 100644 --- a/externals/vanilla/dbtopow~.c +++ b/externals/vanilla/dbtopow~.c @@ -2,7 +2,7 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ -#include "d_math.h" +#include "e_sqrt.h" typedef struct dbtopow_tilde { diff --git a/externals/vanilla/dbtorms~.c b/externals/vanilla/dbtorms~.c index 854f6af7..13c5716d 100644 --- a/externals/vanilla/dbtorms~.c +++ b/externals/vanilla/dbtorms~.c @@ -2,7 +2,7 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ -#include "d_math.h" +#include "e_sqrt.h" typedef struct dbtorms_tilde { diff --git a/externals/vanilla/e_sqrt.c b/externals/vanilla/e_sqrt.c new file mode 100644 index 00000000..eb011a4a --- /dev/null +++ b/externals/vanilla/e_sqrt.c @@ -0,0 +1,32 @@ +/* Copyright (c) 1997-2001 Miller Puckette and others. +* For information on usage and redistribution, and for a DISCLAIMER OF ALL +* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ + +/* sqrt-related functions from pd-vanilla's d_math.c */ + +#include "e_sqrt.h" + + /* these are used in externs like "bonk" */ + +t_float q8_rsqrt(t_float f) +{ + long l = *(long *)(&f); + if (f < 0) return (0); + else return (rsqrt_exptab[(l >> 23) & 0xff] * + rsqrt_mantissatab[(l >> 13) & 0x3ff]); +} + +t_float q8_sqrt(t_float f) +{ + long l = *(long *)(&f); + if (f < 0) return (0); + else return (f * rsqrt_exptab[(l >> 23) & 0xff] * + rsqrt_mantissatab[(l >> 13) & 0x3ff]); +} + + /* the old names are OK unless we're in IRIX N32 */ + +#ifndef N32 +t_float qsqrt(t_float f) {return (q8_sqrt(f)); } +t_float qrsqrt(t_float f) {return (q8_rsqrt(f)); } +#endif diff --git a/externals/vanilla/e_sqrt.h b/externals/vanilla/e_sqrt.h new file mode 100644 index 00000000..29f9725c --- /dev/null +++ b/externals/vanilla/e_sqrt.h @@ -0,0 +1,21 @@ +/* Copyright (c) 1997-2001 Miller Puckette and others. +* For information on usage and redistribution, and for a DISCLAIMER OF ALL +* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ + +/* these are things used in a number of objectclasses from e_sqrt.c */ + +#include "m_pd.h" + +#define LOGTEN 2.302585092994 +#define DUMTAB1SIZE 256 +#define DUMTAB2SIZE 1024 + +#ifdef _WIN32 +#define int32 long +#else +#include +#define int32 int32_t +#endif + +t_float q8_sqrt(t_float f); +t_float q8_rsqrt(t_float f); diff --git a/externals/vanilla/powtodb~.c b/externals/vanilla/powtodb~.c index c6310b40..84883d4d 100644 --- a/externals/vanilla/powtodb~.c +++ b/externals/vanilla/powtodb~.c @@ -2,7 +2,7 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ -#include "d_math.h" +#include "e_sqrt.h" typedef struct powtodb_tilde { diff --git a/externals/vanilla/rmstodb~.c b/externals/vanilla/rmstodb~.c index a540877a..a8bac040 100644 --- a/externals/vanilla/rmstodb~.c +++ b/externals/vanilla/rmstodb~.c @@ -2,7 +2,7 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ -#include "d_math.h" +#include "e_sqrt.h" typedef struct rmstodb_tilde { diff --git a/externals/vanilla/rsqrt~.c b/externals/vanilla/rsqrt~.c index ce558f5c..e84f4c31 100644 --- a/externals/vanilla/rsqrt~.c +++ b/externals/vanilla/rsqrt~.c @@ -2,7 +2,7 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ -#include "d_math.h" +#include "e_sqrt.h" #include "m_pd.h" #include diff --git a/externals/vanilla/sqrt~.c b/externals/vanilla/sqrt~.c index ea3da693..65c09581 100644 --- a/externals/vanilla/sqrt~.c +++ b/externals/vanilla/sqrt~.c @@ -2,7 +2,7 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ -#include "d_math.h" +#include "e_sqrt.h" static float rsqrt_exptab[DUMTAB1SIZE], rsqrt_mantissatab[DUMTAB2SIZE]; -- cgit v1.2.1