[Gridflow-cvs] [svn] commit: r5675 - /trunk/src/grid.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Wed May 12 21:21:04 EDT 2010


Author: matju
Date: Wed May 12 21:21:01 2010
New Revision: 5675

Log:
rien

Modified:
    trunk/src/grid.cxx

Modified: trunk/src/grid.cxx
==============================================================================
--- trunk/src/grid.cxx (original)
+++ trunk/src/grid.cxx Wed May 12 21:21:01 2010
@@ -49,7 +49,7 @@
 			if (i!=0 && a[i-1].a_type==A_SYMBOL) nt=NumberTypeE_find(a[--i]);
 			for (int j=0; j<i; j++) v[j] = TO(int32,a[j]);
 			init(Dim(i,v),nt);
-			CHECK_ALIGN(this->data,nt);
+			CHECK_ALIGN(data,nt);
 			if (a[i] != s_sharp) i++;
 			i++; a+=i; n-=i;
 			goto fill;
@@ -57,7 +57,7 @@
 	}
 	if (n!=0 && a[0].a_type==A_SYMBOL) {nt = NumberTypeE_find(a[0]); a++; n--;}
 	init(Dim(n),nt);
-	CHECK_ALIGN(this->data,nt);
+	CHECK_ALIGN(data,nt);
 	fill:
 	int nn = dim.prod();
 	n = min(n,nn);
@@ -77,7 +77,7 @@
 		init_from_list(binbuf_getnatom(b),binbuf_getvec(b));
 	} else if (x.a_type==A_FLOAT) {
 		init(Dim(),int32_e);
-		CHECK_ALIGN(this->data,nt);
+		CHECK_ALIGN(data,nt);
 		((int32 *)*this)[0] = (int32)a.a_float;
 	} else {
 		std::ostringstream s; s << x;
@@ -94,10 +94,7 @@
 	chunk = whichdim;
 	long n = dim.prod(whichdim);
 	if (!n) n=1;
-	if (n>1) {
-		buf=new Grid(Dim(n), sender->nt);
-		bufi=0;
-	} else buf=0;
+	if (n>1) {buf=new Grid(Dim(n), sender->nt); bufi=0;} else buf=0;
 }
 
 bool GridInlet::supports_type(NumberTypeE nt) {
@@ -228,8 +225,7 @@
 }
 
 void GridOutlet::flush() {
-	if (fresh) return;
-	if (!bufi) return;
+	if (fresh || !bufi) return;
 #define FOO(T) send_direct(bufi,(T *)buf);
 	TYPESWITCH(buf.nt,FOO,)
 #undef FOO
@@ -240,11 +236,9 @@
 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...?
 // send modifies dex; send_direct doesn't
 template <class T>
 void GridOutlet::send_2(long n, T *data) {
-	//if (inlets.size()==1 && inlets[0]->buf) post("GridOutlet::send(%ld), bufsize %ld",long(n),long(inlets[0]->buf->dim->prod()));
 	if (!n) return;
 	CHECK_BUSY(outlet); CHECK_ALIGN(data,nt);
 	if (NumberTypeE_type_of(data)!=nt) {



More information about the Gridflow-cvs mailing list