[Gridflow-cvs] [svn] commit: r3556 - in /trunk: base/grid.h rubyext.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Apr 16 01:12:49 EDT 2008


Author: matju
Date: Wed Apr 16 01:12:49 2008
New Revision: 3556

Log:
remove GridFlow.add_creator

Modified:
    trunk/base/grid.h
    trunk/rubyext.c

Modified: trunk/base/grid.h
==============================================================================
--- trunk/base/grid.h (original)
+++ trunk/base/grid.h Wed Apr 16 01:12:49 2008
@@ -883,9 +883,11 @@
 
 #define install(name,inlets,outlets) install2(rself,name,inlets,outlets)
 void install2(Ruby rself, const char *name, int inlets, int outlets);
+#define add_creator(name) add_creator2(rself,name)
+void add_creator2(Ruby rself, const char *name);
 
 #define install_format(name,mode,suffixes) do {install(name,1,1); suffixes_are(name,suffixes);} while(0)
-#define add_creator(name) rb_funcall(rself,SI(add_creator),1,rb_str_new2(name))
+
 
 #define SUPER rb_call_super(argc,argv);
 

Modified: trunk/rubyext.c
==============================================================================
--- trunk/rubyext.c (original)
+++ trunk/rubyext.c Wed Apr 16 01:12:49 2008
@@ -385,15 +385,11 @@
 	BFObject_redraw(this);
 }
 
-static Ruby FObject_s_add_creator (Ruby rself, Ruby name_) {
-	if (TYPE(name_)!=T_STRING) RAISE("argh");
-	char *name = strdup(rb_str_ptr(rb_funcall(name_,SI(to_s),0)));
+void add_creator2(Ruby rself, const char *name) {
 	if (fclasses_ruby.find(rself)==fclasses_ruby.end()) RAISE("uh");
 	string fname = fclasses_ruby[rself]->name;
 	fclasses[string(name)] = fclasses[fname];
-	class_addcreator((t_newmethod)BFObject_init,gensym(name),A_GIMME,0);
-	free(name);
-	return Qnil;
+	class_addcreator((t_newmethod)BFObject_init,gensym((char *)name),A_GIMME,0);
 }
 
 //****************************************************************
@@ -577,7 +573,6 @@
 	cFObject = rb_define_class_under(mGridFlow, "FObject", rb_cObject);
 	define_many_methods(cFObject,COUNT(FObject_methods),FObject_methods);
 	SDEF(FObject, new, -1);
-	SDEF(FObject,add_creator,1);
 	Ruby fo = cFObject;
 	rb_define_method(fo,"delete",      (RMethod)FObject_delete,0);
 	rb_define_method(fo,"initialize",  (RMethod)FObject_dummy,-1);



More information about the Gridflow-cvs mailing list