[PD] help writing into arrays of a garray in PD in C

oscar pablo di liscia odiliscia at gmail.com
Wed Oct 15 19:53:18 CEST 2014


Already solved, please ignore the question.
Best

2014-10-14 16:56 GMT-03:00 oscar pablo di liscia <odiliscia at gmail.com>:

> I'm triying to write into an array which in turn is into a garray type.
> I wrote the following function:
>
> void write_table(t_tabwrit *x, t_symbol *name)
> {
>     t_garray *a;
>     t_array *b;
>     int size=0, i, yonset=0;
>     t_float step=0., val=0.;
>
>     x->table_name = name;
>   if (!(a = (t_garray *)pd_findbyclass(x->table_name, garray_class))) {
>     if (*name->s_name)
>       pd_error(x, "tabwrit: ERROR, %s: no such array",
> x->table_name->s_name);
>             x->table_name=NULL;
>   }
>
>     b=(t_array *)garray_getarray_floatonly(a, &yonset, &size);
>     step= 1. / (float)size;
>
>     for(i=0; i < size; ++i) {
>       *((t_float *)(b->a_vec + i + yonset))=val;
>         val+=step;
>     }
>
>     garray_redraw(a);
> return;
> }
>
> But I get from the compiler the following error:
> "error: dereferencing pointer to incomplete type"
> I understand the maning of the error, but I've looked at the definition
> of the array and garray types and I found no such "incomplete" type.
> Any idea?
> Or any other way to write floats to a garray vector?
>
> Many thanks
>
>
> --
> Oscar Pablo Di Liscia
>



-- 
Oscar Pablo Di Liscia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20141015/ab0a875d/attachment.html>


More information about the Pd-list mailing list