Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16408
Modified Files: Tag: desiredata builtins.c Log Message: removing old pointer stuff... this isn't supposed to work as it is now. it will need a switch to newer pointer stuff in the future.
Index: builtins.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v retrieving revision 1.1.2.44 retrieving revision 1.1.2.45 diff -C2 -d -r1.1.2.44 -r1.1.2.45 *** builtins.c 20 Jul 2007 08:41:02 -0000 1.1.2.44 --- builtins.c 20 Jul 2007 14:19:27 -0000 1.1.2.45 *************** *** 1421,1426 **** t_int n; /* number of args */ t_atom *vec; /* input values */ - t_int nptr; /* number of pointers */ - t_gpointer *gpointer; /* the pointers */ t_atom *outvec; /* space for output values */ }; --- 1421,1424 ---- *************** *** 1442,1447 **** if (ap->a_type == A_SYMBOL && *ap->a_symbol->name == 'p') nptr++; - t_gpointer *gp = x->gpointer = (t_gpointer *)t_getbytes(nptr * sizeof (*gp)); - x->nptr = nptr; for (i = 0, vp = x->vec, ap = argv; i < argc; i++, ap++, vp++) { if (ap->a_type == A_FLOAT) { --- 1440,1443 ---- *************** *** 1455,1462 **** } else if (c == 'p') { vp->a_type = A_POINTER; ! vp->a_pointer = gp; ! gpointer_init(gp); ! if (i) pointerinlet_new(x, gp); ! gp++; } else { if (c != 'f') error("pack: %s: bad type", ap->a_symbol->name); --- 1451,1457 ---- } else if (c == 'p') { vp->a_type = A_POINTER; ! //vp->a_pointer = gp; ! //gpointer_init(gp); ! //if (i) pointerinlet_new(x, gp); } else { if (c != 'f') error("pack: %s: bad type", ap->a_symbol->name); *************** *** 1471,1486 **** static void pack_bang(t_pack *x) { int reentered = 0, size = x->n * sizeof (t_atom); - t_gpointer *gp = x->gpointer; t_atom *outvec; ! for (int i = x->nptr; i--; gp++) if (!gpointer_check(gp, 1)) { ! error("pack: stale pointer"); ! return; ! } ! /* reentrancy protection. The first time through use the pre-allocated ! outvec; if we're reentered we have to allocate new memory. */ if (!x->outvec) { - /* LATER figure out how to deal with reentrancy and pointers... */ - if (x->nptr) - post("pack_bang: warning: reentry with pointers unprotected"); outvec = (t_atom *)t_getbytes(size); reentered = 1; --- 1466,1472 ---- static void pack_bang(t_pack *x) { int reentered = 0, size = x->n * sizeof (t_atom); t_atom *outvec; ! /* reentrancy protection. The first time through use the pre-allocated outvec; if we're reentered we have to allocate new memory. */ if (!x->outvec) { outvec = (t_atom *)t_getbytes(size); reentered = 1; *************** *** 1496,1502 **** static void pack_pointer(t_pack *x, t_gpointer *gp) { if (x->vec->a_type == A_POINTER) { ! gpointer_unset(x->gpointer); ! *x->gpointer = *gp; ! if (gp->o) gp->o->refcount++; pack_bang(x); } else error("pack_pointer: wrong type"); --- 1482,1488 ---- static void pack_pointer(t_pack *x, t_gpointer *gp) { if (x->vec->a_type == A_POINTER) { ! //gpointer_unset(x->gpointer); ! //*x->gpointer = *gp; ! //if (gp->o) gp->o->refcount++; pack_bang(x); } else error("pack_pointer: wrong type"); *************** *** 1517,1525 **** } static void pack_free(t_pack *x) { - t_gpointer *gp=x->gpointer; - for (int i = x->nptr; i--; gp++) gpointer_unset(gp); free(x->vec); free(x->outvec); - free(x->gpointer); } static void pack_setup() { --- 1503,1508 ---- *************** *** 2728,2732 **** t_atom defarg, *ap; t_atom *vec, *vp; - t_gpointer *gp; int nptr = 0; float deltime=0; --- 2711,2714 ---- *************** *** 2762,2770 **** } else if (c=='p') { vp->a_type = A_POINTER; - vp->a_pointer = gp; - gpointer_init(gp); outlet_new(x, &s_pointer); ! if (i) pointerinlet_new(x, gp); ! gp++; } else if (c=='f') { SETFLOAT(vp,0); --- 2744,2749 ---- } else if (c=='p') { vp->a_type = A_POINTER; outlet_new(x, &s_pointer); ! //if (i) pointerinlet_new(x, gp); } else if (c=='f') { SETFLOAT(vp,0); *************** *** 2793,2806 **** } } ! t_atom *p = x->vec + (x->n - 1); ! union word *w = h->vec + (x->n - 1); for (int i = x->n; i--; p--, w--) { switch (p->a_type) { ! case A_FLOAT: outlet_float( x->out(i),w->w_float ); break; ! case A_SYMBOL: outlet_symbol(x->out(i),w->w_symbol); break; ! case A_POINTER: ! if (gpointer_check(w->w_gpointer, 1)) outlet_pointer(x->out(i), w->w_gpointer); ! else post("pipe: stale pointer"); ! break; default:{} } --- 2772,2782 ---- } } ! t_atom *p = x->vec + x->n-1; ! union word *w = h->vec + x->n-1; for (int i = x->n; i--; p--, w--) { switch (p->a_type) { ! case A_FLOAT: outlet_float( x->out(i), w->w_float ); break; ! case A_SYMBOL: outlet_symbol( x->out(i), w->w_symbol ); break; ! case A_POINTER:outlet_pointer(x->out(i), w->w_gpointer); break; default:{} } *************** *** 2810,2814 **** static void pipe_list(t_pipe *x, t_symbol *s, int ac, t_atom *av) { t_hang2 *h = (t_hang2 *)getbytes(sizeof(*h) + (x->n - 1) * sizeof(*h->vec)); - t_gpointer *gp2; int n = x->n; if (ac > n) ac = n; --- 2786,2789 ----