From 4a05094c9a009707674c079c0481eaf8e1f8490f Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 8 Oct 2011 17:22:41 +0000 Subject: converted float to t_float to support double-precision Pd, creb still needs to separate t_float and t_sample tho svn path=/trunk/externals/creb/; revision=15546 --- modules/abs~.c | 6 +++--- modules/bfft~.c | 16 ++++++++-------- modules/bitsplit~.c | 6 +++--- modules/blocknorm~.c | 6 +++--- modules/bmatrix~.c | 6 +++--- modules/cheby~.c | 4 ++-- modules/diag~.c | 6 +++--- modules/dist~.c | 4 ++-- modules/dwt~.c | 20 ++++++++++---------- modules/dynwav~.c | 12 ++++++------ modules/eadsr~.c | 2 +- modules/ead~.c | 2 +- modules/ear~.c | 2 +- modules/eblosc~.c | 34 +++++++++++++++++----------------- modules/fdn~.c | 22 +++++++++++----------- modules/ffpoly.c | 2 +- modules/fwarp.c | 4 ++-- modules/junction~.c | 12 ++++++------ modules/lattice~.c | 4 ++-- modules/permut~.c | 6 +++--- modules/ramp~.c | 6 +++--- modules/resofilt~.c | 20 ++++++++++---------- modules/scrollgrid1D~.c | 14 +++++++------- modules/xfm~.c | 16 ++++++++-------- 24 files changed, 116 insertions(+), 116 deletions(-) (limited to 'modules') diff --git a/modules/abs~.c b/modules/abs~.c index 0cb3d4d..71c57ef 100644 --- a/modules/abs~.c +++ b/modules/abs~.c @@ -16,12 +16,12 @@ typedef struct _abs static t_int *abs_perform(t_int *w) { t_abs *x = (t_abs *)(w[1]); - t_float *in = (t_float *)(w[2]); - t_float *out = (t_float *)(w[3]); + t_sample *in = (t_sample *)(w[2]); + t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) { - float f = *in++; + t_sample f = *in++; if (f < 0) f = -f; *out++ = f; } diff --git a/modules/bfft~.c b/modules/bfft~.c index b57f028..ae39ff1 100644 --- a/modules/bfft~.c +++ b/modules/bfft~.c @@ -102,11 +102,11 @@ static t_int *bfft_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_bfftctl *ctl = (t_bfftctl *)(w[1]); t_int n = (t_int)(w[2]); - t_float scale = sqrt(1.0f / (float)(n)); + t_float scale = sqrt(1.0f / (t_float)(n)); mayer_fht(out, n); bfft_perform_permutation(out, n, ctl->c_unclutter); @@ -123,11 +123,11 @@ static t_int *ibfft_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_bfftctl *ctl = (t_bfftctl *)(w[1]); t_int n = (t_int)(w[2]); - t_float scale = sqrt(1.0f / (float)(n)); + t_float scale = sqrt(1.0f / (t_float)(n)); if (ctl->c_kill_DC) {out[0] = 0.0f;} @@ -149,8 +149,8 @@ static t_int *fht_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_bfftctl *ctl = (t_bfftctl *)(w[1]); diff --git a/modules/bitsplit~.c b/modules/bitsplit~.c index e89b078..bed3750 100644 --- a/modules/bitsplit~.c +++ b/modules/bitsplit~.c @@ -51,9 +51,9 @@ static t_int *bitsplit_perform(t_int *word) t_int i,j; for (i=0;i> 31) & 1); + out[j][i] = (t_float)((word >> 31) & 1); word <<= 1; } } @@ -90,7 +90,7 @@ static void *bitsplit_new(t_floatarg channels) if (i<1) i = 1; if (i>MAXCHANNELS) i = MAXCHANNELS; x->x_ctl.c_outputs = i; - x->x_ctl.c_output = malloc(sizeof(float)*i); + x->x_ctl.c_output = malloc(sizeof(t_float)*i); while (i--) outlet_new(&x->x_obj, gensym("signal")); diff --git a/modules/blocknorm~.c b/modules/blocknorm~.c index 1c8e3df..5f90081 100644 --- a/modules/blocknorm~.c +++ b/modules/blocknorm~.c @@ -65,7 +65,7 @@ static t_int *blocknorm_perform(t_int *word) /* compute normalization */ if (p == 0.0f) s = 1.0f; - else s =sqrt(((float)(c * n)) / p); + else s =sqrt(((t_float)(c * n)) / p); /* normalize */ for (j=0;jMAXCHANNELS) i = MAXCHANNELS; x->x_ctl.c_channels = i; - x->x_ctl.c_input = malloc(sizeof(float)*i); - x->x_ctl.c_output = malloc(sizeof(float)*i); + x->x_ctl.c_input = malloc(sizeof(t_float)*i); + x->x_ctl.c_output = malloc(sizeof(t_float)*i); j = i; while (--j) inlet_new(&x->x_obj, &x->x_obj.ob_pd, diff --git a/modules/bmatrix~.c b/modules/bmatrix~.c index b59d4d6..81802ed 100644 --- a/modules/bmatrix~.c +++ b/modules/bmatrix~.c @@ -52,7 +52,7 @@ static void matrix_load(t_matrix *x, t_symbol *s) if(matrix = fopen(s->s_name, "r")) { int n = x->x_ctl.c_order; - fread(x->x_ctl.c_A, sizeof(float), n*n, matrix); + fread(x->x_ctl.c_A, sizeof(t_float), n*n, matrix); } else post("matrix: error, cant open file."); } @@ -63,8 +63,8 @@ static t_int *matrix_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_matrixctl *ctl = (t_matrixctl *)(w[1]); t_int n = (t_int)(w[2]); diff --git a/modules/cheby~.c b/modules/cheby~.c index 7bf97b2..7010e36 100644 --- a/modules/cheby~.c +++ b/modules/cheby~.c @@ -56,8 +56,8 @@ static t_int *cheby_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_chebyctl *ctl = (t_chebyctl *)(w[1]); t_float *gain = ctl->c_gain; t_int i; diff --git a/modules/diag~.c b/modules/diag~.c index 1e6bd96..c8a94c5 100644 --- a/modules/diag~.c +++ b/modules/diag~.c @@ -68,7 +68,7 @@ static void diag_time(t_diag *x, t_floatarg index, t_floatarg time) time *= 0.001; if (time < 0.0f) time = 0.0f; - r = pow(0.001f, (float)x->x_ctl.c_order / (time * sys_getsr())); + r = pow(0.001f, (t_float)x->x_ctl.c_order / (time * sys_getsr())); if (r < 0.0f) r = 0.0f; if (r > 1.0f) r = 1.0f; @@ -105,8 +105,8 @@ static t_int *diag_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_diagctl *ctl = (t_diagctl *)(w[1]); t_float *eigen = ctl->c_eigen; diff --git a/modules/dist~.c b/modules/dist~.c index 1206b17..3002b94 100644 --- a/modules/dist~.c +++ b/modules/dist~.c @@ -65,8 +65,8 @@ static t_int *dist_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_distctl *ctl = (t_distctl *)(w[1]); t_float gain = ctl->c_gain; t_int i; diff --git a/modules/dwt~.c b/modules/dwt~.c index 9ab3bcc..9634002 100644 --- a/modules/dwt~.c +++ b/modules/dwt~.c @@ -298,7 +298,7 @@ static void dwt_filter(t_dwt *x, t_symbol *s, int argc, t_atom *argv) -static inline void dwtloop(float *vector, +static inline void dwtloop(t_float *vector, int source, int dest, int increment, @@ -331,7 +331,7 @@ static inline void dwtloop(float *vector, } -static inline void dwtloop16(float *vector, +static inline void dwtloop16(t_float *vector, int source, int dest, int increment, @@ -430,8 +430,8 @@ static t_int *dwt_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_dwtctl *ctl = (t_dwtctl *)(w[1]); @@ -499,8 +499,8 @@ static t_int *idwt_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_dwtctl *ctl = (t_dwtctl *)(w[1]); @@ -567,8 +567,8 @@ static t_int *dwt16_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_dwtctl *ctl = (t_dwtctl *)(w[1]); @@ -636,8 +636,8 @@ static t_int *idwt16_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_dwtctl *ctl = (t_dwtctl *)(w[1]); diff --git a/modules/dynwav~.c b/modules/dynwav~.c index 3645f58..c04f56d 100644 --- a/modules/dynwav~.c +++ b/modules/dynwav~.c @@ -47,9 +47,9 @@ static t_int *dynwav_perform(t_int *w) { - t_float *wave = (float *)(w[3]); - t_float *freq = (float *)(w[4]); - t_float *out = (float *)(w[5]); + t_float *wave = (t_float *)(w[3]); + t_float *freq = (t_float *)(w[4]); + t_float *out = (t_float *)(w[5]); t_dynwavctl *ctl = (t_dynwavctl *)(w[1]); t_int n = (t_int)(w[2]); @@ -113,9 +113,9 @@ static t_int *dynwav_perform_8point(t_int *w) { - t_float *wave = (float *)(w[3]); - t_float *freq = (float *)(w[4]); - t_float *out = (float *)(w[5]); + t_float *wave = (t_float *)(w[3]); + t_float *freq = (t_float *)(w[4]); + t_float *out = (t_float *)(w[5]); t_dynwavctl *ctl = (t_dynwavctl *)(w[1]); t_int n = (t_int)(w[2]); diff --git a/modules/eadsr~.c b/modules/eadsr~.c index d2a1968..59a9e7c 100644 --- a/modules/eadsr~.c +++ b/modules/eadsr~.c @@ -81,7 +81,7 @@ void eadsr_float(t_eadsr *x, t_floatarg f) static t_int *eadsr_perform(t_int *w) { - t_float *out = (float *)(w[3]); + t_float *out = (t_float *)(w[3]); t_eadsrctl *ctl = (t_eadsrctl *)(w[1]); t_float attack = ctl->c_attack; t_float decay = ctl->c_decay; diff --git a/modules/ead~.c b/modules/ead~.c index 3d79312..6a9c64c 100644 --- a/modules/ead~.c +++ b/modules/ead~.c @@ -69,7 +69,7 @@ static t_int *ead_perform(t_int *w) { /* interprete arguments */ - t_float *out = (float *)(w[3]); + t_float *out = (t_float *)(w[3]); t_eadctl *ctl = (t_eadctl *)(w[1]); t_float attack = ctl->c_attack; t_float decay = ctl->c_decay; diff --git a/modules/ear~.c b/modules/ear~.c index 28fe097..fcdddae 100644 --- a/modules/ear~.c +++ b/modules/ear~.c @@ -65,7 +65,7 @@ void ear_float(t_ear *x, t_floatarg f) static t_int *ear_perform(t_int *w) { - t_float *out = (float *)(w[3]); + t_float *out = (t_float *)(w[3]); t_earctl *ctl = (t_earctl *)(w[1]); t_float attack = ctl->c_attack; t_float release = ctl->c_release; diff --git a/modules/eblosc~.c b/modules/eblosc~.c index b2c6199..45b2c38 100644 --- a/modules/eblosc~.c +++ b/modules/eblosc~.c @@ -65,9 +65,9 @@ typedef struct eblosc /* phase converters */ static inline float _phase_to_float(u32 p){ - return ((float)p) * (1.0f / 4294967296.0f); + return ((t_float)p) * (1.0f / 4294967296.0f); } -static inline u32 _float_to_phase(float f){ +static inline u32 _float_to_phase(t_float f){ return (u32)(f * 4294967296.0f); } @@ -151,7 +151,7 @@ static void _bang_comparator(t_ebloscctl *ctl, float prev, float curr) /* determine the location of the discontinuity (in oversampled coordiates using linear interpolation */ - float f = (float)S * curr / (curr - prev); + float f = (t_float)S * curr / (curr - prev); /* get the offset in the oversample table */ @@ -160,7 +160,7 @@ static void _bang_comparator(t_ebloscctl *ctl, float prev, float curr) /* determine the fractional part (in oversampled coordinates) for linear interpolation */ - float table_frac_index = f - (float)table_index; + float table_frac_index = f - (t_float)table_index; /* set state (+ or -) */ @@ -226,7 +226,7 @@ static void _bang_phasor(t_ebloscctl *ctl, float freq) * fraction */ ctl->c_index[voice] = table_index; - ctl->c_frac[voice] = (float)table_phase / (float)phase_inc_decimated; + ctl->c_frac[voice] = (t_float)table_phase / (t_float)phase_inc_decimated; ctl->c_vscale[voice] = scale; scale = scale * ctl->c_scale_update; @@ -319,12 +319,12 @@ static void _bang_hardsync_phasor(t_ebloscctl *ctl, float freq, float freq2) prevent overflow */ stepsize = _phase_to_float(((oldphase-phase) >> LOVERSAMPLE) - + phase_inc_decimated) * (float)S; + + phase_inc_decimated) * (t_float)S; /* use it to initialize the new voice index and interpolation fraction */ ctl->c_index[voice] = table_index; - ctl->c_frac[voice] = (float)table_phase / (float)phase_inc_decimated; + ctl->c_frac[voice] = (t_float)table_phase / (t_float)phase_inc_decimated; ctl->c_vscale[voice] = scale * stepsize; scale = scale * ctl->c_scale_update; @@ -339,9 +339,9 @@ static void _bang_hardsync_phasor(t_ebloscctl *ctl, float freq, float freq2) static t_int *eblosc_perform_hardsync_saw(t_int *w) { - t_float *freq = (float *)(w[3]); - t_float *freq2 = (float *)(w[4]); - t_float *out = (float *)(w[5]); + t_float *freq = (t_float *)(w[3]); + t_float *freq2 = (t_float *)(w[4]); + t_float *out = (t_float *)(w[5]); t_ebloscctl *ctl = (t_ebloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; @@ -376,8 +376,8 @@ static t_int *eblosc_perform_hardsync_saw(t_int *w) static t_int *eblosc_perform_saw(t_int *w) { - t_float *freq = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *freq = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_ebloscctl *ctl = (t_ebloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; @@ -406,8 +406,8 @@ static t_int *eblosc_perform_saw(t_int *w) static t_int *eblosc_perform_pulse(t_int *w) { - t_float *freq = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *freq = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_ebloscctl *ctl = (t_ebloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; @@ -439,8 +439,8 @@ static t_int *eblosc_perform_pulse(t_int *w) static t_int *eblosc_perform_comparator(t_int *w) { - t_float *amp = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *amp = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_ebloscctl *ctl = (t_ebloscctl *)(w[1]); t_int n = (t_int)(w[2]); t_int i; @@ -494,7 +494,7 @@ static void eblosc_dsp(t_eblosc *x, t_signal **sp) int n = sp[0]->s_n; /* set sampling rate scaling for phasors */ - x->x_ctl.c_phase_inc_scale = 4.0f * (float)(1<<(LPHASOR-2)) / sys_getsr(); + x->x_ctl.c_phase_inc_scale = 4.0f * (t_float)(1<<(LPHASOR-2)) / sys_getsr(); /* setup & register the correct process routine depending on the waveform */ diff --git a/modules/fdn~.c b/modules/fdn~.c index aa67d74..68a7723 100644 --- a/modules/fdn~.c +++ b/modules/fdn~.c @@ -132,10 +132,10 @@ static void fdn_reset(t_fdn *x) int i; if (x->x_ctl.c_buf) memset(x->x_ctl.c_buf, 0, x->x_ctl.c_bufsize - * sizeof(float)); + * sizeof(t_float)); if (x->x_ctl.c_vectorbuffer) memset(x->x_ctl.c_vectorbuffer, - 0, x->x_ctl.c_maxorder * 2 * sizeof(float)); + 0, x->x_ctl.c_maxorder * 2 * sizeof(t_float)); } @@ -145,9 +145,9 @@ static t_int *fdn_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *outr = (float *)(w[4]); - t_float *outl = (float *)(w[5]); + t_float *in = (t_float *)(w[3]); + t_float *outr = (t_float *)(w[4]); + t_float *outl = (t_float *)(w[5]); t_fdnctl *ctl = (t_fdnctl *)(w[1]); t_int n = (t_int)(w[2]); t_float input = ctl->c_input; @@ -378,7 +378,7 @@ static void fdn_linear(t_fdn *x, t_float forder, t_float min, t_float max) if (min <= 0) return; if (max <= 0) return; - inc = (max - min) / (float)(order - 1); + inc = (max - min) / (t_float)(order - 1); length = min; for (i=0; ix_ctl.c_maxorder = order; - x->x_ctl.c_buf = (float *)malloc(sizeof(float) * bufsize); + x->x_ctl.c_buf = (t_float *)malloc(sizeof(t_float) * bufsize); x->x_ctl.c_bufsize = bufsize; x->x_ctl.c_fsample = sys_getsr(); x->x_ctl.c_tap = (t_int *)malloc((order + 1) * sizeof(t_int)); x->x_ctl.c_length = (t_float *)malloc(order * sizeof(t_int)); x->x_ctl.c_gain_in = (t_float *)malloc(order * sizeof(t_float)); x->x_ctl.c_gain_state = (t_float *)malloc(order * sizeof(t_float)); - x->x_ctl.c_vectorbuffer = (t_float *)malloc(order * 2 * sizeof(float)); - memset(x->x_ctl.c_vectorbuffer, 0, order * 2 * sizeof(float)); + x->x_ctl.c_vectorbuffer = (t_float *)malloc(order * 2 * sizeof(t_float)); + memset(x->x_ctl.c_vectorbuffer, 0, order * 2 * sizeof(t_float)); x->x_ctl.c_curvector = 0; x->x_ctl.c_vector[0] = &x->x_ctl.c_vectorbuffer[0]; x->x_ctl.c_vector[1] = &x->x_ctl.c_vectorbuffer[order]; diff --git a/modules/ffpoly.c b/modules/ffpoly.c index 097891c..844a96c 100644 --- a/modules/ffpoly.c +++ b/modules/ffpoly.c @@ -63,7 +63,7 @@ static void ffpoly_compute(t_ffpoly *x, t_floatarg fcoef) } - outlet_float(x->x_outlet, (float)out); + outlet_float(x->x_outlet, (t_float)out); } diff --git a/modules/fwarp.c b/modules/fwarp.c index 28fe024..089edf2 100644 --- a/modules/fwarp.c +++ b/modules/fwarp.c @@ -32,8 +32,8 @@ typedef struct fwarp static void fwarp_float(t_fwarp *x, t_floatarg f) { - float twopi = 2.0f * M_PI; - float sr = sys_getsr(); + t_float twopi = 2.0f * M_PI; + t_float sr = sys_getsr(); f /= sr; f = tan(twopi * f) / twopi; outlet_float(x->x_out, f * sr); diff --git a/modules/junction~.c b/modules/junction~.c index 71476da..8ffd801 100644 --- a/modules/junction~.c +++ b/modules/junction~.c @@ -101,7 +101,7 @@ static t_int *junction_perform(t_int *w) mayer_realfft(c, buf); for (j=1; jx_ctl.c_channels; - float norm; + t_float norm; for (i=0;ix_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); for (i=0;ix_obj, gensym("signal")); - x->x_ctl.c_in = (float **)malloc(n*sizeof(float *)); - x->x_ctl.c_out = (float **)malloc(n*sizeof(float *)); - x->x_ctl.c_buffer = (float *)malloc(n*sizeof(float)); - x->x_ctl.c_coef = (float *)malloc(n*sizeof(float)); + x->x_ctl.c_in = (t_float **)malloc(n*sizeof(t_float *)); + x->x_ctl.c_out = (t_float **)malloc(n*sizeof(t_float *)); + x->x_ctl.c_buffer = (t_float *)malloc(n*sizeof(t_float)); + x->x_ctl.c_coef = (t_float *)malloc(n*sizeof(t_float)); x->x_ctl.c_channels = n; junction_bang(x); diff --git a/modules/lattice~.c b/modules/lattice~.c index 28adf19..3568ea7 100644 --- a/modules/lattice~.c +++ b/modules/lattice~.c @@ -50,8 +50,8 @@ static t_int *lattice_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_latticectl *ctl = (t_latticectl *)(w[1]); t_int i,j; t_int n = (t_int)(w[2]); diff --git a/modules/permut~.c b/modules/permut~.c index 7a4f101..402d007 100644 --- a/modules/permut~.c +++ b/modules/permut~.c @@ -93,7 +93,7 @@ static void permut_random(t_permut *x, t_floatarg seed) static void permut_bang(t_permut *x) { unsigned int r = rand(); - //permut_random(x, *((float *)(&r))); + //permut_random(x, *((t_float *)(&r))); permut_random(x, ((t_flint)r).f); } @@ -120,8 +120,8 @@ static t_int *permut_perform(t_int *w) { - t_float *in = (float *)(w[3]); - t_float *out = (float *)(w[4]); + t_float *in = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); t_permutctl *ctl = (t_permutctl *)(w[1]); t_int i; t_int n = (t_int)(w[2]); diff --git a/modules/ramp~.c b/modules/ramp~.c index 526ec4e..e4d5ed4 100644 --- a/modules/ramp~.c +++ b/modules/ramp~.c @@ -51,20 +51,20 @@ void ramp_bang(t_ramp *x) static t_int *ramp_perform(t_int *w) { - t_float *out = (float *)(w[3]); + t_float *out = (t_float *)(w[3]); t_rampctl *ctl = (t_rampctl *)(w[1]); t_int i; t_int n = (t_int)(w[2]); t_float x; - t_float scale = ctl->c_blockscale ? 1.0f / (float)n : 1.0f; + t_float scale = ctl->c_blockscale ? 1.0f / (t_float)n : 1.0f; x = ctl->c_offset; for (i = 0; i < n; i++) { - *out++ = ((float)x++) * scale; + *out++ = ((t_float)x++) * scale; } ctl->c_offset = x; /* save state */ diff --git a/modules/resofilt~.c b/modules/resofilt~.c index 0227dfc..09f1a72 100644 --- a/modules/resofilt~.c +++ b/modules/resofilt~.c @@ -69,13 +69,13 @@ static t_int *resofilt_perform_fourpole(t_int *w) t_resofiltctl *ctl = (t_resofiltctl *)(w[1]); t_int n = (t_int)(w[2]); - t_float *in = (float *)(w[3]); - t_float *freq = (float *)(w[4]); - t_float *reso = (float *)(w[5]); - t_float *out = (float *)(w[6]); + t_float *in = (t_float *)(w[3]); + t_float *freq = (t_float *)(w[4]); + t_float *reso = (t_float *)(w[5]); + t_float *out = (t_float *)(w[6]); int i; - t_float inv_n = 1.0f / ((float)n); + t_float inv_n = 1.0f / ((t_float)n); t_float inv_sr = 1.0f / sys_getsr(); t_float phasor[2], phasor_rot[2]; @@ -212,13 +212,13 @@ static t_int *resofilt_perform_threepole(t_int *w) t_resofiltctl *ctl = (t_resofiltctl *)(w[1]); t_int n = (t_int)(w[2]); - t_float *in = (float *)(w[3]); - t_float *freq = (float *)(w[4]); - t_float *reso = (float *)(w[5]); - t_float *out = (float *)(w[6]); + t_float *in = (t_float *)(w[3]); + t_float *freq = (t_float *)(w[4]); + t_float *reso = (t_float *)(w[5]); + t_float *out = (t_float *)(w[6]); int i; - t_float inv_n = 1.0f / ((float)n); + t_float inv_n = 1.0f / ((t_float)n); t_float inv_sr = 1.0f / sys_getsr(); t_float phasor[2], phasor_rot[2]; diff --git a/modules/scrollgrid1D~.c b/modules/scrollgrid1D~.c index d47bb51..d59a101 100644 --- a/modules/scrollgrid1D~.c +++ b/modules/scrollgrid1D~.c @@ -75,13 +75,13 @@ static t_int *scrollgrid1D_perform(t_int *w) { - t_float *freq = (float *)(w[3]); - t_float *t1 = (float *)(w[4]); - t_float *t2 = (float *)(w[5]); - t_float *order = (float *)(w[6]); - t_float *outx = (float *)(w[7]); - t_float *outy = (float *)(w[8]); - t_float *outz = (float *)(w[9]); + t_float *freq = (t_float *)(w[3]); + t_float *t1 = (t_float *)(w[4]); + t_float *t2 = (t_float *)(w[5]); + t_float *order = (t_float *)(w[6]); + t_float *outx = (t_float *)(w[7]); + t_float *outy = (t_float *)(w[8]); + t_float *outz = (t_float *)(w[9]); t_scrollgrid1Dctl *ctl = (t_scrollgrid1Dctl *)(w[1]); t_int n = (t_int)(w[2]); diff --git a/modules/xfm~.c b/modules/xfm~.c index 63c79ab..f66831d 100644 --- a/modules/xfm~.c +++ b/modules/xfm~.c @@ -88,8 +88,8 @@ void xfm_type(t_xfm *x, t_float f) static inline t_float xfm_sat(t_float x) { - const float max = 1; - const float min = -1; + const t_float max = 1; + const t_float min = -1; x = (x > max) ? (max) : (x); x = (x < min) ? (min) : (x); @@ -101,12 +101,12 @@ static t_int *xfm_perform(t_int *w) { - t_float *inA = (float *)(w[3]); - t_float *inB = (float *)(w[4]); - t_float *fbA = (float *)(w[5]); - t_float *fbB = (float *)(w[6]); - t_float *outA = (float *)(w[7]); - t_float *outB = (float *)(w[8]); + t_float *inA = (t_float *)(w[3]); + t_float *inB = (t_float *)(w[4]); + t_float *fbA = (t_float *)(w[5]); + t_float *fbB = (t_float *)(w[6]); + t_float *outA = (t_float *)(w[7]); + t_float *outB = (t_float *)(w[8]); t_xfmctl *ctl = (t_xfmctl *)(w[1]); t_int n = (t_int)(w[2]); //t_float *tab = ctl->c_sintab; -- cgit v1.2.1