[Gridflow-cvs] [svn] commit: r3603 - in /trunk: format/main.c optional/opencv.c rubyext.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Apr 18 18:02:02 EDT 2008


Author: matju
Date: Fri Apr 18 18:02:02 2008
New Revision: 3603

Log:
t_atom2* in argument passing instead of Ruby*

Modified:
    trunk/format/main.c
    trunk/optional/opencv.c
    trunk/rubyext.c

Modified: trunk/format/main.c
==============================================================================
--- trunk/format/main.c (original)
+++ trunk/format/main.c Fri Apr 18 18:02:02 2008
@@ -237,9 +237,10 @@
 } GRID_END
 
 \def 0 headerless_m (...) {
-	if (argc>=0 && TYPE(argv[0])==T_ARRAY) {argc = rb_ary_len(argv[0]); argv = rb_ary_ptr(argv[0]);}
+	if (argc>=0 && argv[0].a_type==A_LIST) {
+		t_binbuf *b = (t_binbuf *)argv[0]; argc = binbuf_getnatom(b); argv = (t_atom2 *)binbuf_getvec(b);}
 	int v[argc];
-	for (int i=0; i<argc; i++) v[i] = NUM2INT(argv[i]);
+	for (int i=0; i<argc; i++) v[i] = argv[i];
 	headerless = new Dim(argc,v);
 }
 \def 0 headerful () { headerless = 0; }

Modified: trunk/optional/opencv.c
==============================================================================
--- trunk/optional/opencv.c (original)
+++ trunk/optional/opencv.c Fri Apr 18 18:02:02 2008
@@ -82,10 +82,10 @@
 	cv_mode_nochannels,
 };
 
-CvMode convert (Ruby x, CvMode *foo) {
-	if (x==SYM(auto))       return cv_mode_auto;
-	if (x==SYM(channels))   return cv_mode_channels;
-	if (x==SYM(nochannels)) return cv_mode_nochannels;
+CvMode convert (const t_atom2 &x, CvMode *foo) {
+	if (x==gensym("auto"))       return cv_mode_auto;
+	if (x==gensym("channels"))   return cv_mode_channels;
+	if (x==gensym("nochannels")) return cv_mode_nochannels;
 	RAISE("invalid CvMode");
 }
 

Modified: trunk/rubyext.c
==============================================================================
--- trunk/rubyext.c (original)
+++ trunk/rubyext.c Fri Apr 18 18:02:02 2008
@@ -111,14 +111,11 @@
 	return 0;
 }
 
+void call_super(int argc, t_atom *argv) {/* unimplemented */}
+
 static void funcall (BFObject *bself, const char *sel, int argc, t_atom *argv, bool silent=false) {
 	RMethod method = funcall_lookup(bself,sel);
-	if (method) {
-		Ruby argv2[argc];
-		pd2ruby(argc,argv2,argv);
-		method(bself->self,argc,argv2);
-		return;
-	}
+	if (method) {method(bself->self,argc,(t_atom2 *)argv); return;}
 	if (!silent) pd_error((t_pd *)bself, "method not found: '%s'",sel);
 }
 



More information about the Gridflow-cvs mailing list