Commit f09ad326 authored by Jonathan Wilkes's avatar Jonathan Wilkes

Merge branch 't_int-casts-squashed'

parents a7adef65 03494071
Pipeline #1694 passed with stage
in 349 minutes and 51 seconds
......@@ -547,7 +547,7 @@ void autotune_dsp(t_autotune *x, t_signal **sp, short *count)
if(x->fs != sp[0]->s_sr) autotune_init(x, sp[0]->s_sr);
dsp_add(autotune_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
dsp_add(autotune_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, (t_int)sp[0]->s_n);
}
......
......@@ -230,7 +230,8 @@ static t_int *bassemu_perform(t_int *ww)
static void bassemu_dsp(t_bassemu *x, t_signal **sp)
{
x->sr = sp[0]->s_sr;
dsp_add(bassemu_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
dsp_add(bassemu_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec,
(t_int)sp[0]->s_n);
}
static void recalc(t_bassemu *x)
......
......@@ -99,7 +99,7 @@ static t_int *aenv_perform(t_int *w)
static void aenv_dsp(t_aenv *x, t_signal **sp)
{
dsp_add(aenv_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
dsp_add(aenv_perform, 3, x, sp[0]->s_vec, (t_int)sp[0]->s_n);
}
static void aenv_float(t_aenv *x, t_float f)
......
......@@ -65,6 +65,7 @@ typedef struct _partconv {
int nbins;
int nparts;
int ir_prepared;
int hosed; /* set if our array doesn't exist */
int pd_blocksize;
// partitions of impulse response
......@@ -121,6 +122,16 @@ static void partconv_deal_work(t_partconv *x)
#include "altivec-perform.inc.c"
#else
static t_int *partconv_perform_hosed(t_int *w)
{
t_float *out = (t_float *)(w[3]);
int n = (int)(w[4]);
int i;
for (i = 0; i < n; i++)
out[i] = 0;
return (w+5);
}
static t_int *partconv_perform(t_int *w)
{
t_partconv *x = (t_partconv *)(w[1]);
......@@ -132,7 +143,6 @@ static t_int *partconv_perform(t_int *w)
int k; // bin
int p; // partition
int endpart;
#ifdef USE_SSE
int v1;
int v2;
......@@ -148,7 +158,6 @@ static t_int *partconv_perform(t_int *w)
float *sumbuf1ptr;
float *sumbuf2ptr;
memcpy(&(x->inbuf[x->inbufpos]), in, n*sizeof(float)); // gather a block of input into input buffer
x->inbufpos += n;
if (x->inbufpos >= x->partsize) {
......@@ -235,13 +244,12 @@ static t_int *partconv_perform(t_int *w)
static void partconv_free(t_partconv *x)
{
int i;
fftwf_free(x->inbuf);
for (i = 0; i < x->nparts; i++)
fftwf_free(x->irpart_td[i]);
fftwf_free(x->input_td);
fftwf_destroy_plan(x->input_plan);
for (i = 0; i < x->nsumbufs; i++) {
for (i = 0; i < x->nsumbufs; i++) {
fftwf_free(x->sumbufs[i].fd);
fftwf_destroy_plan(x->sumbufs[i].plan);
}
......@@ -259,20 +267,25 @@ static void partconv_set(t_partconv *x, t_symbol *s)
// get the array from pd
x->arrayname = s;
if ( ! (arrayobj = (t_garray *)pd_findbyclass(x->arrayname, garray_class))) {
if (*x->arrayname->s_name) {
pd_error(x, "partconv~: %s: no such array", x->arrayname->s_name);
return;
}
x->hosed = 1;
if (x->arrayname && *x->arrayname->s_name)
pd_error(x, "partconv~: %s: no such array",
x->arrayname->s_name);
else
pd_error(x, "partconv~: need an array name");
return;
} else if ( ! garray_getfloatarray(arrayobj, &arraysize, &array)) {
x->hosed = 1;
pd_error(x, "%s: bad template", x->arrayname->s_name);
return;
} else {
x->hosed = 0;
}
// if the IR has already been prepared, free everything first
if (x->ir_prepared == 1) {
partconv_free(x);
}
// caculate number of partitions
x->nparts = arraysize / x->partsize;
if (arraysize % x->partsize != 0)
......@@ -336,8 +349,12 @@ static void partconv_dsp(t_partconv *x, t_signal **sp)
if (x->ir_prepared == 0) {
partconv_set(x, x->arrayname);
}
dsp_add(partconv_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
if (x->hosed)
dsp_add(partconv_perform_hosed, 4, x, sp[0]->s_vec,
sp[1]->s_vec, (t_int)sp[0]->s_n);
else
dsp_add(partconv_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec,
(t_int)sp[0]->s_n);
}
static void *partconv_new(t_symbol *s, int argc, t_atom *argv)
......@@ -352,11 +369,12 @@ static void *partconv_new(t_symbol *s, int argc, t_atom *argv)
instantiate and get to the help patch */
if (!argc)
{
post("partconv~: warning: no arguments given");
SETSYMBOL(sane_defaults, &s_);
SETFLOAT(sane_defaults+1, 2.);
SETFLOAT(sane_defaults+1, 64.);
argc = 2;
argv = sane_defaults;
pd_error(x, "partconv~: no arguments given. Setting some "
"sane defaults to keep Purr Data from crashing.");
}
else
{
......
......@@ -258,7 +258,7 @@ static t_int *pvoc_perform(t_int *w)
static void pvoc_dsp(t_pvoc *x, t_signal **sp)
{
dsp_add(pvoc_perform, 5, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n);
dsp_add(pvoc_perform, 5, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, (t_int)sp[0]->s_n);
}
// adapted from jsarlo's windowing library
......
......@@ -88,7 +88,7 @@ static t_int *susloop_perform(t_int *w)
static void susloop_dsp(t_susloop *x, t_signal **sp)
{
dsp_add(susloop_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
dsp_add(susloop_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, (t_int)sp[0]->s_n);
}
static void *susloop_new(t_symbol *s, int argc, t_atom *argv)
......
......@@ -124,7 +124,7 @@ static t_int *svf_perform(t_int *w)
static void svf_dsp(t_svf *x, t_signal **sp)
{
dsp_add(svf_perform, 7, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[4]->s_vec, sp[0]->s_n);
dsp_add(svf_perform, 7, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[4]->s_vec, (t_int)sp[0]->s_n);
}
static void *svf_new(t_symbol *s, int argc, t_atom *argv)
......
......@@ -59,7 +59,7 @@ static t_int *zhzxh_perform(t_int *w)
static void zhzxh_dsp(t_zhzxh *x, t_signal **sp)
{
dsp_add(zhzxh_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
dsp_add(zhzxh_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, (t_int)sp[0]->s_n);
}
static void *zhzxh_new(t_symbol *s, int argc, t_atom *argv)
......
......@@ -77,7 +77,7 @@ static t_int *biquadseries_perform(t_int *w)
static void biquadseries_dsp(t_biquadseries *x, t_signal **sp)
{
dsp_add(biquadseries_perform, 4, x->biquadseries, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(biquadseries_perform, 4, x->biquadseries, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
}
void biquadseries_free(void)
......
......@@ -478,30 +478,30 @@ static void blosc_dsp(t_blosc *x, t_signal **sp)
if (x->x_ctl.c_waveform == gensym("syncsaw")){
x->x_ctl.c_scale = 1.0;
x->x_ctl.c_scale_update = 1.0;
dsp_add(blosc_perform_hardsync_saw, 5, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec);
dsp_add(blosc_perform_hardsync_saw, 5, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec);
}
/* 1 osc */
else if (x->x_ctl.c_waveform == gensym("pulse")){
x->x_ctl.c_scale = 1.0;
x->x_ctl.c_scale_update = 1.0;
dsp_add(blosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(blosc_perform_pulse, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
}
else if (x->x_ctl.c_waveform == gensym("pulse2")){
x->x_ctl.c_phase_inc_scale *= 2;
x->x_ctl.c_scale = 1.0;
x->x_ctl.c_scale_update = -1.0;
dsp_add(blosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(blosc_perform_pulse, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
}
else if (x->x_ctl.c_waveform == gensym("comparator")){
x->x_ctl.c_scale = 1.0;
x->x_ctl.c_scale_update = 1.0;
dsp_add(blosc_perform_comparator, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(blosc_perform_comparator, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
}
else{
x->x_ctl.c_scale = 1.0;
x->x_ctl.c_scale_update = 1.0;
dsp_add(blosc_perform_saw, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(blosc_perform_saw, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
}
......
......@@ -68,7 +68,8 @@ static t_int *filterortho_perform(t_int *w)
static void filterortho_dsp(t_filterortho *x, t_signal **sp)
{
dsp_add(filterortho_perform, 4, x->filterortho, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(filterortho_perform, 4, x->filterortho, (t_int)sp[0]->s_n,
sp[0]->s_vec, sp[1]->s_vec);
}
void filterortho_free(t_filterortho *x)
......
......@@ -30,7 +30,7 @@ static t_int *abs_perform(t_int *w)
static void abs_dsp(t_abs *x, t_signal **sp)
{
dsp_add(abs_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
dsp_add(abs_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, (t_int)sp[0]->s_n);
}
static void *abs_new(void)
......
......@@ -215,7 +215,7 @@ static void bdiag_dsp(t_bdiag *x, t_signal **sp)
}
dsp_add(bdiag_perform, 4, &x->x_ctl, sp[0]->s_n,
dsp_add(bdiag_perform, 4, &x->x_ctl, (t_int)sp[0]->s_n,
sp[0]->s_vec, sp[1]->s_vec);
}
......
......@@ -177,7 +177,7 @@ static void bfft_dsp(t_bfft *x, t_signal **sp)
in = out;
}
dsp_add(bfft_perform, 4, &x->x_ctl, n, in, out);
dsp_add(bfft_perform, 4, &x->x_ctl, (t_int)n, in, out);
}
......@@ -196,7 +196,7 @@ static void ibfft_dsp(t_bfft *x, t_signal **sp)
in = out;
}
dsp_add(ibfft_perform, 4, &x->x_ctl, n, in, out);
dsp_add(ibfft_perform, 4, &x->x_ctl, (t_int)n, in, out);
}
......@@ -214,7 +214,7 @@ static void fht_dsp(t_bfft *x, t_signal **sp)
in = out;
}
dsp_add(fht_perform, 4, &x->x_ctl, n, in, out);
dsp_add(fht_perform, 4, &x->x_ctl, (t_int)n, in, out);
}
......
......@@ -71,7 +71,7 @@ static void bitsplit_dsp(t_bitsplit *x, t_signal **sp)
for (i=0;i<x->x_ctl.c_outputs;i++){
x->x_ctl.c_output[i] = sp[i+1]->s_vec;
}
dsp_add(bitsplit_perform, 2, &x->x_ctl, sp[0]->s_n);
dsp_add(bitsplit_perform, 2, &x->x_ctl, (t_int)sp[0]->s_n);
}
......
......@@ -90,7 +90,7 @@ static void blocknorm_dsp(t_blocknorm *x, t_signal **sp)
x->x_ctl.c_input[i] = sp[i]->s_vec;
x->x_ctl.c_output[i] = sp[c+i]->s_vec;
}
dsp_add(blocknorm_perform, 2, &x->x_ctl, sp[0]->s_n);
dsp_add(blocknorm_perform, 2, &x->x_ctl, (t_int)sp[0]->s_n);
}
......
......@@ -102,7 +102,8 @@ static void matrix_dsp(t_matrix *x, t_signal **sp)
for (i=0;i<n;i++) x->x_ctl.c_A[i] = 1;
dsp_add(matrix_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(matrix_perform, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec,
sp[1]->s_vec);
}
......
......@@ -138,7 +138,7 @@ static void window_dsp(t_window *x, t_signal **sp)
window_type(x, x->x_type, x->x_typearg);
}
dsp_add(window_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, n);
dsp_add(window_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, (t_int)n);
}
static void window_free(t_window *x)
......
......@@ -91,7 +91,7 @@ static t_int *cheby_perform(t_int *w)
static void cheby_dsp(t_cheby *x, t_signal **sp)
{
dsp_add(cheby_perform, 4, &x->x_ctl, sp[0]->s_n,
dsp_add(cheby_perform, 4, &x->x_ctl, (t_int)sp[0]->s_n,
sp[0]->s_vec, sp[1]->s_vec);
}
......
......@@ -126,7 +126,7 @@ static t_int *cmath_perform_nifft(t_int *w)
static void cmath_dsp(t_cmath *x, t_signal **sp)
{
dsp_add(x->x_perf, 5, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec);
dsp_add(x->x_perf, 5, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec);
}
void cmath_free(void)
......
......@@ -160,7 +160,7 @@ static void diag_dsp(t_diag *x, t_signal **sp)
dsp_add(diag_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(diag_perform, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
}
......
......@@ -237,7 +237,7 @@ static t_int *dist_perform(t_int *w)
static void dist_dsp(t_dist *x, t_signal **sp)
{
dsp_add(dist_perform, 4, &x->x_ctl, sp[0]->s_n,
dsp_add(dist_perform, 4, &x->x_ctl, (t_int)sp[0]->s_n,
sp[0]->s_vec, sp[1]->s_vec);
}
......
......@@ -716,16 +716,16 @@ static void dwt_dsp(t_dwt *x, t_signal **sp)
switch(x->x_ctl.c_type){
case DWT:
dsp_add(dwt_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(dwt_perform, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
break;
case IDWT:
dsp_add(idwt_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(idwt_perform, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
break;
case DWT16:
dsp_add(dwt16_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(dwt16_perform, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
break;
case IDWT16:
dsp_add(idwt16_perform, 4, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
dsp_add(idwt16_perform, 4, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
break;
......
......@@ -262,7 +262,7 @@ static void dynwav_dsp(t_dynwav *x, t_signal **sp)
}
dsp_add(dynwav_perform_8point, 5, &x->x_ctl, sp[0]->s_n,
dsp_add(dynwav_perform_8point, 5, &x->x_ctl, (t_int)sp[0]->s_n,
sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec);
......
......@@ -122,7 +122,7 @@ static t_int *eadsr_perform(t_int *w)
static void eadsr_dsp(t_eadsr *x, t_signal **sp)
{
x->x_sr = sp[0]->s_sr;
dsp_add(eadsr_perform, 3, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec);
dsp_add(eadsr_perform, 3, &x->x_ctl, sp[0]->s_n, (t_int)sp[0]->s_vec);
}
void eadsr_free(void)
......
......@@ -107,7 +107,7 @@ static t_int *ead_perform(t_int *w)
static void ead_dsp(t_ead *x, t_signal **sp)
{
dsp_add(ead_perform, 3, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec);
dsp_add(ead_perform, 3, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec);
}
/* destructor */
......
......@@ -95,7 +95,7 @@ static t_int *ear_perform(t_int *w)
static void ear_dsp(t_ear *x, t_signal **sp)
{
x->x_sr = sp[0]->s_sr;
dsp_add(ear_perform, 3, &x->x_ctl, sp[0]->s_n, sp[0]->s_vec);
dsp_add(ear_perform, 3, &x->x_ctl, (t_int)sp[0]->s_n, sp[0]->s_vec);
}
void ear_free(void)
......
......@@ -503,7 +503,7 @@ static void eblosc_dsp(t_eblosc *x, t_signal **sp)
if (x->x_ctl.c_waveform == gensym("syncsaw")){
x->x_ctl.c_scale = 1.0f;
x->x_ctl.c_scale_update = 1.0f;
dsp_add(eblosc_perform_hardsync_saw, 5, &x->x_ctl, sp[0]->s_n,
dsp_add(eblosc_perform_hardsync_saw, 5, &x->x_ctl, (t_int)sp[0]->s_n,
sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec);
}
......@@ -511,26 +511,26 @@ static void eblosc_dsp(t_eblosc *x, t_signal **sp)
else if (x->x_ctl.c_waveform == gensym("pulse")){
x->x_ctl.c_scale = 1.0f;
x->x_ctl.c_scale_update = 1.0f;
dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n,
dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, (t_int)sp[0]->s_n,
sp[0]->s_vec, sp[1]->s_vec);
}
else if (x->x_ctl.c_waveform == gensym("pulse2")){
x->x_ctl.c_phase_inc_scale *= 2;
x->x_ctl.c_scale = 1.0f;
x->x_ctl.c_scale_update = -1.0f;
dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, sp[0]->s_n,
dsp_add(eblosc_perform_pulse, 4, &x->x_ctl, (t_int)sp[0]->s_n,
sp[0]->s_vec, sp[1]->s_vec);
}
else if (x->x_ctl.c_waveform == gensym("comparator")){
x->x_ctl.c_scale = 1.0f;
x->x_ctl.c_scale_update = 1.0f;
dsp_add(eblosc_perform_comparator, 4, &x->x_ctl,
sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
(t_int)sp[0]->s_n, sp[0]->s_vec, sp[1]->s_vec);
}
else{
x->x_ctl.c_scale = 1.0f;
x->x_ctl.c_scale_update = 1.0f;
dsp_add(eblosc_perform_saw, 4, &x->x_ctl, sp[0]->s_n,
dsp_add(eblosc_perform_saw, 4, &x->x_ctl, (t_int)sp[0]->s_n,
sp[0]->s_vec, sp[1]->s_vec);
}
......
......@@ -255,7 +255,7 @@ static void fdn_dsp(t_fdn *x, t_signal **sp)
dsp_add(fdn_perform,
5,
&x->x_ctl,
sp[0]->s_n,
(t_int)sp[0]->s_n,
sp[0]->s_vec,
sp[1]->s_vec,
sp[2]->s_vec);
......
......@@ -145,9 +145,9 @@ static void junction_dsp(t_junction *x, t_signal **sp)