Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5062
Modified Files: Tag: desiredata desire.c m_pd.h Log Message: removed gp_valid
Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.4.4.11.2.33.2.22 retrieving revision 1.4.4.11.2.33.2.23 diff -C2 -d -r1.4.4.11.2.33.2.22 -r1.4.4.11.2.33.2.23 *** m_pd.h 3 Jan 2007 02:03:21 -0000 1.4.4.11.2.33.2.22 --- m_pd.h 3 Jan 2007 02:36:26 -0000 1.4.4.11.2.33.2.23 *************** *** 114,118 **** union word *gp_w; /* raw data (if array) */ } gp_un; ! int gp_valid; /* number which must match gpointee */ t_gstub *gp_stub; /* stub which points to glist/array */ } t_gpointer; --- 114,118 ---- union word *gp_w; /* raw data (if array) */ } gp_un; ! int gp_useless; t_gstub *gp_stub; /* stub which points to glist/array */ } t_gpointer;
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.101 retrieving revision 1.1.2.217.2.102 diff -C2 -d -r1.1.2.217.2.101 -r1.1.2.217.2.102 *** desire.c 3 Jan 2007 02:03:18 -0000 1.1.2.217.2.101 --- desire.c 3 Jan 2007 02:36:24 -0000 1.1.2.217.2.102 *************** *** 5099,5108 **** t_gstub *gs = gp->gp_stub; if (!gs) return 0; ! if (gs->gs_which == GP_ARRAY) return gs->gs_un.gs_array->valid == gp->gp_valid; ! if (gs->gs_which == GP_CANVAS) { ! if (!headok && !gp->gp_un.gp_scalar) return 0; ! if (gs->gs_un.gs_glist->valid != gp->gp_valid) return 0; ! return 1; ! } else return 0; }
--- 5099,5105 ---- t_gstub *gs = gp->gp_stub; if (!gs) return 0; ! if (gs->gs_which == GP_ARRAY) return 1; ! if (gs->gs_which == GP_CANVAS) return headok || gp->gp_un.gp_scalar; ! return 0; }
*************** *** 5112,5116 **** t_gstub *gs = gp->gp_stub; if (gs->gs_which == GP_CANVAS) {t_scalar *sc = gp->gp_un.gp_scalar; return sc ? sc->t : 0;} ! else {t_array *a = gs->gs_un.gs_array; return a->templatesym;} }
--- 5109,5113 ---- t_gstub *gs = gp->gp_stub; if (gs->gs_which == GP_CANVAS) {t_scalar *sc = gp->gp_un.gp_scalar; return sc ? sc->t : 0;} ! else {t_array *a = gs->gs_un.gs_array; return a->templatesym;} }
*************** *** 5133,5146 **** static void gpointer_setcanvas(t_gpointer *gp, t_canvas *canvas, t_scalar *x) { t_gstub *gs = gp->gp_stub; if (gs) gstub_dis(gs); ! gp->gp_stub=gs=canvas->stub; gp->gp_valid = canvas->valid; gp->gp_un.gp_scalar = x; gs->gs_refcount++; } static void gpointer_setarray(t_gpointer *gp, t_array *array, t_word *w) { t_gstub *gs = gp->gp_stub; if (gs) gstub_dis(gs); ! gp->gp_stub=gs=array->stub; gp->gp_valid = array->valid; gp->gp_un.gp_w = w; gs->gs_refcount++; }
void gpointer_init(t_gpointer *gp) { gp->gp_stub = 0; - gp->gp_valid = 0; gp->gp_un.gp_scalar = 0; } --- 5130,5142 ---- static void gpointer_setcanvas(t_gpointer *gp, t_canvas *canvas, t_scalar *x) { t_gstub *gs = gp->gp_stub; if (gs) gstub_dis(gs); ! gp->gp_stub=gs=canvas->stub; gp->gp_un.gp_scalar = x; gs->gs_refcount++; } static void gpointer_setarray(t_gpointer *gp, t_array *array, t_word *w) { t_gstub *gs = gp->gp_stub; if (gs) gstub_dis(gs); ! gp->gp_stub=gs=array->stub; gp->gp_un.gp_w = w; gs->gs_refcount++; }
void gpointer_init(t_gpointer *gp) { gp->gp_stub = 0; gp->gp_un.gp_scalar = 0; } *************** *** 5185,5188 **** --- 5181,5187 ---- }
+ /* for future use */ + static int isstale(t_gpointer *x) {return 1;} + static void ptrobj_vnext(t_ptrobj *x, float f) { t_gobj *gobj; *************** *** 5191,5200 **** t_canvas *canvas; int wantselected = f!=0; - if (!gs) {pd_error(x, "next: no current pointer"); return;} if (gs->gs_which != GP_CANVAS) {pd_error(x, "next: lists only, not arrays"); return;} canvas = gs->gs_un.gs_glist; ! if (canvas->valid != gp->gp_valid) {pd_error(x, "next: stale pointer"); return;} ! if (wantselected && !canvas_isvisible(canvas)) {pd_error(x, "next: next-selected only works for a visible window"); return;} gobj = gp->gp_un.gp_scalar; if (!gobj) gobj = canvas->list; --- 5190,5200 ---- t_canvas *canvas; int wantselected = f!=0; if (!gs) {pd_error(x, "next: no current pointer"); return;} if (gs->gs_which != GP_CANVAS) {pd_error(x, "next: lists only, not arrays"); return;} canvas = gs->gs_un.gs_glist; ! if (isstale(gp)) {pd_error(x, "next: stale pointer"); return;} ! if (wantselected) {pd_error(x, "next: next-selected unsupported in desiredata"); return;} ! /* if (wantselected && !canvas_isvisible(canvas)) ! {pd_error(x, "next: next-selected only works for a visible window"); return;} */ gobj = gp->gp_un.gp_scalar; if (!gobj) gobj = canvas->list; *************** *** 5626,5638 **** int nitems = x->nin; t_template *t = template_findbyname(x->templatesym); - t_appendvariable *vp; t_gpointer *gp = &x->gp; t_gstub *gs = gp->gp_stub; - t_word *vec; TEMPLATE_CHECK(x,x->templatesym,) if (!gs) {pd_error(x, "no current pointer"); return;} if (gs->gs_which != GP_CANVAS) {pd_error(x, "lists only, not arrays"); return;} t_canvas *canvas = gs->gs_un.gs_glist; ! if (canvas->valid != gp->gp_valid) {pd_error(x, "stale pointer"); return;} if (!nitems) return; x->variables[0].f = f; --- 5626,5636 ---- int nitems = x->nin; t_template *t = template_findbyname(x->templatesym); t_gpointer *gp = &x->gp; t_gstub *gs = gp->gp_stub; TEMPLATE_CHECK(x,x->templatesym,) if (!gs) {pd_error(x, "no current pointer"); return;} if (gs->gs_which != GP_CANVAS) {pd_error(x, "lists only, not arrays"); return;} t_canvas *canvas = gs->gs_un.gs_glist; ! if (isstale(gp)) {pd_error(x, "stale pointer"); return;} if (!nitems) return; x->variables[0].f = f; *************** *** 5644,5649 **** gobj_changed(sc,0); gp->gp_un.gp_scalar = sc; ! vec = sc->v; ! vp=x->variables; for (int i=0; i<nitems; i++,vp++) template_setfloat(t, vp->sym, vec, vp->f, 1); scalar_redraw(sc, canvas); --- 5642,5647 ---- gobj_changed(sc,0); gp->gp_un.gp_scalar = sc; ! t_word *vec = sc->v; ! t_appendvariable *vp=x->variables; for (int i=0; i<nitems; i++,vp++) template_setfloat(t, vp->sym, vec, vp->f, 1); scalar_redraw(sc, canvas);