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

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Mon Sep 20 00:54:26 EDT 2010


Author: matju
Date: Mon Sep 20 00:54:26 2010
New Revision: 6308

Log:
add CLASS_NOPARENS

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

Modified: trunk/src/gridflow.cxx
==============================================================================
--- trunk/src/gridflow.cxx (original)
+++ trunk/src/gridflow.cxx Mon Sep 20 00:54:26 2010
@@ -644,21 +644,24 @@
 	delete[] inlets;
 	delete[] out;
 }
+
+static void dont_handle_parens (int ac, t_atom2 *av) {for (int i=0; i<ac; i++) if (av[i]==s_comma) SETCOMMA(&av[i]);}
+
 static void *BFObject_new (t_symbol *classsym, int ac, t_atom *at) {
     string name = string(classsym->s_name);
     if (fclasses.find(classsym)==fclasses.end()) {post("GF: class not found: '%s'",classsym->s_name); return 0;}
-    t_class *qlass = fclasses[classsym]->bfclass;
-    BFObject *bself = (BFObject *)pd_new(qlass);
+    FClass *qlass = fclasses[classsym];
+    BFObject *bself = (BFObject *)pd_new(qlass->bfclass);
     try {
 	int argc = ac;
 	t_atom2 argv[argc];
 	for (int i=0; i<argc; i++) argv[i] = at[i];
-	argc = handle_parens(argc,argv);
+	if (qlass->flags&CLASS_NOPARENS) dont_handle_parens(argc,argv); else argc = handle_parens(argc,argv);
 	int j;
 	for (j=0; j<argc; j++) if (argv[j].a_type==A_COMMA) break;
 	bself->self = 0;
 	t_allocator alloc = fclasses[classsym]->allocator;
-	bself->te_binbuf = 0; //HACK: supposed to be 0
+	bself->te_binbuf = 0; //HACK: supposed to be 0 already (why this hack ? I don't recall)
 	#ifdef DES_BUGS
 		bself->magic = 0x66666600;
 	#endif

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Mon Sep 20 00:54:26 2010
@@ -520,8 +520,8 @@
 	AlgebraicCheck is_neutral, is_absorbent;
 	NumopOn(Map m, Zip z, Fold f, Scan s,
 	void (*neu)(T *,LeftRight), AlgebraicCheck n, AlgebraicCheck a) :
-		map(m), zip(z), fold(f), scan(s), neutral(neu), is_neutral(n), is_absorbent(a) {}
-	NumopOn() : map(0),zip(0),fold(0),scan(0),neutral(0),is_neutral(0),is_absorbent(0) {}
+		    map(m),zip(z),fold(f),scan(s),neutral(neu),is_neutral(n),is_absorbent(a) {}
+	NumopOn() : map(0),zip(0),fold(0),scan(0),neutral(0)  ,is_neutral(0),is_absorbent(0) {}
 	NumopOn(const NumopOn &z) {
 		map=z.map; zip=z.zip; fold=z.fold; scan=z.scan;
 		is_neutral = z.is_neutral; neutral = z.neutral;
@@ -741,6 +741,7 @@
 	AttrDecl(t_symbol *name_, string type_) {name=name_; type=type_;}
 };
 typedef FObject *(*t_allocator)(BFObject *,MESSAGE3);
+#define CLASS_NOPARENS (1<<16)
 struct FClass {
 	t_allocator allocator; // returns a new C++ object
 	void (*startup)(FClass *);
@@ -751,7 +752,7 @@
 	t_symbol *name;
 	map<pair<int,t_symbol *>,FMethod> methods; // (inlet,selector) -> method
 	map<t_symbol *,AttrDecl *> attrs;
-	int flags; // flags: any of: CLASS_NOINLET; (yes, there's only one possibility)
+	int flags; // flags: any combination of: CLASS_NOINLET, CLASS_NOPARENS
 };
 
 void fclass_install(FClass *fc, FClass *super);



More information about the Gridflow-cvs mailing list