diff options
Diffstat (limited to 'pd/src/g_array.c')
-rw-r--r-- | pd/src/g_array.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pd/src/g_array.c b/pd/src/g_array.c index 95819282..1b44e548 100644 --- a/pd/src/g_array.c +++ b/pd/src/g_array.c @@ -1130,7 +1130,7 @@ char *garray_vec(t_garray *x) /* get the contents */ /* routine that checks if we're just an array of floats and if so returns the goods */ -int garray_getfloatarray(t_garray *x, int *size, t_float **vec) +int garray_getfloatwords(t_garray *x, int *size, t_word **vec) { int yonset, type, elemsize; t_array *a = garray_getarray_floatonly(x, &yonset, &elemsize); @@ -1145,9 +1145,23 @@ int garray_getfloatarray(t_garray *x, int *size, t_float **vec) return (0); } *size = garray_npoints(x); - *vec = (float *)garray_vec(x); + *vec = (t_word *)garray_vec(x); return (1); } + /* older, non-64-bit safe version, supplied for older externs */ + +int garray_getfloatarray(t_garray *x, int *size, t_float **vec) +{ + if (sizeof(t_word) != sizeof(float)) + { + static int warned; + if (!warned) + post( + "warning: extern using garray_getfloatarray() won't work in 64-bit version"); + warned = 1; + } + return (garray_getfloatwords(x, size, (t_word **)vec)); +} /* set the "saveit" flag */ void garray_setsaveit(t_garray *x, int saveit) |