[Gridflow-cvs] [svn] commit: r4770 - in /trunk/src: grid.cxx gridflow.cxx gridflow.hxx

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Sat Nov 7 22:11:48 EST 2009


Author: matju
Date: Sat Nov  7 22:11:48 2009
New Revision: 4770

Log:
move binbuf_string as well

Modified:
    trunk/src/grid.cxx
    trunk/src/gridflow.cxx
    trunk/src/gridflow.hxx

Modified: trunk/src/grid.cxx
==============================================================================
--- trunk/src/grid.cxx (original)
+++ trunk/src/grid.cxx Sat Nov  7 22:11:48 2009
@@ -131,7 +131,7 @@
 #endif
 }
 
-#define CATCH_IT catch (Barf &slimy) {slimy.error(parent->bself);}
+#define CATCH_IT catch (Barf &slimy) {slimy.error(parent);}
 
 template <class T> void GridInlet::flow(long n, T *data) {
 	CHECK_BUSY(inlet); CHECK_TYPE(*data,sender->nt); CHECK_ALIGN(data,sender->nt);

Modified: trunk/src/gridflow.cxx
==============================================================================
--- trunk/src/gridflow.cxx (original)
+++ trunk/src/gridflow.cxx Sat Nov  7 22:11:48 2009
@@ -75,9 +75,9 @@
     text = os.str();
 }
 
-void Barf::error(BFObject *bself) {
-	if (bself) pd_error(bself,"%s: %s",bself->binbuf_string().data(),text.data());
-	else        ::error(      "%s: %s",bself->binbuf_string().data(),text.data());
+void Barf::error(FObject *self) {
+	if (self) pd_error(self,"%s: %s",self->binbuf_string().data(),text.data());
+	else        ::error(    "%s: %s",self->binbuf_string().data(),text.data());
 }
 
 void pd_oprint (std::ostream &o, int argc, t_atom *argv) {
@@ -558,7 +558,7 @@
 	m = funcall_lookup(bself,"anything");
 	if (m) {SETSYMBOL(argv+0,gensym(buf)); m(bself->self,argc+1,argv); return;}
 	pd_error((t_pd *)bself, "method '%s' not found for inlet %d in class '%s'",selector->s_name,winlet,pd_classname(bself));
-    } catch (Barf &oozy) {oozy.error(bself);}
+    } catch (Barf &oozy) {oozy.error(bself->self);}
 }
 static void BFObject_anything0 (BFObject *self, t_symbol *s, int argc, t_atom2 *argv) {
 	BFObject_anything(self,0,s,argc,argv);
@@ -609,11 +609,11 @@
 		if (argv[k].a_type==A_SYMBOL) pd_typedmess((t_pd *)bself,argv[k].a_symbol,j-k-1,argv+k+1);
 	}
 	return bself;
-    } catch (Barf &oozy) {oozy.error(bself); return 0;}
+    } catch (Barf &oozy) {oozy.error(bself->self); return 0;}
 }
 
 static void BFObject_delete (BFObject *bself) {
-	try {delete bself->self;} catch (Barf &oozy) {oozy.error(bself);}
+	try {delete bself->self;} catch (Barf &oozy) {oozy.error(bself->self);}
 }
 
 //****************************************************************
@@ -683,11 +683,12 @@
 	if (draw) BFObject_redraw(bself);
 }
 
-string BFObject::binbuf_string () {
-	if (!te_binbuf) return "[???]";
+string FObject::binbuf_string () {
+	t_binbuf *b = bself->te_binbuf;
+	if (!b) return "[???]";
 	std::ostringstream s;
-	int n = binbuf_getnatom(te_binbuf);
-	t_atom *at = binbuf_getvec(te_binbuf);
+	int n = binbuf_getnatom(b);
+	t_atom *at = binbuf_getvec(b);
 	for (int i=0; i<n; i++) s << (i ? " " : "[") << at[i];
 	s << "]";
 	return s.str();

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Sat Nov  7 22:11:48 2009
@@ -177,12 +177,13 @@
 		case 0:MACRO(0); case 1:MACRO(1); case 2:MACRO(2); case 3:MACRO(3); \
 		PTR+=4; N-=4; ARGS; if (N) goto start; }
 
+struct FObject;
 struct BFObject;
 struct Barf {
   string text;
   Barf(const char *s, ...);
   Barf(const char *file, int line, const char *func, const char *s, ...);
-  void error(BFObject *bself);
+  void error(FObject *self);
   ~Barf() {}
 };
 
@@ -766,10 +767,7 @@
 		ARGS(this), __PRETTY_FUNCTION__,#d,(void*)d,bytes,align);}}
 
 struct BFProxy;
-struct BFObject : t_object {
-	FObject *self;
-	string binbuf_string ();
-};
+struct BFObject : t_object {FObject *self;};
 
 // represents objects that have inlets/outlets
 \class FObject {
@@ -780,6 +778,7 @@
 	BFProxy  **inlets;    // direct access to  inlets (not linked lists)
 	t_outlet **outlets;   // direct access to outlets (not linked lists)
 	t_canvas *mom;
+	string binbuf_string ();
 	void  ninlets_set(int n, bool draw=true);
 	void noutlets_set(int n, bool draw=true);
 	std::vector<P<GridInlet> > in;
@@ -800,7 +799,7 @@
 extern Numop *op_add,*op_sub,*op_mul,*op_div,*op_mod,*op_shl,*op_and,*op_put;
 
 #undef ARGS
-#define ARGS(OBJ) ((OBJ) ? (OBJ)->bself->binbuf_string().data() : "[null]")
+#define ARGS(OBJ) ((OBJ) ? (OBJ)->binbuf_string().data() : "[null]")
 #define NOTEMPTY(_a_) if (!(_a_)) RAISE("'%s' is empty",#_a_);
 #define SAME_TYPE(_a_,_b_) if ((_a_)->nt != (_b_)->nt) RAISE("same type please (%s has %s; %s has %s)", \
 	#_a_, number_type_table[(_a_)->nt].name, \



More information about the Gridflow-cvs mailing list