Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8546
Modified Files: Tag: desiredata desire.c kernel.c Log Message: binbuf_addv "s" replaced by binbuf_addv "t" to avoid gensym
Index: kernel.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/kernel.c,v retrieving revision 1.1.2.16 retrieving revision 1.1.2.17 diff -C2 -d -r1.1.2.16 -r1.1.2.17 *** kernel.c 31 Dec 2006 07:54:20 -0000 1.1.2.16 --- kernel.c 31 Dec 2006 08:05:57 -0000 1.1.2.17 *************** *** 1917,1920 **** --- 1917,1921 ---- case 'f': SETFLOAT(at, va_arg(ap, double)); break; case 's': SETSYMBOL(at, va_arg(ap, t_symbol *)); break; + case 't': SETSYMBOL(at, gensym(va_arg(ap, char *))); break; case ';': SETSEMI(at); break; case ',': SETCOMMA(at); break; *************** *** 1952,1956 **** break; default: ! bug("binbuf_addbinbuf"); } } --- 1953,1957 ---- break; default: ! bug("binbuf_addbinbuf: stray atom of type %d",ap->a_type); } }
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.97 retrieving revision 1.1.2.217.2.98 diff -C2 -d -r1.1.2.217.2.97 -r1.1.2.217.2.98 *** desire.c 31 Dec 2006 07:27:18 -0000 1.1.2.217.2.97 --- desire.c 31 Dec 2006 08:05:55 -0000 1.1.2.217.2.98 *************** *** 117,121 **** hashvalue v; int i=0; ! binbuf_addv(b, "s", gensym("#V")); hash_foreach(k,v,h) { t_arglist *al = (t_arglist *)v; --- 117,121 ---- hashvalue v; int i=0; ! binbuf_addv(b,"t","#V"); hash_foreach(k,v,h) { t_arglist *al = (t_arglist *)v; *************** *** 123,127 **** binbuf_add(b,al->c,al->v); if (i+1==hash_size(h)) binbuf_addv(b, ";"); ! else binbuf_addv(b, "s", gensym(",")); i++; } --- 123,127 ---- binbuf_add(b,al->c,al->v); if (i+1==hash_size(h)) binbuf_addv(b, ";"); ! else binbuf_addv(b,"t",","); i++; } *************** *** 649,653 **** x->goprect = 0; x->binbuf = binbuf_new(); ! binbuf_addv(x->binbuf, "s", gensym("graph")); if (!menu) pd_pushsym(x); canvas_add(g,x); --- 649,653 ---- x->goprect = 0; x->binbuf = binbuf_new(); ! binbuf_addv(x->binbuf,"t","graph"); if (!menu) pd_pushsym(x); canvas_add(g,x); *************** *** 1312,1316 **** canvas_wires_each(oc,t,x) { if ((o==t.from) != (o==t.to)) ! binbuf_addv(buf, "ssiiii;", gensym("#X"), gensym("connect"), canvas_getindex(x, t.from), t.outlet, canvas_getindex(x, t.to), t.inlet); --- 1312,1316 ---- canvas_wires_each(oc,t,x) { if ((o==t.from) != (o==t.to)) ! binbuf_addv(buf,"ttiiii;","#X","connect", canvas_getindex(x, t.from), t.outlet, canvas_getindex(x, t.to), t.inlet); *************** *** 1949,1959 **** style = (int)template_getfloat(scalartemplate, gensym("style"), x->scalar->v, 0); filestyle = (style == PLOTSTYLE_POINTS ? 1 : (style == PLOTSTYLE_POLY ? 0 : style)); ! binbuf_addv(b, "sssisi;", gensym("#X"), gensym("array"), ! x->realname, array->n, &s_float, x->saveit + 2 * filestyle + 8*x->hidename); if (x->saveit) { int n = array->n, n2 = 0; while (n2 < n) { int chunk = imin(n-n2,1000); ! binbuf_addv(b, "si", gensym("#A"), n2); for (int i=0; i<chunk; i++) binbuf_addv(b, "f", ((float *)array->vec)[n2+i]); binbuf_addv(b, ";"); --- 1949,1958 ---- style = (int)template_getfloat(scalartemplate, gensym("style"), x->scalar->v, 0); filestyle = (style == PLOTSTYLE_POINTS ? 1 : (style == PLOTSTYLE_POLY ? 0 : style)); ! binbuf_addv(b, "ttsisi;","#X","array", x->realname, array->n, &s_float, x->saveit+2*filestyle+8*x->hidename); if (x->saveit) { int n = array->n, n2 = 0; while (n2 < n) { int chunk = imin(n-n2,1000); ! binbuf_addv(b,"ti","#A",n2); for (int i=0; i<chunk; i++) binbuf_addv(b, "f", ((float *)array->vec)[n2+i]); binbuf_addv(b, ";"); *************** *** 2938,2947 **** canvas_addtemplatesforscalar(s->t, s->v, &ntemplates, &templatevec); } ! binbuf_addv(b, "s;", gensym("data")); for (int i=0; i<ntemplates; i++) { t_template *t = template_findbyname(templatevec[i]); int m = t->n; /* drop "pd-" prefix from template symbol to print it: */ ! binbuf_addv(b, "ss;", gensym("template"), gensym(templatevec[i]->s_name + 3)); for (int j=0; j<m; j++) { t_symbol *type; --- 2937,2946 ---- canvas_addtemplatesforscalar(s->t, s->v, &ntemplates, &templatevec); } ! binbuf_addv(b,"t;","data"); for (int i=0; i<ntemplates; i++) { t_template *t = template_findbyname(templatevec[i]); int m = t->n; /* drop "pd-" prefix from template symbol to print it: */ ! binbuf_addv(b,"tt;","template",templatevec[i]->s_name + 3); for (int j=0; j<m; j++) { t_symbol *type; *************** *** 2954,2959 **** } if (t->vec[j].type == DT_ARRAY) ! binbuf_addv(b, "sss;", type, t->vec[j].name, gensym(t->vec[j].arraytemplate->s_name + 3)); ! else binbuf_addv(b, "ss;", type, t->vec[j].name); } binbuf_addsemi(b); --- 2953,2958 ---- } if (t->vec[j].type == DT_ARRAY) ! binbuf_addv(b,"sst;", type, t->vec[j].name, t->vec[j].arraytemplate->s_name + 3); ! else binbuf_addv(b,"ss;", type, t->vec[j].name); } binbuf_addsemi(b); *************** *** 2997,3001 **** int x1=x->screenx1, xs=x->screenx2-x1; int y1=x->screeny1, ys=x->screeny2-y1; ! binbuf_addv(b, "ssiiii", gensym("#N"), gensym("canvas"), x1, y1, xs, ys); if (x->owner && !x->env) { /* subpatch */ binbuf_addv(b, "si;", (patchsym != &s_ ? patchsym: gensym("(subpatch)")), x->mapped); --- 2996,3000 ---- int x1=x->screenx1, xs=x->screenx2-x1; int y1=x->screeny1, ys=x->screeny2-y1; ! binbuf_addv(b,"ttiiii","#N","canvas",x1,y1,xs,ys); if (x->owner && !x->env) { /* subpatch */ binbuf_addv(b, "si;", (patchsym != &s_ ? patchsym: gensym("(subpatch)")), x->mapped); *************** *** 3014,3018 **** that old versions of Pd can at least do something with it. otherwise write in 0.38-compatible form. */ ! binbuf_addv(b, "ssffffffi", gensym("#X"), gensym("coords"), x->x1, x->y1, x->x2, x->y2, (float)x->pixwidth, (float)x->pixheight, x->isgraph?x->hidetext?2:1:0); --- 3013,3017 ---- that old versions of Pd can at least do something with it. otherwise write in 0.38-compatible form. */ ! binbuf_addv(b,"ttffffffi","#X","coords", x->x1, x->y1, x->x2, x->y2, (float)x->pixwidth, (float)x->pixheight, x->isgraph?x->hidetext?2:1:0); *************** *** 3027,3031 **** int from = canvas_getindex(x,t.from); int to = canvas_getindex(x,t.to); ! binbuf_addv(b, "ssiiii;", gensym("#X"), gensym("connect"), from, t.outlet, to, t.inlet); appendix_save(oc,b); } --- 3026,3030 ---- int from = canvas_getindex(x,t.from); int to = canvas_getindex(x,t.to); ! binbuf_addv(b, "ttiiii;","#X","connect", from, t.outlet, to, t.inlet); appendix_save(oc,b); } *************** *** 3059,3063 **** } /* drop "pd-" prefix from template symbol to print */ ! binbuf_addv(b, "sss", &s__N, gensym("struct"), gensym(templatevec[i]->s_name + 3)); for (j = 0; j < m; j++) { t_symbol *type; --- 3058,3062 ---- } /* drop "pd-" prefix from template symbol to print */ ! binbuf_addv(b,"ttt","#N","struct",templatevec[i]->s_name+3); for (j = 0; j < m; j++) { t_symbol *type; *************** *** 3069,3074 **** default: type = &s_float; bug("canvas_write"); } ! binbuf_addv(b, "ss", type, t->vec[j].name); ! if (t->vec[j].type == DT_ARRAY) binbuf_addv(b, "s", gensym(t->vec[j].arraytemplate->s_name + 3)); } binbuf_addsemi(b); --- 3068,3073 ---- default: type = &s_float; bug("canvas_write"); } ! binbuf_addv(b,"ss",type,t->vec[j].name); ! if (t->vec[j].type == DT_ARRAY) binbuf_addv(b, "t", t->vec[j].arraytemplate->s_name + 3); } binbuf_addsemi(b); *************** *** 3746,3750 **** t_binbuf *b2 = binbuf_new(); canvas_writescalar(x->t, x->v, b2, 0); ! binbuf_addv(b, "ss", &s__X, gensym("scalar")); binbuf_addbinbuf(b, b2); binbuf_addsemi(b); --- 3745,3749 ---- t_binbuf *b2 = binbuf_new(); canvas_writescalar(x->t, x->v, b2, 0); ! binbuf_addv(b,"tt","#X","scalar"); binbuf_addbinbuf(b, b2); binbuf_addsemi(b); *************** *** 6092,6105 **** t_canvas *c = (t_canvas *)z; /* in case it is */ if (x->_class == message_class) { ! binbuf_addv(b, "ssii", gensym("#X"), gensym("msg"), (t_int)x->x, (t_int)x->y); binbuf_addbinbuf(b, x->binbuf); } else if (x->_class == gatom_class) { t_gatom *g = (t_gatom *)x; t_symbol *sel = g->atom.a_type==A_SYMBOL? gensym("symbolatom") : gensym("floatatom"); ! binbuf_addv(b, "ssii", gensym("#X"), sel, (t_int)x->x, (t_int)x->y); ! binbuf_addv(b, "iffi", (t_int)g->width, g->min, g->max, (t_int)g->wherelabel); ! binbuf_addv(b, "sss", gatom_escapit(g->label), gatom_escapit(g->rcv), gatom_escapit(g->snd)); } else if (x->_class == text_class) { ! binbuf_addv(b, "ssii", gensym("#X"), gensym("text"), (t_int)x->x, (t_int)x->y); binbuf_addbinbuf(b, x->binbuf); } else { --- 6091,6104 ---- t_canvas *c = (t_canvas *)z; /* in case it is */ if (x->_class == message_class) { ! binbuf_addv(b,"ttii","#X","msg", (t_int)x->x, (t_int)x->y); binbuf_addbinbuf(b, x->binbuf); } else if (x->_class == gatom_class) { t_gatom *g = (t_gatom *)x; t_symbol *sel = g->atom.a_type==A_SYMBOL? gensym("symbolatom") : gensym("floatatom"); ! binbuf_addv(b,"tsii","#X", sel, (t_int)x->x, (t_int)x->y); ! binbuf_addv(b,"iffi", (t_int)g->width, g->min, g->max, (t_int)g->wherelabel); ! binbuf_addv(b,"sss", gatom_escapit(g->label), gatom_escapit(g->rcv), gatom_escapit(g->snd)); } else if (x->_class == text_class) { ! binbuf_addv(b, "ttii","#X","text", (t_int)x->x, (t_int)x->y); binbuf_addbinbuf(b, x->binbuf); } else { *************** *** 6107,6113 **** !(x->_class==canvas_class && (canvas_isabstraction(c) || canvas_istable(c)))) { mess1(x,gensym("saveto"),b); ! binbuf_addv(b, "ssii", gensym("#X"), gensym("restore"), (t_int)x->x, (t_int)x->y); } else { ! binbuf_addv(b, "ssii", gensym("#X"), gensym("obj"), (t_int)x->x, (t_int)x->y); } if (x->binbuf) { --- 6106,6112 ---- !(x->_class==canvas_class && (canvas_isabstraction(c) || canvas_istable(c)))) { mess1(x,gensym("saveto"),b); ! binbuf_addv(b,"ttii","#X","restore", (t_int)x->x, (t_int)x->y); } else { ! binbuf_addv(b,"ttii","#X","obj", (t_int)x->x, (t_int)x->y); } if (x->binbuf) { *************** *** 6461,6465 ****
static int pd_savehead(t_binbuf *b, t_iemgui *x, char *name) { ! binbuf_addv(b, "ssiis", gensym("#X"), gensym("obj"), (t_int)x->x, (t_int)x->y, gensym(name)); return 1; } --- 6460,6464 ----
static int pd_savehead(t_binbuf *b, t_iemgui *x, char *name) { ! binbuf_addv(b, "ttiit","#X","obj", (t_int)x->x, (t_int)x->y, name); return 1; } *************** *** 6475,6479 **** canvas_savecontainerto((t_canvas *)self,b); canvas_savecoordsto((t_canvas *)self,b); /* this may be too early */ ! binbuf_addv(b, "ssii", gensym("#X"), gensym("restore"), (t_int)x->x, (t_int)x->y); if (x->binbuf) { binbuf_addbinbuf(b, x->binbuf); --- 6474,6478 ---- canvas_savecontainerto((t_canvas *)self,b); canvas_savecoordsto((t_canvas *)self,b); /* this may be too early */ ! binbuf_addv(b, "ttii", "#X","restore", (t_int)x->x, (t_int)x->y); if (x->binbuf) { binbuf_addbinbuf(b, x->binbuf); *************** *** 7283,7287 **** if (pd_class(y) == declare_class) { ! binbuf_addv(b, "s", gensym("#X")); binbuf_addbinbuf(b, ((t_declare *)y)->x_obj.te_binbuf); binbuf_addv(b, ";"); --- 7282,7286 ---- if (pd_class(y) == declare_class) { ! binbuf_addv(b,"t","#X"); binbuf_addbinbuf(b, ((t_declare *)y)->x_obj.te_binbuf); binbuf_addv(b, ";");