From 6ca3e8bae049dd2abb653eaedc311206e2918c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 1 Apr 2009 14:56:21 +0000 Subject: hopefully fixed zarray accessing on 64bit machines svn path=/trunk/externals/zexy/; revision=10941 --- src/tabdump.c | 2 +- src/tabminmax.c | 26 +++++++++++++------------- src/tabset.c | 22 ++++++++++++++++++---- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/tabdump.c b/src/tabdump.c index 64207b6..824f483 100644 --- a/src/tabdump.c +++ b/src/tabdump.c @@ -54,7 +54,7 @@ static void tabdump_bang(t_tabdump *x) npoints=stop-start; atombuf = (t_atom *)getbytes(sizeof(t_atom)*npoints); - for (n = 0; n < npoints; n++) SETFLOAT(&atombuf[n], vec[start+n]); + for (n = 0; n < npoints; n++) SETFLOAT(&atombuf[n], zarray_getfloat(vec, start+n)); outlet_list(x->x_obj.ob_outlet, &s_list, npoints, atombuf); freebytes(atombuf,sizeof(t_atom)*npoints); } diff --git a/src/tabminmax.c b/src/tabminmax.c index 3e5dbf7..a7e622d 100644 --- a/src/tabminmax.c +++ b/src/tabminmax.c @@ -54,28 +54,28 @@ static void tabminmax_bang(t_tabminmax *x) if(stopnpoints)stop=npoints; npoints=stop-start; - min=vec[start]; - max=vec[start]; + min=zarray_getfloat(vec, start); + max=min; mindex=start; maxdex=start; for (n = 1; n < npoints; n++){ - t_float val=vec[start+n]; - if(valmax){ - maxdex=start+n; - max=val; - } + t_float val=zarray_getfloat(vec, start+n); + if(valmax){ + maxdex=start+n; + max=val; + } } - + SETFLOAT(atombuf, max); SETFLOAT(atombuf+1, maxdex); outlet_list(x->max_out, &s_list, 2, atombuf); - + SETFLOAT(atombuf, min); SETFLOAT(atombuf+1, mindex); outlet_list(x->min_out, &s_list, 2, atombuf); diff --git a/src/tabset.c b/src/tabset.c index 5cd7844..c9a4687 100644 --- a/src/tabset.c +++ b/src/tabset.c @@ -40,7 +40,10 @@ static void tabset_float(t_tabset *x, t_floatarg f) else if (!zarray_getarray(A, &npoints, &vec)) error("%s: bad template for tabset", x->x_arrayname->s_name); else { - while(npoints--)*vec++=f; + while(npoints--){ + zarray_setfloat(vec, 0, f); + vec++; + } garray_redraw(A); } } @@ -58,11 +61,22 @@ static void tabset_list(t_tabset *x, t_symbol *s, int argc, t_atom* argv) error("%s: bad template for tabset", x->x_arrayname->s_name); else { if (argc>=npoints) - while(npoints--)*vec++=atom_getfloat(argv++); + while(npoints--){ + t_float f= atom_getfloat(argv++); + zarray_setfloat(vec, 0, f); + vec++; + } else { npoints-=argc; - while (argc--)*vec++=atom_getfloat(argv++); - while (npoints--)*vec++=0; + while (argc--){ + t_float f= atom_getfloat(argv++); + zarray_setfloat(vec, 0, f); + vec++; + } + while (npoints--){ + zarray_setfloat(vec, 0, 0); + vec++; + } } garray_redraw(A); } -- cgit v1.2.1