[Gridflow-cvs] [svn] commit: r3860 - /trunk/base/flow_objects.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Jun 11 15:27:11 EDT 2008


Author: matju
Date: Wed Jun 11 15:27:11 2008
New Revision: 3860

Log:
make [args]'s errors work like [gf.error]

Modified:
    trunk/base/flow_objects.c

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Wed Jun 11 15:27:11 2008
@@ -33,6 +33,8 @@
 #include "bundled/g_canvas.h"
 };
 #endif
+
+extern "C" t_canvas *canvas_getrootfor(t_canvas *x);
 
 /* both oprintf are copied from desiredata */
 
@@ -2273,7 +2275,6 @@
 \def 0 float (float f) {_0_list(argc,argv);}
 \def 0 symbol (t_symbol *s) {_0_list(argc,argv);}
 
-extern "C" t_canvas *canvas_getrootfor(t_canvas *x);
 \def 0 list (...) {
 	std::ostringstream o;
 	pd_oprintf(o,format.data(),argc,argv);
@@ -2663,6 +2664,7 @@
 	}
 }
 void Args::process_args (int argc, t_atom *argv) {
+	t_canvas *canvas = canvas_getrootfor(bself->mom);
 	t_symbol *wildcard = gensym("*");
 	for (int i=sargc-1; i>=0; i--) {
 		t_atom *v;
@@ -2670,7 +2672,7 @@
 			if (sargv[i].defaultv.a_type != A_NULL) {
 				v = &sargv[i].defaultv;
 			} else if (sargv[i].name!=wildcard) {
-				post("missing argument $%d named \"%s\"", i+1,sargv[i].name->s_name);
+				pd_error(canvas,"missing argument $%d named \"%s\"", i+1,sargv[i].name->s_name);
 				continue;
 			}
 		} else v = &argv[i];
@@ -2685,7 +2687,7 @@
 			else outlet_anything2(bself->outlets[i],1,v);
 		}
 	}
-	if (argc>sargc && sargv[sargc-1].name!=wildcard) post("warning: too many args (got %d, want %d)", argc, sargc);
+	if (argc>sargc && sargv[sargc-1].name!=wildcard) pd_error(canvas,"warning: too many args (got %d, want %d)", argc, sargc);
 }
 \end class {install("args",1,1);}
 



More information about the Gridflow-cvs mailing list