From a2d37998c5ea1c5712cb15d9d9ad885371ee4b5d Mon Sep 17 00:00:00 2001 From: Daniel Heckenberg Date: Sun, 9 Mar 2003 11:10:53 +0000 Subject: Minor changes for compilation using Visual C++ 6.0 (SP3) under Windows ncluding: - no array declaration with variable size - fixed signed/unsigned comparison warnings svn path=/trunk/externals/ext13/; revision=460 --- scramble~.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'scramble~.c') diff --git a/scramble~.c b/scramble~.c index dd9414d..11c0793 100644 --- a/scramble~.c +++ b/scramble~.c @@ -2,12 +2,14 @@ #include "ext13.h" #include #include -#include +#ifndef NT +#include +#include +#include #include -#include -#include - - +#else +#include +#endif /* ------------------------ scramble_tilde~ ----------------------------- */ @@ -109,9 +111,13 @@ t_int *scramble_tilde_perform(t_int *w) int erg=0; int n; t_float val, valL, valR, killval; - +#ifndef NT t_float* out[x->x_channels]; t_float* in[x->x_channels]; +#else + t_float** out = (t_float**)malloc(x->x_channels*sizeof(t_float*)); + t_float** in = (t_float**)malloc(x->x_channels*sizeof(t_float*)); +#endif float n_factor, frac, a, b, c, d, cminusb; int index; @@ -441,7 +447,11 @@ t_int *scramble_tilde_perform(t_int *w) if (x->x_channels == 2) *out[1]++ = 0; }/*end if play */ - }/*end while n-- */ + }/*end while n-- */ +#ifdef NT + free(in); + free(out); +#endif return (w + x->x_channels * 2 + 3); } @@ -529,7 +539,7 @@ static void *scramble_tilde_new(t_floatarg c,t_floatarg b) return (x); } -void *scramble_tilde_float(t_scramble_tilde* x, t_float n){ +void scramble_tilde_float(t_scramble_tilde* x, t_float n){ x->play = n; if (x->playmode == 2) { x->n_grain = (int)n - 1; @@ -537,12 +547,12 @@ void *scramble_tilde_float(t_scramble_tilde* x, t_float n){ } } -void *scramble_tilde_buffer(t_scramble_tilde* x, t_float n){ +void scramble_tilde_buffer(t_scramble_tilde* x, t_float n){ if (n > 64) x->x_n = (int)n; // post ("buffersize now:%d",x->x_n); } -void *scramble_tilde_threshold(t_scramble_tilde* x, t_float t){ +void scramble_tilde_threshold(t_scramble_tilde* x, t_float t){ if (t >0) { x->lowborder = t; x->autofollow = 0; @@ -552,7 +562,7 @@ void *scramble_tilde_threshold(t_scramble_tilde* x, t_float t){ } -void *scramble_tilde_grains(t_scramble_tilde* x, t_float g){ +void scramble_tilde_grains(t_scramble_tilde* x, t_float g){ if ((g > 1) && (g < 2048) ) x->newgrains = (int)g; else post ("scramble~: minimum # of grains must be 2 an maximum # is 2048"); } -- cgit v1.2.1