aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2009-01-13 16:40:12 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2009-01-13 16:40:12 +0000
commit1ba83c3c8fe151b72327078425391c3deff9160b (patch)
treee2402298d19fd22eee1ed47b42ad73906b688bdd
parent8e38549e10aeaab8cdcf9ffd061d6d09a00c7291 (diff)
made array-access 64bit compatible
svn path=/trunk/externals/zexy/; revision=10529
-rw-r--r--src/tabdump.c4
-rw-r--r--src/tabminmax.c4
-rw-r--r--src/tabread4~~.c11
-rw-r--r--src/tabset.c8
-rw-r--r--src/zexy.h10
5 files changed, 18 insertions, 19 deletions
diff --git a/src/tabdump.c b/src/tabdump.c
index a4de043..64207b6 100644
--- a/src/tabdump.c
+++ b/src/tabdump.c
@@ -36,11 +36,11 @@ static void tabdump_bang(t_tabdump *x)
{
t_garray *A;
int npoints;
- t_float *vec;
+ zarray_t *vec;
if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
error("%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(A, &npoints, &vec))
+ else if (!zarray_getarray(A, &npoints, &vec))
error("%s: bad template for tabdump", x->x_arrayname->s_name);
else
{
diff --git a/src/tabminmax.c b/src/tabminmax.c
index fb66b81..3e5dbf7 100644
--- a/src/tabminmax.c
+++ b/src/tabminmax.c
@@ -35,11 +35,11 @@ static void tabminmax_bang(t_tabminmax *x)
{
t_garray *A;
int npoints;
- t_float *vec;
+ zarray_t *vec;
if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
error("%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(A, &npoints, &vec))
+ else if (!zarray_getarray(A, &npoints, &vec))
error("%s: bad template for tabminmax", x->x_arrayname->s_name);
else
{
diff --git a/src/tabread4~~.c b/src/tabread4~~.c
index d150afa..a1a4f34 100644
--- a/src/tabread4~~.c
+++ b/src/tabread4~~.c
@@ -23,17 +23,6 @@
static t_class *tabread4_tilde_class;
-#ifdef Z_USE_WORD_ARRAYS
-# define zarray_t t_word
-# define zarray_getarray garray_getfloatwords
-# define zarray_getfloat(pointer, index) (pointer[index].w_float)
-#else
-# define zarray_t t_float
-# define zarray_getarray garray_getfloatarray
-# define zarray_getfloat(pointer, index) (pointer[index])
-#endif
-
-
typedef struct _tabread4_tilde
{
t_object x_obj;
diff --git a/src/tabset.c b/src/tabset.c
index 6abb91a..5cd7844 100644
--- a/src/tabset.c
+++ b/src/tabset.c
@@ -33,11 +33,11 @@ static void tabset_float(t_tabset *x, t_floatarg f)
{
t_garray *A;
int npoints;
- t_float *vec;
+ zarray_t *vec;
if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
error("%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(A, &npoints, &vec))
+ else if (!zarray_getarray(A, &npoints, &vec))
error("%s: bad template for tabset", x->x_arrayname->s_name);
else {
while(npoints--)*vec++=f;
@@ -49,12 +49,12 @@ static void tabset_list(t_tabset *x, t_symbol *s, int argc, t_atom* argv)
{
t_garray *A;
int npoints;
- t_float *vec;
+ zarray_t *vec;
ZEXY_USEVAR(s);
if (!(A = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
error("%s: no such array", x->x_arrayname->s_name);
- else if (!garray_getfloatarray(A, &npoints, &vec))
+ else if (!zarray_getarray(A, &npoints, &vec))
error("%s: bad template for tabset", x->x_arrayname->s_name);
else {
if (argc>=npoints)
diff --git a/src/zexy.h b/src/zexy.h
index a0f03a4..0ec9287 100644
--- a/src/zexy.h
+++ b/src/zexy.h
@@ -140,5 +140,15 @@ static void zexy_register(char*object){object=0;}
# define z_verbose
#endif
+#if (defined __x86_64__) && (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION > 41)
+# define zarray_t t_word
+# define zarray_getarray garray_getfloatwords
+# define zarray_getfloat(pointer, index) (pointer[index].w_float)
+#else
+# define zarray_t t_float
+# define zarray_getarray garray_getfloatarray
+# define zarray_getfloat(pointer, index) (pointer[index])
+#endif
+
#endif /* INCLUDE_ZEXY_H__ */