aboutsummaryrefslogtreecommitdiff
path: root/src/tab_abs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tab_abs.c')
-rw-r--r--src/tab_abs.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/tab_abs.c b/src/tab_abs.c
index 42fc453..8e4043c 100644
--- a/src/tab_abs.c
+++ b/src/tab_abs.c
@@ -1,7 +1,7 @@
/* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
-iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */
+iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2009 */
#include "m_pd.h"
@@ -11,6 +11,7 @@ iem_tab written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006
/* -------------------------- tab_abs ------------------------------ */
+/* x_beg_mem_dst[i] = abs(x_beg_mem_src1[i]) */
typedef struct _tab_abs
{
@@ -19,8 +20,8 @@ typedef struct _tab_abs
int x_size_dst;
int x_offset_src1;
int x_offset_dst;
- t_float *x_beg_mem_src1;
- t_float *x_beg_mem_dst;
+ iemarray_t *x_beg_mem_src1;
+ iemarray_t *x_beg_mem_dst;
t_symbol *x_sym_scr1;
t_symbol *x_sym_dst;
} t_tab_abs;
@@ -41,7 +42,7 @@ static void tab_abs_bang(t_tab_abs *x)
{
int i, n;
int ok_src, ok_dst;
- t_float *vec_src, *vec_dst;
+ iemarray_t *vec_src, *vec_dst;
ok_src = iem_tab_check_arrays(gensym("tab_abs"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0);
ok_dst = iem_tab_check_arrays(gensym("tab_abs"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0);
@@ -59,7 +60,8 @@ static void tab_abs_bang(t_tab_abs *x)
t_garray *a;
for(i=0; i<n; i++)
- vec_dst[i] = fabs(vec_src[i]);
+ iemarray_setfloat(vec_dst, i, fabs(iemarray_getfloat(vec_src, i)));
+
outlet_bang(x->x_obj.ob_outlet);
a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class);
garray_redraw(a);
@@ -72,7 +74,7 @@ static void tab_abs_list(t_tab_abs *x, t_symbol *s, int argc, t_atom *argv)
int beg_src, beg_dst;
int i, n;
int ok_src, ok_dst;
- t_float *vec_src, *vec_dst;
+ iemarray_t *vec_src, *vec_dst;
if((argc >= 3) &&
IS_A_FLOAT(argv,0) &&
@@ -101,7 +103,7 @@ static void tab_abs_list(t_tab_abs *x, t_symbol *s, int argc, t_atom *argv)
t_garray *a;
for(i=0; i<n; i++)
- vec_dst[i] = fabs(vec_src[i]);
+ iemarray_setfloat(vec_dst, i, fabs(iemarray_getfloat(vec_src, i)));
outlet_bang(x->x_obj.ob_outlet);
a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class);
garray_redraw(a);