[Gridflow-cvs] [svn] commit: r6042 - /trunk/src/gridflow.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Wed Aug 11 22:58:13 EDT 2010


Author: matju
Date: Wed Aug 11 22:58:12 2010
New Revision: 6042

Log:
pd_oprintf: support %i

Modified:
    trunk/src/gridflow.cxx

Modified: trunk/src/gridflow.cxx
==============================================================================
--- trunk/src/gridflow.cxx (original)
+++ trunk/src/gridflow.cxx Wed Aug 11 22:58:12 2010
@@ -130,24 +130,24 @@
 }
 
 static float eatfloat (int argc, t_atom *argv, int &i) {
-	if (!argc) RAISE("not enough args");
-	if (argv[i].a_type != A_FLOAT) RAISE("expected float");
-	return argv[i++].a_float;
-}
+	if (!argc) RAISE("not enough args"); if (argv[i].a_type != A_FLOAT) RAISE("expected float");
+	return argv[i++].a_float;}
 static t_symbol *eatsymbol (int &argc, t_atom *&argv, int &i) {
-	if (!argc) RAISE("not enough args");
-	if (argv[i].a_type != A_SYMBOL) RAISE("expected symbol");
-	return argv[i++].a_symbol;
-}
+	if (!argc) RAISE("not enough args"); if (argv[i].a_type != A_SYMBOL) RAISE("expected symbol");
+	return argv[i++].a_symbol;}
+#define EATFLOAT   eatfloat(argc,argv,i)
+#define EATSYMBOL eatsymbol(argc,argv,i)
 void pd_oprintf (std::ostream &o, const char *s, int argc, t_atom *argv) {
 	int i=0;
+	const char *t;
 	for (; *s; s++) {
 		if (*s!='%') {o << (char)*s; continue;}
+		t=s; // future use
 		s++; // skip the %
 		switch (*s) {
-		  case 'd': o << long(eatfloat(argc,argv,i)); break;
-		  case 'f': o << eatfloat(argc,argv,i); break;
-		  case 's': o << eatsymbol(argc,argv,i)->s_name; break;
+		  case 'd': case 'i': o << long(EATFLOAT); break;
+		  case 'f': o << EATFLOAT; break;
+		  case 's': o << EATSYMBOL->s_name; break;
 		  case '_':
 			if (!argc) RAISE("not enough args");
 			char buf[MAXPDSTRING];



More information about the Gridflow-cvs mailing list