aboutsummaryrefslogtreecommitdiff
path: root/src/tab_add_scalar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tab_add_scalar.c')
-rw-r--r--src/tab_add_scalar.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tab_add_scalar.c b/src/tab_add_scalar.c
index 508d370..3f9fbba 100644
--- a/src/tab_add_scalar.c
+++ b/src/tab_add_scalar.c
@@ -1,13 +1,14 @@
/* 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"
#include "iemlib.h"
#include "iem_tab.h"
/* -------------------------- tab_add_scalar ------------------------------ */
+/* x_beg_mem_dst[i] = x_beg_mem_src1[i] + add */
typedef struct _tab_add_scalar
{
@@ -16,8 +17,8 @@ typedef struct _tab_add_scalar
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_add_scalar;
@@ -33,7 +34,7 @@ static void tab_add_scalar_float(t_tab_add_scalar *x, t_floatarg add)
{
int i, n;
int ok_src1, ok_dst;
- t_float *vec_src1, *vec_dst;
+ iemarray_t *vec_src1, *vec_dst;
ok_src1 = iem_tab_check_arrays(gensym("tab_add_scalar"), x->x_sym_scr1, &x->x_beg_mem_src1, &x->x_size_src1, 0);
ok_dst = iem_tab_check_arrays(gensym("tab_add_scalar"), x->x_sym_dst, &x->x_beg_mem_dst, &x->x_size_dst, 0);
@@ -52,7 +53,7 @@ static void tab_add_scalar_float(t_tab_add_scalar *x, t_floatarg add)
t_garray *a;
for(i=0; i<n; i++)
- vec_dst[i] = vec_src1[i] + add;
+ iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src1, i) + add);
outlet_bang(x->x_obj.ob_outlet);
a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class);
garray_redraw(a);
@@ -70,7 +71,7 @@ static void tab_add_scalar_list(t_tab_add_scalar *x, t_symbol *s, int argc, t_at
int beg_src1, beg_dst;
int i, n;
int ok_src1, ok_dst;
- t_float *vec_src1, *vec_dst, add;
+ iemarray_t *vec_src1, *vec_dst, add;
if((argc >= 4) &&
IS_A_FLOAT(argv,0) &&
@@ -101,7 +102,7 @@ static void tab_add_scalar_list(t_tab_add_scalar *x, t_symbol *s, int argc, t_at
t_garray *a;
for(i=0; i<n; i++)
- vec_dst[i] = vec_src1[i] + add;
+ iemarray_setfloat(vec_dst, i, iemarray_getfloat(vec_src1, i) + add);
outlet_bang(x->x_obj.ob_outlet);
a = (t_garray *)pd_findbyclass(x->x_sym_dst, garray_class);
garray_redraw(a);