[Gridflow-cvs] [svn] commit: r4016 - in /trunk/base: grid.c source_filter.rb

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Jul 11 16:53:28 EDT 2008


Author: matju
Date: Fri Jul 11 16:53:28 2008
New Revision: 4016

Log:
use A_GRIDOUT instead of A_POINTER to send grids

Modified:
    trunk/base/grid.c
    trunk/base/source_filter.rb

Modified: trunk/base/grid.c
==============================================================================
--- trunk/base/grid.c (original)
+++ trunk/base/grid.c Fri Jul 11 16:53:28 2008
@@ -250,7 +250,7 @@
 	this->nt = nt;
 	this->dim = dim;
 	t_atom a[3];
-	SETPOINTER(a,(t_gpointer *)this); // hack
+	SETGRIDOUT(a,this);
 	outlet_anything(parent->bself->outlets[woutlet],bsym._grid,1,a);
 	frozen=true;
 	if (!dim->prod()) {finish(); return;}
@@ -267,7 +267,7 @@
 template <class T>
 void GridOutlet::send_direct(long n, T *data) {TRACE;
 	CHECK_BUSY(outlet); CHECK_TYPE(*data); CHECK_ALIGN(data);
-	for (; n>0; ) {
+	while (n>0) {
 		long pn = n;//min((long)n,MAX_PACKET_SIZE);
 		for (uint32 i=0; i<inlets.size(); i++) try {inlets[i]->flow(4,pn,data);} CATCH_IT;
 		data+=pn, n-=pn;
@@ -283,9 +283,7 @@
 }
 
 template <class T, class S>
-static void convert_number_type(int n, T *out, S *in) {
-	for (int i=0; i<n; i++) out[i]=(T)in[i];
-}
+static void convert_number_type(int n, T *out, S *in) {for (int i=0; i<n; i++) out[i]=(T)in[i];}
 
 //!@#$ buffering in outlet still is 8x faster...?
 //!@#$ should use BitPacking for conversion...?

Modified: trunk/base/source_filter.rb
==============================================================================
--- trunk/base/source_filter.rb (original)
+++ trunk/base/source_filter.rb Fri Jul 11 16:53:28 2008
@@ -244,7 +244,7 @@
 	Out.print "template <class T> void grin_#{i}(GridInlet *in, long n, T *data);"
 	Out.print "template <class T> static void grinw_#{i} (GridInlet *in, long n, T *data);"
 	Out.print "static GridHandler grid_#{i}_hand;"
-	handle_decl "#{i} grid(void *foo);"
+	handle_decl "#{i} grid(GridOutlet *foo);"
 	handle_decl "#{i} list(...);"
 	handle_decl "#{i} float(float f);"
 	$stack[-1].grins[i] = fields.dup
@@ -270,7 +270,7 @@
 		else raise 'BORK BORK BORK' end
 		ks = k.map{|ke| if ke==0 then 0 else cli end}.join(",")
 		Out.print "static GridHandler #{cl}_grid_#{i}_hand = GRIN(#{ks});"
-		handle_def "#{i} grid(void *foo) {CHECK_GRIN(#{cl},#{i});"+
+		handle_def "#{i} grid(GridOutlet *foo) {CHECK_GRIN(#{cl},#{i});"+
 			"in[#{i}]->begin(argc,argv);}"
 		handle_def "#{i} list(...) {CHECK_GRIN(#{cl},#{i});"+
 			"in[#{i}]->from_list(argc,argv,int32_e);}" if not frame.methods["_#{i}_list"].done



More information about the Gridflow-cvs mailing list