[Gridflow-cvs] [svn] commit: r6223 - /trunk/src/classes2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Tue Sep 7 21:49:55 EDT 2010


Author: matju
Date: Tue Sep  7 21:49:54 2010
New Revision: 6223

Log:
fix the previous fix to [args]

Modified:
    trunk/src/classes2.cxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Tue Sep  7 21:49:54 2010
@@ -119,6 +119,7 @@
 void Args::process_args (int argc, t_atom *argv) {
 	t_canvas *canvas = canvas_getrootfor(mom);
 	t_symbol *wildcard = gensym("*");
+	bool have_rest = false;
 	for (int i=sargs.size()-1; i>=0; i--) {
 		t_atom2 *v;
 		if (i>=argc) {
@@ -131,13 +132,14 @@
 		} else v = (t_atom2 *)&argv[i];
 		if (sargs[i].name==wildcard) {
 			if (argc-i>0) out[i](argc-i,argv+i); else out[i]();
-			return;
+			have_rest = true;
 		} else {
 			if (v->a_type==A_LIST) {t_binbuf *b = *v; out[i](binbuf_getnatom(b),binbuf_getvec(b));}
 			else                                      out[i](*v);
 		}
 	}
-	if (argc>int(sargs.size())) pd_error(canvas,"warning: too many args (got %d, want %d)", argc, int(sargs.size()));
+	if (argc>int(sargs.size()) && !have_rest)
+		pd_error(canvas,"warning: too many args (got %d, want %d)", argc, int(sargs.size()));
 }
 \end class {install("args",1,1);}
 



More information about the Gridflow-cvs mailing list