Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6941
Modified Files: Tag: desiredata builtins.c Log Message: fixed another [route] bug
Index: builtins.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v retrieving revision 1.1.2.58 retrieving revision 1.1.2.59 diff -C2 -d -r1.1.2.58 -r1.1.2.59 *** builtins.c 10 Aug 2007 03:32:15 -0000 1.1.2.58 --- builtins.c 11 Aug 2007 06:12:15 -0000 1.1.2.59 *************** *** 1405,1417 **** static void route_anything(t_route *x, t_symbol *sel, int argc, t_atom *argv) { t_routeelement *e = x->vec; for (int n = x->n; n--; e++) if (e->a.a_type == A_SYMBOL) if (e->a.a_symbol == sel) { ! if (argc > 0 && argv[0].a_type == A_SYMBOL) ! outlet_anything(e->out, argv[0].a_symbol, argc-1, argv+1); else { /* tb {: avoid 1 element lists */ if (argc > 1) outlet_list(e->out, 0, argc, argv); else if (argc == 0) outlet_bang(e->out); ! else if (argv[0].a_type == A_FLOAT) outlet_float( e->out, argv[0].a_float); ! else if (argv[0].a_type == A_SYMBOL) outlet_symbol( e->out, argv[0].a_symbol); ! else if (argv[0].a_type == A_POINTER) outlet_pointer(e->out, argv[0].a_pointer); } /* tb } */ return; --- 1405,1415 ---- static void route_anything(t_route *x, t_symbol *sel, int argc, t_atom *argv) { t_routeelement *e = x->vec; + post("1: sel=%s",sel->name); for (int n = x->n; n--; e++) if (e->a.a_type == A_SYMBOL) if (e->a.a_symbol == sel) { ! if (argc > 0 && argv[0].a_type == A_SYMBOL) outlet_anything(e->out, argv[0].a_symbol, argc-1, argv+1); else { /* tb {: avoid 1 element lists */ if (argc > 1) outlet_list(e->out, 0, argc, argv); else if (argc == 0) outlet_bang(e->out); ! else outlet_atom(e->out,&argv[0]); } /* tb } */ return; *************** *** 1424,1428 **** if (argc && argv->a_type == A_FLOAT) { float f = atom_getfloat(argv); ! route_eachr(e,x) if (e->a.a_float == f) { if (argc > 1 && argv[1].a_type == A_SYMBOL) outlet_anything(e->out, argv[1].a_symbol, argc-2, argv+2); --- 1422,1426 ---- if (argc && argv->a_type == A_FLOAT) { float f = atom_getfloat(argv); ! route_eachr(e,x) if (e->a.a_type == A_FLOAT && e->a.a_float == f || e->a.a_type == A_SYMBOL && e->a.a_symbol == &s_float) { if (argc > 1 && argv[1].a_type == A_SYMBOL) outlet_anything(e->out, argv[1].a_symbol, argc-2, argv+2); *************** *** 1431,1437 **** if (argc > 1) outlet_list(e->out, 0, argc, argv); else if (argc == 0) outlet_bang(e->out); ! else if (argv[0].a_type == A_FLOAT) outlet_float( e->out, argv[0].a_float); ! else if (argv[0].a_type == A_SYMBOL) outlet_symbol( e->out, argv[0].a_symbol); ! else if (argv[0].a_type == A_POINTER) outlet_pointer(e->out, argv[0].a_pointer); } return; --- 1429,1433 ---- if (argc > 1) outlet_list(e->out, 0, argc, argv); else if (argc == 0) outlet_bang(e->out); ! else outlet_atom(e->out,&argv[0]); } return; *************** *** 1439,1450 **** } else { /* symbol arguments */ if (argc > 1) { /* 2 or more args: treat as "list" */ ! route_eachr(e,x) if (e->a.a_symbol == &s_list) { if (argv[0].a_type==A_SYMBOL) outlet_anything(e->out, argv[0].a_symbol, argc-1, argv+1); else outlet_list(e->out, 0, argc, argv); return; } ! } else if (argc==0) { route_eachr(e,x) {if (e->a.a_symbol==&s_bang ) {outlet_bang( e->out ); return;}} ! } else if (argv[0].a_type==A_FLOAT) {route_eachr(e,x) {if (e->a.a_symbol==&s_float ) {outlet_float( e->out, argv[0].a_float ); return;}} ! } else {route_eachr(e,x) {if (e->a.a_symbol==&s_symbol) {outlet_symbol(e->out, argv[0].a_symbol); return;}} } } --- 1435,1447 ---- } else { /* symbol arguments */ if (argc > 1) { /* 2 or more args: treat as "list" */ ! route_eachr(e,x) if (e->a.a_type == A_SYMBOL && e->a.a_symbol == &s_list) { if (argv[0].a_type==A_SYMBOL) outlet_anything(e->out, argv[0].a_symbol, argc-1, argv+1); else outlet_list(e->out, 0, argc, argv); return; } ! } else if (argc==0) {route_eachr(e,x) {if (e->a.a_symbol==&s_bang ) {outlet_bang(e->out ); return;}} ! } else if (argv[0].a_type==A_FLOAT) {route_eachr(e,x) {if (e->a.a_symbol==&s_float ) {outlet_atom(e->out,&argv[0]); return;}} ! } else if (argv[0].a_type==A_SYMBOL) {route_eachr(e,x) {if (e->a.a_symbol==&s_symbol ) {outlet_atom(e->out,&argv[0]); return;}} ! } else if (argv[0].a_type==A_POINTER){route_eachr(e,x) {if (e->a.a_symbol==&s_pointer) {outlet_atom(e->out,&argv[0]); return;}} } }