Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17243
Modified Files: Tag: desiredata builtins.c Log Message: removed special pointer handling in [pipe]
Index: builtins.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v retrieving revision 1.1.2.43 retrieving revision 1.1.2.44 diff -C2 -d -r1.1.2.43 -r1.1.2.44 *** builtins.c 20 Jul 2007 08:34:16 -0000 1.1.2.43 --- builtins.c 20 Jul 2007 08:41:02 -0000 1.1.2.44 *************** *** 2715,2719 **** t_hang2 *next; struct t_pipe *owner; - t_gpointer *gp; union word vec[0]; /* not the actual number of elements */ }; --- 2715,2718 ---- *************** *** 2723,2727 **** float deltime; t_atom *vec; - t_gpointer *gp; t_hang2 *hang; }; --- 2722,2725 ---- *************** *** 2750,2754 **** int i; for (i = argc, ap = argv; i--; ap++) if (ap->a_type == A_SYMBOL && *ap->a_symbol->name == 'p') nptr++; - gp = x->gp = (t_gpointer *)t_getbytes(nptr * sizeof(*gp)); x->nptr = nptr; for (i = 0, vp = vec, ap = argv; i < argc; i++, ap++, vp++) { --- 2748,2751 ---- *************** *** 2783,2790 **** } static void hang_free(t_hang2 *h) { - t_pipe *x = h->owner; - t_gpointer *gp = h->gp; - for (int i = x->nptr; i--; gp++) gpointer_unset(gp); - free(h->gp); clock_free(h->clock); free(h); --- 2780,2783 ---- *************** *** 2819,2853 **** t_gpointer *gp2; int n = x->n; - h->gp = (t_gpointer *)getbytes(x->nptr * sizeof(t_gpointer)); if (ac > n) ac = n; t_atom *p = x->vec; t_atom *ap = av; ! t_gpointer *gp = x->gp; ! for (int i=0; i<ac; i++, p++, ap++) { ! switch (p->a_type) { ! case A_FLOAT: p->a_float = atom_getfloat(ap); break; ! case A_SYMBOL: p->a_symbol = atom_getsymbol(ap); break; ! case A_POINTER: ! gpointer_unset(gp); ! if (ap->a_type != A_POINTER) post("pipe: bad pointer"); ! else { ! *gp = *(ap->a_pointer); ! if (gp->o) gp->o->refcount++; ! } ! gp++; ! default:{} ! } ! } t_word *w = h->vec; - gp = x->gp; - gp2 = h->gp; p = x->vec; ! for (int i=0; i<n; i++, p++, w++) { ! if (p->a_type == A_POINTER) { ! if (gp->o) gp->o->refcount++; ! w->w_gpointer = gp2; ! *gp2++ = *gp++; ! } else *w = p->a_w; ! } h->next = x->hang; x->hang = h; --- 2812,2822 ---- t_gpointer *gp2; int n = x->n; if (ac > n) ac = n; t_atom *p = x->vec; t_atom *ap = av; ! for (int i=0; i<ac; i++, p++, ap++) *p = *ap; t_word *w = h->vec; p = x->vec; ! for (int i=0; i< n; i++, p++, w++) *w = p->a_w; h->next = x->hang; x->hang = h;