diff options
author | Daniel Heckenberg <dheck@users.sourceforge.net> | 2003-03-09 11:10:53 +0000 |
---|---|---|
committer | Daniel Heckenberg <dheck@users.sourceforge.net> | 2003-03-09 11:10:53 +0000 |
commit | a2d37998c5ea1c5712cb15d9d9ad885371ee4b5d (patch) | |
tree | 989e6f7306ad5beaf44756c0c45cbade9957805d /scramble~.c | |
parent | 23da6252985418ada3083303f3847817a23044fb (diff) |
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
Diffstat (limited to 'scramble~.c')
-rw-r--r-- | scramble~.c | 32 |
1 files changed, 21 insertions, 11 deletions
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 <sys/types.h> #include <string.h> -#include <sys/errno.h> +#ifndef NT +#include <netinet/in.h>
+#include <netdb.h>
+#include <sys/errno.h>
#include <sys/socket.h> -#include <netinet/in.h> -#include <netdb.h> - - +#else
+#include <stdlib.h>
+#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"); } |