aboutsummaryrefslogtreecommitdiff
path: root/examples/puredata/xtract~.c
diff options
context:
space:
mode:
authorJamie Bullock <jamie@postlude.co.uk>2007-09-03 14:31:58 +0000
committerJamie Bullock <jamie@postlude.co.uk>2007-09-03 14:31:58 +0000
commitf8eed0713059b5c4e8e56ba98b8a33fe2a472d84 (patch)
tree3d77ea00cb55394fce82811fad29aaa258bdf776 /examples/puredata/xtract~.c
parentff80e419ed5ce6291eefa90dc01b22939d15b0d0 (diff)
downloadLibXtract-f8eed0713059b5c4e8e56ba98b8a33fe2a472d84.tar.gz
LibXtract-f8eed0713059b5c4e8e56ba98b8a33fe2a472d84.tar.bz2
LibXtract-f8eed0713059b5c4e8e56ba98b8a33fe2a472d84.zip
Checked ANSI C89 compliance (basically a few ifndefs for the C99 math functions: powf, roundf etc). Added a few PD examples/tests.
Diffstat (limited to 'examples/puredata/xtract~.c')
-rw-r--r--examples/puredata/xtract~.c14
1 files changed, 12 insertions, 2 deletions
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");