Update of /cvsroot/pure-data/externals/mrpeach/osc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1733
Modified Files: routeOSC.c Log Message: fixed crasher-bug when a "bang" was sent to the [routeOSC] object; replaced post() by pd_error() where appropriate
Index: routeOSC.c =================================================================== RCS file: /cvsroot/pure-data/externals/mrpeach/osc/routeOSC.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** routeOSC.c 16 Aug 2006 20:22:22 -0000 1.1 --- routeOSC.c 13 Nov 2007 11:46:22 -0000 1.2 *************** *** 167,171 **** if (argc > MAX_NUM) { ! post("* routeOSC: too many arguments: %ld (max %ld)", argc, MAX_NUM); return 0; } --- 167,171 ---- if (argc > MAX_NUM) { ! error("* routeOSC: too many arguments: %ld (max %ld)", argc, MAX_NUM); return 0; } *************** *** 196,205 **** else if (argv[i].a_type == A_FLOAT) { ! post("* routeOSC: float arguments are not OK."); return 0; } else { ! post("* routeOSC: unrecognized argument type!"); return 0; } --- 196,205 ---- else if (argv[i].a_type == A_FLOAT) { ! error("* routeOSC: float arguments are not OK."); return 0; } else { ! error("* routeOSC: unrecognized argument type!"); return 0; } *************** *** 220,224 **** if (argc > x->x_num) { ! post ("routeOSC: too many paths"); return; } --- 220,224 ---- if (argc > x->x_num) { ! pd_error (x, "routeOSC: too many paths"); return; } *************** *** 227,236 **** if (argv[i].a_type != A_SYMBOL) { ! post ("routeOSC: path %d not a symbol", i); return; } if (argv[i].a_w.w_symbol->s_name[0] != '/') { ! post ("routeOSC: path %d doesn't start with /", i); return; } --- 227,236 ---- if (argv[i].a_type != A_SYMBOL) { ! pd_error (x, "routeOSC: path %d not a symbol", i); return; } if (argv[i].a_w.w_symbol->s_name[0] != '/') { ! pd_error (x, "routeOSC: path %d doesn't start with /", i); return; } *************** *** 247,252 **** static void routeOSC_list(t_routeOSC *x, t_symbol *s, int argc, t_atom *argv) { ! if (argc > 0 && argv[0].a_type == A_SYMBOL) { /* Ignore the fact that this is a "list" */ routeOSC_doanything(x, argv[0].a_w.w_symbol, argc-1, argv+1); --- 247,257 ---- static void routeOSC_list(t_routeOSC *x, t_symbol *s, int argc, t_atom *argv) { ! if(argc < 1) { + pd_error(x, "* routeOSC: ignoring empty list..."); + return; + } + if (argv[0].a_type == A_SYMBOL) + { /* Ignore the fact that this is a "list" */ routeOSC_doanything(x, argv[0].a_w.w_symbol, argc-1, argv+1); *************** *** 254,266 **** else { ! // post("* OSC-route: invalid list beginning with a number"); // output on unmatched outlet jdl 20020908 if (argv[0].a_type == A_FLOAT) { ! outlet_float(x->x_outlets[x->x_num], argv[0].a_w.w_float); } else { ! post("* routeOSC: unrecognized atom type!"); } } --- 259,271 ---- else { ! // pd_error(x, "* OSC-route: invalid list beginning with a number"); // output on unmatched outlet jdl 20020908 if (argv[0].a_type == A_FLOAT) { ! outlet_float(x->x_outlets[x->x_num], atom_getfloat(argv)); } else { ! pd_error(x, "* routeOSC: unrecognized atom type!"); } } *************** *** 277,281 **** if (pattern[0] != '/') { ! post("* routeOSC: invalid message pattern %s does not begin with /", s->s_name); outlet_anything(x->x_outlets[x->x_num], s, argc, argv); return; --- 282,286 ---- if (pattern[0] != '/') { ! pd_error(x, "* routeOSC: invalid message pattern %s does not begin with /", s->s_name); outlet_anything(x->x_outlets[x->x_num], s, argc, argv); return; *************** *** 320,324 **** else { ! post("* routeOSC: unrecognized atom type!"); } } --- 325,329 ---- else { ! pd_error(x, "* routeOSC: unrecognized atom type!"); } } *************** *** 400,404 **** case ']': case '}': ! post("routeOSC: Spurious %c in pattern ".../%s/..."",pattern[0], theWholePattern); return 0; case '[': --- 405,409 ---- case ']': case '}': ! error("routeOSC: Spurious %c in pattern ".../%s/..."",pattern[0], theWholePattern); return 0; case '[': *************** *** 426,430 **** if (pattern[1] == 0) { ! post("routeOSC: Unterminated [ in pattern ".../%s/..."", theWholePattern); return 0; } --- 431,435 ---- if (pattern[1] == 0) { ! error("routeOSC: Unterminated [ in pattern ".../%s/..."", theWholePattern); return 0; } *************** *** 438,442 **** if (*p == 0) { ! post("Unterminated [ in pattern ".../%s/..."", theWholePattern); return 0; } --- 443,447 ---- if (*p == 0) { ! error("Unterminated [ in pattern ".../%s/..."", theWholePattern); return 0; } *************** *** 463,467 **** if (*p == 0) { ! post("Unterminated [ in pattern ".../%s/..."", theWholePattern); return 0; } --- 468,472 ---- if (*p == 0) { ! error("Unterminated [ in pattern ".../%s/..."", theWholePattern); return 0; } *************** *** 479,483 **** if (*restOfPattern == 0) { ! post("Unterminated { in pattern ".../%s/..."", theWholePattern); return 0; } --- 484,488 ---- if (*restOfPattern == 0) { ! error("Unterminated { in pattern ".../%s/..."", theWholePattern); return 0; }