[Gridflow-cvs] [svn] commit: r3267 - in /trunk: base/main.c base/mmx.rb rubyext.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Thu Mar 20 17:56:27 EDT 2008


Author: matju
Date: Thu Mar 20 17:56:27 2008
New Revision: 3267

Log:
removed GridFlow.bridge_name

Modified:
    trunk/base/main.c
    trunk/base/mmx.rb
    trunk/rubyext.c

Modified: trunk/base/main.c
==============================================================================
--- trunk/base/main.c (original)
+++ trunk/base/main.c Thu Mar 20 17:56:27 2008
@@ -2,7 +2,7 @@
 	$Id$
 
 	GridFlow
-	Copyright (c) 2001-2007 by Mathieu Bouchard
+	Copyright (c) 2001-2008 by Mathieu Bouchard
 
 	This program is free software; you can redistribute it and/or
 	modify it under the terms of the GNU General Public License
@@ -184,7 +184,6 @@
 		if (inlet!=-3 && inlet!=-1) RAISE("invalid inlet number: %d", inlet);
 	Ruby sym;
 	FObject_prepare_message(argc,argv,sym,h->self);
-//	if (rb_const_get(mGridFlow,SI(@verbose))==Qtrue) gfpost m.inspect
 	char buf[256];
 	sprintf(buf,"_n_%s",rb_sym_name(sym));
 	if (rb_obj_respond_to(h->rself,rb_intern(buf),0)) {
@@ -534,20 +533,12 @@
 #define FOO(_sym_,_name_) bsym._sym_ = ID2SYM(rb_intern(_name_));
 BUILTIN_SYMBOLS(FOO)
 #undef FOO
-	mGridFlow = EVAL("module GridFlow; CObject = ::Object; "
-		"class<<self; attr_reader :bridge_name; end; "
-		"def post_string(s) STDERR.puts s end; "
-		"self end");
+	mGridFlow = EVAL("module GridFlow; CObject = ::Object; class<<self; end; def post_string(s) STDERR.puts s end; self end");
 	SDEF2("exec",GridFlow_exec,2);
 	SDEF2("get_id",GridFlow_get_id,1);
 	SDEF2("rdtsc",GridFlow_rdtsc,0);
 	SDEF2("handle_braces!",GridFlow_handle_braces,1);
 	SDEF2("fclass_install",GridFlow_fclass_install,2);
-
-//#define FOO(A) fprintf(stderr,"sizeof("#A")=%d\n",sizeof(A));
-//FOO(Dim) FOO(BitPacking) FOO(GridHandler) FOO(GridInlet) FOO(GridOutlet) FOO(GridObject)
-//#undef FOO
-
 	rb_ivar_set(mGridFlow, SI(@fobjects), rb_hash_new());
 	rb_ivar_set(mGridFlow, SI(@fclasses), rb_hash_new());
 	rb_ivar_set(mGridFlow, SI(@bsym), PTR2FIX(&bsym));

Modified: trunk/base/mmx.rb
==============================================================================
--- trunk/base/mmx.rb (original)
+++ trunk/base/mmx.rb Thu Mar 20 17:56:27 2008
@@ -210,7 +210,7 @@
 void startup_mmx_loader () {/*bogus*/}
 void startup_mmx () {
 	if (getenv("NO_MMX")) return;
-	if (EVAL(\"GridFlow.bridge_name\")!=Qnil) post(\"startup_cpu: using MMX optimisations\");
+	post(\"startup_cpu: using MMX optimisations\");
 	#{$install}
 }`
 

Modified: trunk/rubyext.c
==============================================================================
--- trunk/rubyext.c (original)
+++ trunk/rubyext.c Thu Mar 20 17:56:27 2008
@@ -58,7 +58,6 @@
 #endif
 
 #define CObject_free CObject_freeee
-#define gfpost post
 
 #ifdef HAVE_GEM
 #include "Base/GemPixDualObj.h"
@@ -913,10 +912,8 @@
 extern "C" void gridflow_setup () {
 	char *foo[] = {"Ruby-for-PureData","-e",";"};
 	post("setting up Ruby-for-PureData...");
-
 	const char *pcl = getenv("PRINT_CLASS_LIST");
         if (pcl && strcmp(pcl,"yes")==0) print_class_list=true;
-
 	char *dirname   = new char[MAXPDSTRING];
 	char *dirresult = new char[MAXPDSTRING];
 	char *nameresult;
@@ -930,9 +927,7 @@
 		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);
 	post("we are using Ruby version %s",rb_str_ptr(EVAL("RUBY_VERSION")));
@@ -940,26 +935,19 @@
 	BFProxy_class = class_new(gensym("ruby_proxy"), NULL,NULL,sizeof(BFProxy),CLASS_PD|CLASS_NOINLET, A_NULL);
 	class_addanything(BFProxy_class,BFProxy_method_missing);
 	rb_define_singleton_method(cData,"gf_bridge_init",(RMethod)gf_bridge_init,0);
-
-	mGridFlow2 = EVAL(
-		"module GridFlow; class<<self; attr_reader :bridge_name; end; Pd=GridFlow; "
-		"@bridge_name = 'puredata'; self end");
+	mGridFlow2 = EVAL("module GridFlow; class<<self; end; Pd=GridFlow; self end");
 	rb_const_set(mGridFlow2,SI(DIR),rb_str_new2(dirresult));
 	post("DIR = %s",rb_str_ptr(EVAL("GridFlow::DIR.inspect")));
 	EVAL("$:.unshift GridFlow::DIR+'/..', GridFlow::DIR, GridFlow::DIR+'/optional/rblti'");
-//	post("Ruby's path = %s",rb_str_ptr(EVAL("$:.inspect")));
-	if (!
-	EVAL("begin require 'gridflow'; true; rescue Exception => e;\
-		STDERR.puts \"[#{e.class}] [#{e.message}]:\n#{e.backtrace.join'\n'}\"; false; end"))
+	if (!EVAL("begin require 'gridflow'; true; rescue Exception => e; "
+		"STDERR.puts \"[#{e.class}] [#{e.message}]:\n#{e.backtrace.join'\n'}\"; false; end"))
 	{
 		post("ERROR: Cannot load GridFlow-for-Ruby (gridflow.so)\n");
 		return;
 	}
-	bindpatcher = class_new(gensym("bindpatcher"),
-		(t_newmethod)bindpatcher_init, 0, sizeof(t_object),CLASS_DEFAULT,A_GIMME,0);
+	bindpatcher = class_new(gensym("bindpatcher"), (t_newmethod)bindpatcher_init, 0, sizeof(t_object),CLASS_DEFAULT,A_GIMME,0);
 	delete[] dirresult;
 	delete[] dirname;
-//	dummy_owner = pd_new();
 	hack = clock_new((void*)0,(t_method)ruby_stack_end_hack);
 	clock_delay(hack,0);
 //	signal(SIGSEGV,boo);



More information about the Gridflow-cvs mailing list