[Gridflow-cvs] [svn] commit: r4052 - in /trunk: base/flow_objects.c base/grid.c gridflow.h

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Jul 18 15:17:39 EDT 2008


Author: matju
Date: Fri Jul 18 15:17:38 2008
New Revision: 4052

Log:
remove GridInlet::mode,set_mode()... losing a slight optimisation of [#dim],[#type],[#finished], but hopefully only temporary.

Modified:
    trunk/base/flow_objects.c
    trunk/base/grid.c
    trunk/gridflow.h

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Fri Jul 18 15:17:38 2008
@@ -958,12 +958,11 @@
 	\grin 0
 };
 GRID_INLET(0) {
-	in->set_mode(0);
+	//in->set_mode(0);
 } GRID_FINISH {
 	outlet_bang(bself->outlets[0]);
 } GRID_END
 \end class {install("#finished",1,1); add_creator("@finished");}
-
 \class GridDim : FObject {
 	\constructor () {}
 	\grin 0
@@ -971,17 +970,16 @@
 GRID_INLET(0) {
 	GridOutlet out(this,0,new Dim(in->dim->n));
 	out.send(in->dim->n,in->dim->v);
-	in->set_mode(0);
+	//in->set_mode(0);
 } GRID_END
 \end class {install("#dim",1,1); add_creator("@dim");}
-
 \class GridType : FObject {
 	\constructor () {}
 	\grin 0
 };
 GRID_INLET(0) {
 	outlet_symbol(bself->outlets[0],gensym(const_cast<char *>(number_type_table[in->nt].name)));
-	in->set_mode(0);
+	/*in->set_mode(0);*/
 } GRID_END
 \end class {install("#type",1,1); add_creator("@type");}
 

Modified: trunk/base/grid.c
==============================================================================
--- trunk/base/grid.c (original)
+++ trunk/base/grid.c Fri Jul 18 15:17:38 2008
@@ -132,7 +132,6 @@
 
 template <class T> void GridInlet::flow(long n, T *data) {
 	CHECK_BUSY(inlet); CHECK_TYPE(*data,sender->nt); CHECK_ALIGN(data,sender->nt);
-	if (!mode) {dex += n; return;} // ignore data
 	if (!n) return; // no data
 	long d = dex + bufi;
 	if (d+n > dim->prod()) {
@@ -272,7 +271,6 @@
 
 void GridOutlet::callback(GridInlet *in) {
 	CHECK_BUSY1(outlet);
-	if (!(in->mode==4 || in->mode==0)) RAISE("mode error");
 	inlets.push_back(in);
 }
 

Modified: trunk/gridflow.h
==============================================================================
--- trunk/gridflow.h (original)
+++ trunk/gridflow.h Fri Jul 18 15:17:38 2008
@@ -718,12 +718,10 @@
 	int chunk;
 	PtrGrid buf;// factor-chunk buffer
 	long bufi;   // buffer index: how much of buf is filled
-	int mode; // 0=ignore; 4=ro
 	GridInlet(FObject *parent_, const GridHandler *gh_) :
-		parent(parent_), gh(gh_), sender(0), dim(0), nt(int32_e), dex(0), chunk(-1), bufi(0), mode(4) {}
+		parent(parent_), gh(gh_), sender(0), dim(0), nt(int32_e), dex(0), chunk(-1), bufi(0) {}
 	~GridInlet() {}
 	void set_chunk(long whichdim);
-	void set_mode(int mode_) {mode=mode_;}
 	int32 factor() {return buf?buf->dim->prod():1;} // which is usually not the same as this->dim->prod(chunk)
 	void begin(GridOutlet *sender);
 	void finish();



More information about the Gridflow-cvs mailing list