Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11828
Modified Files: Tag: desiredata builtins.c Log Message: added route_eachr()
Index: builtins.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -C2 -d -r1.1.2.12 -r1.1.2.13 *** builtins.c 9 Jan 2007 18:33:54 -0000 1.1.2.12 --- builtins.c 9 Jan 2007 18:58:26 -0000 1.1.2.13 *************** *** 825,830 **** outlet_list(x->out2, &s_list, argc-n, argv+n); outlet_list(x->out1, &s_list, n, argv); ! } ! else outlet_list(x->out3, &s_list, argc, argv); } static void list_split_anything(t_list_split *x, t_symbol *s, int argc, t_atom *argv) { --- 825,829 ---- outlet_list(x->out2, &s_list, argc-n, argv+n); outlet_list(x->out1, &s_list, n, argv); ! } else outlet_list(x->out3, &s_list, argc, argv); } static void list_split_anything(t_list_split *x, t_symbol *s, int argc, t_atom *argv) { *************** *** 1563,1566 **** --- 1562,1567 ---- outlet_anything(x->rejectout, sel, argc, argv); } + + #define route_eachr(E,L) for (t_routeelement *E = L->vec;E;E=0) for (int ROUTEN = x->n; ROUTEN--; E++) static void route_list(t_route *x, t_symbol *sel, int argc, t_atom *argv) { if (x->type == A_FLOAT) { *************** *** 1574,1579 **** argc -= 1, argv+=1; if (argc > 1) outlet_list(e->e_outlet, 0, argc, argv); ! else if (argc == 0) /* bang */ ! outlet_bang(e->e_outlet); else if (argv[0].a_type == A_FLOAT) outlet_float( e->e_outlet, argv[0].a_w.w_float); else if (argv[0].a_type == A_SYMBOL) outlet_symbol( e->e_outlet, argv[0].a_w.w_symbol); --- 1575,1579 ---- argc -= 1, argv+=1; if (argc > 1) outlet_list(e->e_outlet, 0, argc, argv); ! else if (argc == 0) outlet_bang(e->e_outlet); else if (argv[0].a_type == A_FLOAT) outlet_float( e->e_outlet, argv[0].a_w.w_float); else if (argv[0].a_type == A_SYMBOL) outlet_symbol( e->e_outlet, argv[0].a_w.w_symbol); *************** *** 1584,1589 **** } else { /* symbol arguments */ if (argc > 1) { /* 2 or more args: treat as "list" */ ! t_routeelement *e = x->vec; ! for (int n = x->n; n--; e++) { if (e->e_w.w_symbol == &s_list) { if (argv[0].a_type==A_SYMBOL) outlet_anything(e->e_outlet, argv[0].a_w.w_symbol, argc-1, argv+1); --- 1584,1588 ---- } else { /* symbol arguments */ if (argc > 1) { /* 2 or more args: treat as "list" */ ! route_eachr(e,x) { if (e->e_w.w_symbol == &s_list) { if (argv[0].a_type==A_SYMBOL) outlet_anything(e->e_outlet, argv[0].a_w.w_symbol, argc-1, argv+1); *************** *** 1592,1618 **** } } ! } else if (argc == 0) { /* no args: treat as "bang" */ ! t_routeelement *e = x->vec; ! for (int n = x->n; n--; e++) { ! if (e->e_w.w_symbol == &s_bang) { ! outlet_bang(e->e_outlet); ! return; ! } } } else if (argv[0].a_type == A_FLOAT) { ! t_routeelement *e = x->vec; ! for (int n = x->n; n--; e++) { ! if (e->e_w.w_symbol == &s_float) { ! outlet_float(e->e_outlet, argv[0].a_w.w_float); ! return; ! } } } else { ! t_routeelement *e = x->vec; ! for (int n = x->n; n--; e++) { ! if (e->e_w.w_symbol == &s_symbol) { ! outlet_symbol(e->e_outlet, argv[0].a_w.w_symbol); ! return; ! } } } --- 1591,1605 ---- } } ! } else if (argc == 0) { ! route_eachr(e,x) { ! if (e->e_w.w_symbol == &s_bang) {outlet_bang(e->e_outlet); return;} } } else if (argv[0].a_type == A_FLOAT) { ! route_eachr(e,x) { ! if (e->e_w.w_symbol == &s_float) {outlet_float(e->e_outlet, argv[0].a_w.w_float); return;} } } else { ! route_eachr(e,x) { ! if (e->e_w.w_symbol == &s_symbol) {outlet_symbol(e->e_outlet, argv[0].a_w.w_symbol); return;} } }