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

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Wed May 12 19:16:23 EDT 2010


Author: matju
Date: Wed May 12 19:16:22 2010
New Revision: 5669

Log:
remove BuiltinSymbols type

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 Wed May 12 19:16:22 2010
@@ -43,15 +43,14 @@
 
 void Grid::init_from_list(int n, t_atom *aa, NumberTypeE nt) {
 	t_atom2 *a = (t_atom2 *)aa;
-	t_symbol *delim = gensym("#");
 	for (int i=0; i<n; i++) {
-		if (a[i] == delim) {
+		if (a[i] == s_sharp) {
 			int32 v[i];
 			if (i!=0 && a[i-1].a_type==A_SYMBOL) nt=NumberTypeE_find(a[--i]);
 			for (int j=0; j<i; j++) v[j] = convert(a[j],(int32*)0);
 			init(Dim(i,v),nt);
 			CHECK_ALIGN(this->data,nt);
-			if (a[i] != delim) i++;
+			if (a[i] != s_sharp) i++;
 			i++; a+=i; n-=i;
 			goto fill;
 		}
@@ -195,7 +194,7 @@
 	t_atom a[1];
 	SETGRIDOUT(a,this);
 	if (parent) {
-		outlet_anything(parent->outlets[woutlet],bsym._grid,1,a);
+		outlet_anything(parent->outlets[woutlet],s_grid,1,a);
 		if (!dim.prod()) finish();
 	}
 }

Modified: trunk/src/gridflow.cxx
==============================================================================
--- trunk/src/gridflow.cxx (original)
+++ trunk/src/gridflow.cxx Wed May 12 19:16:22 2010
@@ -72,7 +72,9 @@
 
 //using namespace std;
 
-BuiltinSymbols bsym;
+#define FOO(SYM,NAME) t_symbol *s_##SYM;
+BUILTIN_SYMBOLS(FOO)
+#undef FOO
 
 Barf::Barf(const char *s, ...) {
     std::ostringstream os;
@@ -820,8 +822,6 @@
 	//post("class %s loadbang %08x",name,long(m));
 	if (m) class_addmethod(fclass->bfclass,t_method(BFObject_loadbang),gensym("loadbang"),A_NULL);
 }
-
-static t_symbol *s_comma;
 
 /* This code handles nested lists because PureData doesn't do it */
 int handle_braces(int ac, t_atom *av) {
@@ -1027,7 +1027,6 @@
 // (segfaults), in addition to libraries not being canvases ;-)
 // AND ALSO, CONTRARY TO WHAT m_pd.h SAYS, open_via_path()'s args are reversed!!!
 extern "C" void gridflow_setup () {
-    s_comma = gensym(",");
     post("GridFlow " GF_VERSION ", Copyright (c) 2001-2010 Mathieu Bouchard");
     post("GridFlow was compiled on "__DATE__", "__TIME__);
     //std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
@@ -1050,7 +1049,7 @@
 	#ifndef __WIN32__
         srandom(rdtsc());
     #endif
-#define FOO(_sym_,_name_) bsym._sym_ = gensym(_name_);
+#define FOO(SYM,NAME) s_##SYM = gensym(NAME);
 BUILTIN_SYMBOLS(FOO)
 #undef FOO
 	startup_number();

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Wed May 12 19:16:22 2010
@@ -237,16 +237,11 @@
 struct t_atom2;
 typedef void (*FMethod)(FObject *, int, t_atom2 *);
 
-#define BUILTIN_SYMBOLS(MACRO) \
-	MACRO(_grid,"grid") MACRO(_bang,"bang") MACRO(_float,"float") \
-	MACRO(_list,"list") MACRO(_sharp,"#") \
-	MACRO(_in,"in") MACRO(_out,"out")
-
-extern struct BuiltinSymbols {
-#define FOO(_sym_,_str_) t_symbol *_sym_;
+#define BUILTIN_SYMBOLS(MACRO) MACRO(grid,"grid") MACRO(sharp,"#") MACRO(comma,",")
+	
+#define FOO(_sym_,_str_) extern t_symbol *s_##_sym_;
 BUILTIN_SYMBOLS(FOO)
 #undef FOO
-} bsym;
 
 struct Numop;
 struct Pointer;



More information about the Gridflow-cvs mailing list