Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25491
Modified Files: Tag: devel_0_39 x_list.c x_connective.c Log Message: fixing yesterday's new bug.
Index: x_connective.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/x_connective.c,v retrieving revision 1.3.4.1.2.9 retrieving revision 1.3.4.1.2.10 diff -C2 -d -r1.3.4.1.2.9 -r1.3.4.1.2.10 *** x_connective.c 28 Nov 2006 15:46:09 -0000 1.3.4.1.2.9 --- x_connective.c 29 Nov 2006 16:06:29 -0000 1.3.4.1.2.10 *************** *** 9,12 **** --- 9,19 ---- #include <string.h> #include <stdio.h> + extern t_pd *newest; + + #ifdef DESIRE + void pd_set_newest(t_pd *); + #else + #define pd_set_newest(x) (newest=(x)) + #endif
/* -------------------------- int ------------------------------ */ *************** *** 66,69 **** --- 73,77 ---- outlet_new(&x->x_obj, &s_float); floatinlet_new(&x->x_obj, &x->x_f); + pd_set_newest((t_pd *)x); return (x); } *************** *** 108,111 **** --- 116,120 ---- outlet_new(&x->x_obj, &s_symbol); symbolinlet_new(&x->x_obj, &x->x_s); + pd_set_newest((t_pd *)x); return (x); } *************** *** 163,166 **** --- 172,176 ---- t_bang *x = (t_bang *)pd_new(bang_class); outlet_new(&x->x_obj, &s_bang); + pd_set_newest((t_pd *)x); return (x); }
Index: x_list.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/x_list.c,v retrieving revision 1.2.2.8 retrieving revision 1.2.2.9 diff -C2 -d -r1.2.2.8 -r1.2.2.9 *** x_list.c 28 Nov 2006 15:36:03 -0000 1.2.2.8 --- x_list.c 29 Nov 2006 16:06:29 -0000 1.2.2.9 *************** *** 21,24 **** --- 21,27 ---- #endif
+ extern t_pd *newest; + + /* the "list" object family.
*************** *** 393,408 **** static void *list_new(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { if (!argc || argv[0].a_type != A_SYMBOL) ! return list_append_new(s, argc, argv); else { t_symbol *s2 = argv[0].a_w.w_symbol; ! if (s2 == gensym("append")) return list_append_new(s, argc-1, argv+1); ! if (s2 == gensym("prepend")) return list_prepend_new(s, argc-1, argv+1); ! if (s2 == gensym("split")) return list_split_new(atom_getfloatarg(1, argc, argv)); ! if (s2 == gensym("trim")) return list_trim_new(); ! error("list %s: unknown function", s2->s_name); ! return 0; } }
--- 396,427 ---- static void *list_new(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { + #ifdef DESIRE + void pd_set_newest(t_pd *); + t_pd *newest = 0; /* hide global var */ + #endif if (!argc || argv[0].a_type != A_SYMBOL) ! newest = list_append_new(s, argc, argv); else { t_symbol *s2 = argv[0].a_w.w_symbol; ! if (s2 == gensym("append")) ! newest = list_append_new(s, argc-1, argv+1); ! else if (s2 == gensym("prepend")) ! newest = list_prepend_new(s, argc-1, argv+1); ! else if (s2 == gensym("split")) ! newest = list_split_new(atom_getfloatarg(1, argc, argv)); ! else if (s2 == gensym("trim")) ! newest = list_trim_new(); ! else ! { ! error("list %s: unknown function", s2->s_name); ! newest = 0; ! } } + #ifdef DESIRE + /* workaround for bug in m_class.c */ + pd_set_newest(newest); + #endif + return (newest); }