From f8eed0713059b5c4e8e56ba98b8a33fe2a472d84 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Mon, 3 Sep 2007 14:31:58 +0000 Subject: Checked ANSI C89 compliance (basically a few ifndefs for the C99 math functions: powf, roundf etc). Added a few PD examples/tests. --- examples/puredata/xtract~.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'examples/puredata/xtract~.c') diff --git a/examples/puredata/xtract~.c b/examples/puredata/xtract~.c index 26d349b..3f07cd3 100644 --- a/examples/puredata/xtract~.c +++ b/examples/puredata/xtract~.c @@ -27,6 +27,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define BLOCKSIZE 1024 /* FIX: this should be dynamic - somehow */ #define NYQUIST 22050.0f +#ifndef isnan + /* FIX: should probably try to handle signalling NaNs */ + int isnan(x){ if(x == x) return 0; else return 1;} +#endif + +#ifndef isinf + int isinf(x) {if(x == 1.0 / 0. || x == -1.0 / 0.) return 1; else return 0;} +#endif + static t_class *xtract_class; /* Struct for keeping track of memory allocations */ @@ -143,7 +152,7 @@ static void *xtract_new(t_symbol *me, t_int argc, t_atom *argv) { if(n_args){ for(n = 0; n < n_args; n++){ argv_max = &fd[f].argv.max[n]; - //post("Argument %d, max: %.2f", n, *argv_max); + /*post("Argument %d, max: %.2f", n, *argv_max); */ } if(type == XTRACT_MEL_FILTER){ x->memory.argv = (size_t)(n_args * sizeof(xtract_mel_filter)); @@ -249,9 +258,10 @@ static void xtract_tilde_show_help(t_xtract_tilde *x, t_symbol *s){ int i; - i = XTRACT_FEATURES; xtract_function_descriptor_t *fd, *d; + i = XTRACT_FEATURES; + fd = (xtract_function_descriptor_t *)xtract_make_descriptors(); post("\nxtract~: Feature List\n"); -- cgit v1.2.3