[Gridflow-cvs] [svn] commit: r5650 - in /trunk/src: gridflow.hxx source_filter.rb

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Tue May 11 21:53:35 EDT 2010


Author: matju
Date: Tue May 11 21:53:35 2010
New Revision: 5650

Log:
remove cname and reorganise some things

Modified:
    trunk/src/gridflow.hxx
    trunk/src/source_filter.rb

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Tue May 11 21:53:35 2010
@@ -223,8 +223,10 @@
 	RAISE("in %s, got %d args instead of at least %d"            ,(CONTEXT),(ARGC),(MIN)      );
 #define MINMAXARGS(CONTEXT,ARGC,MIN,MAX) if ((ARGC)<(MIN) || (ARGC)>(MAX)) \
 	RAISE("in %s, got %d args instead of at least %d, at most %d",(CONTEXT),(ARGC),(MIN),(MAX));
-#define ALLOCATOR(THISCLASS) \
-	static FObject *THISCLASS##_allocator (BFObject *bself, MESSAGE) {return new THISCLASS(bself,sel,argc,argv);}
+#define CLASSINFO(THISCLASS) \
+	static void THISCLASS##_startup (FClass *fclass); \
+	static FObject *THISCLASS##_allocator (BFObject *bself, MESSAGE) {return new THISCLASS(bself,sel,argc,argv);} \
+	FClass ci##THISCLASS = {THISCLASS##_allocator,THISCLASS##_startup};
 
 //****************************************************************
 
@@ -713,7 +715,6 @@
 struct FClass {
 	t_allocator allocator; // returns a new C++ object
 	void (*startup)(FClass *);
-	const char *cname; // C++ name (not PD name)
 	FClass *super;
 	int ninlets;
 	int noutlets;

Modified: trunk/src/source_filter.rb
==============================================================================
--- trunk/src/source_filter.rb (original)
+++ trunk/src/source_filter.rb Tue May 11 21:53:35 2010
@@ -210,8 +210,7 @@
 	frame = $stack[-1]
 	cl = frame.name
 	line="{}" if /^\s*$/ =~ line
-	Out.print "static void #{cl}_startup (FClass *fclass); ALLOCATOR(#{cl});"
-	Out.print "FClass ci#{cl} = {#{cl}_allocator,#{cl}_startup,#{cl.inspect}};"
+	Out.print "CLASSINFO(#{cl})"
 	get="void ___get(t_symbol *s=0) {t_atom a[1];"
 	frame.attrs.each {|name,attr|
 		virtual = if attr.virtual then "(0,0)" else "" end
@@ -225,7 +224,7 @@
 	handle_def get if frame.attrs.size>0
 	Out.print "void #{frame.name}_startup (FClass *fclass) {"
 	frame.methods.each {|name,method| Out.print "fclass->methods[\"#{name}\"] = FMethod(#{frame.name}::#{method.selector}_wrap);" }
-	frame.attrs.each   {|name,attr|   Out.print "fclass->  attrs[\"#{name}\"           ] = new AttrDecl(\"#{name}\",\"#{attr.type}\");" }
+	frame.attrs.each   {|name,attr|   Out.print "fclass->  attrs[\"#{name}\"] = new AttrDecl(\"#{name}\",\"#{attr.type}\");" }
 	Out.print line.chomp
 end
 



More information about the Gridflow-cvs mailing list