[Gridflow-cvs] [svn] commit: r3610 - in /trunk: base/flow_objects.c base/grid.c base/grid.h base/source_filter.rb format/main.c optional/opencv.c rubyext.c

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


Author: matju
Date: Fri Apr 18 18:51:06 2008
New Revision: 3610

Log:
remove <ruby.h>

Modified:
    trunk/base/flow_objects.c
    trunk/base/grid.c
    trunk/base/grid.h
    trunk/base/source_filter.rb
    trunk/format/main.c
    trunk/optional/opencv.c
    trunk/rubyext.c

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Fri Apr 18 18:51:06 2008
@@ -26,6 +26,7 @@
 #include <math.h>
 #include <string>
 #include <sstream>
+#include <errno.h>
 #include "grid.h.fcs"
 #ifndef DESIREDATA
 extern "C" {

Modified: trunk/base/grid.c
==============================================================================
--- trunk/base/grid.c (original)
+++ trunk/base/grid.c Fri Apr 18 18:51:06 2008
@@ -106,11 +106,7 @@
 		init(new Dim(),int32_e);
 		CHECK_ALIGN2(this->data,nt);
 		((int32 *)*this)[0] = (int32)x.a_float;
-	} else {
-		rb_funcall(
-		EVAL("proc{|x| raise \"can't convert to grid: #{x.inspect}\"}"),
-		SI(call),1,x);
-	}
+	} else RAISE("can't convert to grid");
 }
 
 // **************** GridInlet *************************************

Modified: trunk/base/grid.h
==============================================================================
--- trunk/base/grid.h (original)
+++ trunk/base/grid.h Fri Apr 18 18:51:06 2008
@@ -44,17 +44,6 @@
 ALLOCPREFIX void operator delete[](void*p) throw() {gffree(p);}
 ALLOCPREFIX void operator delete  (void*p, const std::nothrow_t&) throw() {gffree(p);}
 ALLOCPREFIX void operator delete[](void*p, const std::nothrow_t&) throw() {gffree(p);}
-
-#ifdef USE_RUBY
-extern "C" {
-#include <ruby.h>
-#include <rubyio.h>
-#include <version.h>
-#ifndef RUBY_H
-#error "Can't do anything without ruby.h"
-#endif
-};
-#endif
 
 #ifdef __WIN32__
 #define INT winINT
@@ -631,10 +620,9 @@
 struct FClass {
 	void *(*allocator)(MESSAGE); // returns a new C++ object
 	void (*startup)(FClass *);
-	const char *cname; // C++/Ruby name (not PD name)
-	int methodsn; MethodDecl *methods; // C++ -> Ruby methods
+	const char *cname; // C++ name (not PD name)
+	int methodsn; MethodDecl *methods;
 	FClass *super;
-
 	int ninlets;
 	int noutlets;
 	t_class *bfclass;
@@ -726,9 +714,6 @@
 \class GridObject : FObject {
 	std::vector<P<GridInlet> > in;
 	P<GridOutlet> out;
-	// Make sure you distinguish #close/#delete, and C++'s delete. The first
-	// two are quite equivalent and should never make an object "crashable".
-	// C++'s delete is called by Ruby's garbage collector or by PureData's delete.
 	GridObject(MESSAGE) : FObject(MESSAGE2) {}
 	~GridObject() {}
 	bool is_busy_except(P<GridInlet> gin) {

Modified: trunk/base/source_filter.rb
==============================================================================
--- trunk/base/source_filter.rb (original)
+++ trunk/base/source_filter.rb Fri Apr 18 18:51:06 2008
@@ -163,7 +163,6 @@
 	Out.print "void #{classname}::#{m.selector}_wrap(#{classname} *self, VA) {"
 	Out.print "static const char *methodspec = \"#{qlass.name}::#{m.selector}(#{unparse_arglist m.arglist,false})\";"
 	Out.print "#{m.rettype} foo;" if m.rettype!="void"
-	Out.print "try {"
 	Out.print "if (argc<#{m.minargs}"
 	Out.print "||argc>#{m.maxargs}" if m.maxargs!=-1
 	Out.print ") RAISE(\"got %d args instead of %d..%d in %s\",argc,#{m.minargs},#{m.maxargs},methodspec);"
@@ -177,7 +176,7 @@
 			Out.print ",convert(argv[#{i}],(#{arg.type}*)0)"
 		end
 	}
-	Out.print ");} catch (Barf *oozy) {rb_raise(rb_eArgError,\"%s\",oozy->text);}"
+	Out.print ");"
 	Out.print "} #{m.rettype} #{classname}::#{m.selector}(VA"
 	Out.print ",#{unparse_arglist m.arglist, false}" if m.arglist.length>0
 	Out.print ")#{term} "
@@ -191,7 +190,6 @@
 	Out.print "#{frame.name}(MESSAGE) : #{frame.supername}(MESSAGE2) {"
 	Out.print "static const char *methodspec = \"#{frame.name}::#{m.selector}(#{unparse_arglist m.arglist,false})\";"
 
-	Out.print "try {"
 	Out.print "if (argc<#{m.minargs}"
 	Out.print "||argc>#{m.maxargs}" if m.maxargs!=-1
 	Out.print ") RAISE(\"got %d args instead of %d..%d in %s\",argc,#{m.minargs},#{m.maxargs},methodspec);"
@@ -204,7 +202,7 @@
 			Out.print ",convert(argv[#{i}],(#{arg.type}*)0)"
 		end
 	}
-	Out.print ");} catch (Barf *oozy) {rb_raise(rb_eArgError,\"%s\",oozy->text);}}"
+	Out.print ");}"
 	Out.print "#{m.rettype} #{m.selector}(MESSAGE"
 	Out.print ", #{unparse_arglist m.arglist}" if m.arglist.length>0
 	Out.print ") "+line[/\{.*/]

Modified: trunk/format/main.c
==============================================================================
--- trunk/format/main.c (original)
+++ trunk/format/main.c Fri Apr 18 18:51:06 2008
@@ -24,6 +24,7 @@
 #include "../base/grid.h.fcs"
 #include <string>
 #include <map>
+#include <errno.h>
 #define L _L_
 
 /* API (version 0.9.1)

Modified: trunk/optional/opencv.c
==============================================================================
--- trunk/optional/opencv.c (original)
+++ trunk/optional/opencv.c Fri Apr 18 18:51:06 2008
@@ -23,6 +23,7 @@
 
 #include "../base/grid.h.fcs"
 #include <opencv/cv.h>
+#include <errno.h>
 
 int ipl_eltype(NumberTypeE e) {
   switch (e) {

Modified: trunk/rubyext.c
==============================================================================
--- trunk/rubyext.c (original)
+++ trunk/rubyext.c Fri Apr 18 18:51:06 2008
@@ -398,7 +398,6 @@
     //std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
     std::set_terminate(blargh);
     try {
-	char *foo[] = {"Ruby-for-PureData","-e",";"};
 	char *dirname   = new char[MAXPDSTRING];
 	char *dirresult = new char[MAXPDSTRING];
 	char *nameresult;
@@ -408,8 +407,6 @@
 	if (fd>=0) close(fd); else post("%s was not found via the -path!","gridflow"PDSUF);
 	/* nameresult is only a pointer in dirresult space so don't delete[] it. */
 	add_to_path(dirresult);
-	ruby_init();
-	ruby_options(COUNT(foo),foo);
 	BFProxy_class = class_new(gensym("gf.proxy"),0,0,sizeof(BFProxy),CLASS_PD|CLASS_NOINLET, A_NULL);
 	class_addanything(BFProxy_class,BFProxy_method_missing);
 	gf_data_path.push_back(string(dirresult)+"/images");



More information about the Gridflow-cvs mailing list