Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19015
Modified Files: Tag: desiredata desire.c m_pd.h Log Message: removed gs_un.gs_ prefixes
Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.4.4.11.2.33.2.26 retrieving revision 1.4.4.11.2.33.2.27 diff -C2 -d -r1.4.4.11.2.33.2.26 -r1.4.4.11.2.33.2.27 *** m_pd.h 3 Jan 2007 04:12:13 -0000 1.4.4.11.2.33.2.26 --- m_pd.h 3 Jan 2007 04:42:12 -0000 1.4.4.11.2.33.2.27 *************** *** 100,103 **** --- 100,112 ---- #define GP_ARRAY 2 /* ... or array */
+ #ifdef PD_PLUSPLUS_FACE + typedef struct _gstub { + union { + struct _glist *canvas; + struct _array *array; + }; + } t_gstub; + #define gs_refcount canvas->refcount + #else typedef struct _gstub { union { *************** *** 106,112 **** } gs_un; } t_gstub; - #ifdef PD_PLUSPLUS_FACE - #define gs_refcount gs_un.gs_glist->refcount - #else #define gs_refcount gs_un.gs_glist->gl_obj.refcount #endif --- 115,118 ---- *************** *** 152,156 **** typedef void *hashvalue; typedef void (*hash_iter)(void *data, hashkey k, hashvalue v); ! t_hash * hash_new(long capa); void hash_free(t_hash *self); long hash_size(t_hash *self); --- 158,162 ---- typedef void *hashvalue; typedef void (*hash_iter)(void *data, hashkey k, hashvalue v); ! t_hash *hash_new(long capa); void hash_free(t_hash *self); long hash_size(t_hash *self);
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.104 retrieving revision 1.1.2.217.2.105 diff -C2 -d -r1.1.2.217.2.104 -r1.1.2.217.2.105 *** desire.c 3 Jan 2007 03:54:16 -0000 1.1.2.217.2.104 --- desire.c 3 Jan 2007 04:42:10 -0000 1.1.2.217.2.105 *************** *** 1420,1424 **** static void array_resize_and_redraw(t_array *array, int n) { t_array *a2 = array; ! while (gstub_which(STUB(a2)) == GP_ARRAY) a2 = STUB(a2)->gs_un.gs_array; array_resize(array,n); gobj_changed(array,0); --- 1420,1424 ---- static void array_resize_and_redraw(t_array *array, int n) { t_array *a2 = array; ! while (gstub_which(STUB(a2)) == GP_ARRAY) a2 = STUB(a2)->array; array_resize(array,n); gobj_changed(array,0); *************** *** 1699,1703 ****
static void array_redraw(t_array *a, t_canvas *canvas) { ! while (gstub_which(STUB(a)) == GP_ARRAY) a = STUB(a)->gs_un.gs_array; scalar_redraw(a->gp.gp_un.gp_scalar, canvas); } --- 1699,1703 ----
static void array_redraw(t_array *a, t_canvas *canvas) { ! while (gstub_which(STUB(a)) == GP_ARRAY) a = STUB(a)->array; scalar_redraw(a->gp.gp_un.gp_scalar, canvas); } *************** *** 5071,5076 **** t_gstub *gstub_new(t_canvas *gl, t_array *a) { t_gstub *gs = (t_gstub *)getbytes(sizeof(*gs)); ! if (gl) gs->gs_un.gs_glist = gl; ! else gs->gs_un.gs_array = a; gs->gs_refcount = 0; return gs; --- 5071,5076 ---- t_gstub *gstub_new(t_canvas *gl, t_array *a) { t_gstub *gs = (t_gstub *)getbytes(sizeof(*gs)); ! if (gl) gs->canvas = gl; ! else gs->array = a; gs->gs_refcount = 0; return gs; *************** *** 5091,5095 **** otherwise we wait for the last gstub_dis() to free it. */ void gstub_cutoff(t_gstub *gs) { ! gs->gs_un.gs_array = 0; if (gs->gs_refcount < 0) bug("gstub_cutoff"); if (!gs->gs_refcount) t_freebytes(gs, sizeof (*gs)); --- 5091,5095 ---- otherwise we wait for the last gstub_dis() to free it. */ void gstub_cutoff(t_gstub *gs) { ! gs->array = 0; if (gs->gs_refcount < 0) bug("gstub_cutoff"); if (!gs->gs_refcount) t_freebytes(gs, sizeof (*gs)); *************** *** 5097,5102 ****
static int gstub_which(t_gstub *gs) { ! if (gs->gs_un.gs_array) return 0; ! if (gs->gs_un.gs_array->_class == array_class) return GP_ARRAY; else return GP_CANVAS; }
--- 5097,5102 ----
static int gstub_which(t_gstub *gs) { ! if (gs->array) return 0; ! if (gs->array->_class == array_class) return GP_ARRAY; else return GP_CANVAS; }
*************** *** 5118,5122 **** t_gstub *gs = gp->gp_stub; if (gstub_which(gs) == 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;} }
--- 5118,5122 ---- t_gstub *gs = gp->gp_stub; if (gstub_which(gs) == GP_CANVAS) {t_scalar *sc = gp->gp_un.gp_scalar; return sc ? sc->t : 0;} ! else {t_array *a = gs->array; return a->templatesym;} }
*************** *** 5201,5205 **** if (!gs) {pd_error(x, "next: no current pointer"); return;} if (gstub_which(gs) != 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;} --- 5201,5205 ---- if (!gs) {pd_error(x, "next: no current pointer"); return;} if (gstub_which(gs) != GP_CANVAS) {pd_error(x, "next: lists only, not arrays"); return;} ! canvas = gs->canvas; if (isstale(gp)) {pd_error(x, "next: stale pointer"); return;} if (wantselected) {pd_error(x, "next: next-selected unsupported in desiredata"); return;} *************** *** 5230,5238 **** if (!gpointer_check(&x->gp, 1)) {pd_error(x, "bang: empty pointer"); return;} gs = x->gp.gp_stub; ! if (gstub_which(gs) == GP_CANVAS) canvas = gs->gs_un.gs_glist; else { ! t_array *owner_array = gs->gs_un.gs_array; ! while (gstub_which(STUB(owner_array)) == GP_ARRAY) owner_array = STUB(owner_array)->gs_un.gs_array; ! canvas = STUB(owner_array)->gs_un.gs_glist; } if (argc && argv->a_type == A_SYMBOL) --- 5230,5238 ---- if (!gpointer_check(&x->gp, 1)) {pd_error(x, "bang: empty pointer"); return;} gs = x->gp.gp_stub; ! if (gstub_which(gs) == GP_CANVAS) canvas = gs->canvas; else { ! t_array *owner_array = gs->array; ! while (gstub_which(STUB(owner_array)) == GP_ARRAY) owner_array = STUB(owner_array)->array; ! canvas = STUB(owner_array)->canvas; } if (argc && argv->a_type == A_SYMBOL) *************** *** 5262,5266 **** gs = x->gp.gp_stub; if (gstub_which(gs) != GP_CANVAS) {pd_error(x, "rewind: sorry, unavailable for arrays"); return;} ! canvas = gs->gs_un.gs_glist; gpointer_setcanvas(&x->gp, canvas, 0); ptrobj_bang(x); --- 5262,5266 ---- gs = x->gp.gp_stub; if (gstub_which(gs) != GP_CANVAS) {pd_error(x, "rewind: sorry, unavailable for arrays"); return;} ! canvas = gs->canvas; gpointer_setcanvas(&x->gp, canvas, 0); ptrobj_bang(x); *************** *** 5389,5397 **** for (int i=0; i<nitems; i++,vp++) template_setsymbol(t, vp->sym, vec, vp->w.w_symbol, 1); else for (int i=0; i<nitems; i++,vp++) template_setfloat(t, vp->sym, vec, vp->w.w_float, 1); ! if (gstub_which(gs) == GP_CANVAS) scalar_redraw(gp->gp_un.gp_scalar, gs->gs_un.gs_glist); else { ! t_array *owner_array = gs->gs_un.gs_array; ! while (gstub_which(STUB(owner_array)) == GP_ARRAY) owner_array = STUB(owner_array)->gs_un.gs_array; ! scalar_redraw(owner_array->gp.gp_un.gp_scalar, STUB(owner_array)->gs_un.gs_glist); } } --- 5389,5397 ---- for (int i=0; i<nitems; i++,vp++) template_setsymbol(t, vp->sym, vec, vp->w.w_symbol, 1); else for (int i=0; i<nitems; i++,vp++) template_setfloat(t, vp->sym, vec, vp->w.w_float, 1); ! if (gstub_which(gs) == GP_CANVAS) scalar_redraw(gp->gp_un.gp_scalar, gs->canvas); else { ! t_array *owner_array = gs->array; ! while (gstub_which(STUB(owner_array)) == GP_ARRAY) owner_array = STUB(owner_array)->array; ! scalar_redraw(owner_array->gp.gp_un.gp_scalar, STUB(owner_array)->canvas); } } *************** *** 5566,5574 **** scalar to erase. When graphics updates become queueable this may fall apart... */ if (gstub_which(gs) == GP_CANVAS) { ! if (canvas_isvisible(gs->gs_un.gs_glist)) sys_mgui(gp->gp_un.gp_scalar,"delete",""); } else { ! t_array *o = gs->gs_un.gs_array; ! while (gstub_which(STUB(o)) == GP_ARRAY) o = STUB(o)->gs_un.gs_array; ! if (canvas_isvisible(STUB(o)->gs_un.gs_glist)) sys_mgui(o->gp.gp_un.gp_scalar, "delete",""); }
--- 5566,5574 ---- scalar to erase. When graphics updates become queueable this may fall apart... */ if (gstub_which(gs) == GP_CANVAS) { ! if (canvas_isvisible(gs->canvas)) sys_mgui(gp->gp_un.gp_scalar,"delete",""); } else { ! t_array *o = gs->array; ! while (gstub_which(STUB(o)) == GP_ARRAY) o = STUB(o)->array; ! if (canvas_isvisible(STUB(o)->canvas)) sys_mgui(o->gp.gp_un.gp_scalar, "delete",""); }
*************** *** 5587,5592 **** gobj_changed(gp->gp_un.gp_scalar,0); } else {/*is there something missing here?*/ ! t_array *o = gs->gs_un.gs_array; ! while (gstub_which(STUB(o)) == GP_ARRAY) o = STUB(o)->gs_un.gs_array; gobj_changed(o->gp.gp_un.gp_scalar,0); } --- 5587,5592 ---- gobj_changed(gp->gp_un.gp_scalar,0); } else {/*is there something missing here?*/ ! t_array *o = gs->array; ! while (gstub_which(STUB(o)) == GP_ARRAY) o = STUB(o)->array; gobj_changed(o->gp.gp_un.gp_scalar,0); } *************** *** 5639,5643 **** if (!gs) {pd_error(x, "no current pointer"); return;} if (gstub_which(gs) != 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; --- 5639,5643 ---- if (!gs) {pd_error(x, "no current pointer"); return;} if (gstub_which(gs) != GP_CANVAS) {pd_error(x, "lists only, not arrays"); return;} ! t_canvas *canvas = gs->canvas; if (isstale(gp)) {pd_error(x, "stale pointer"); return;} if (!nitems) return;