[Gridflow-cvs] [svn] commit: r4029 - /trunk/gridflow.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Jul 16 12:56:17 EDT 2008


Author: matju
Date: Wed Jul 16 12:56:16 2008
New Revision: 4029

Log:
pd_oprintf() wasn't quite working yet.

Modified:
    trunk/gridflow.c

Modified: trunk/gridflow.c
==============================================================================
--- trunk/gridflow.c (original)
+++ trunk/gridflow.c Wed Jul 16 12:56:16 2008
@@ -104,27 +104,29 @@
 	for (; *s; s++) {
 		if (*s!='%') {o << (char)*s; continue;}
 		s++; // skip the %
-		if (*s=='f') {
+		switch (*s) {
+		  case 'f':
 			if (!argc) RAISE("not enough args");
 			if (argv[i].a_type != A_FLOAT) RAISE("expected float");
 			o << argv[i].a_float;
-		}
-		if (*s=='s') {
+		  break;
+		  case 's':
 			if (!argc) RAISE("not enough args");
 			if (argv[i].a_type != A_SYMBOL) RAISE("expected symbol");
 			o << argv[i].a_symbol->s_name;
-		}
-		if (*s=='_') {
+		  break;
+		  case '_':
 			if (!argc) RAISE("not enough args");
 			char buf[MAXPDSTRING];
 			atom_string(&argv[i],buf,MAXPDSTRING);
 			o << buf;
+		  break;
+		  case '%':
+			o << "%";
+		  break;
+		  default:
+			RAISE("sorry, the format character '%c' is not supported yet",*s);
 		}
-		if (*s=='%') {
-			o << "%";
-			continue;
-		}
-		RAISE("sorry, this format string is not supported yet");
 	}
 }
 



More information about the Gridflow-cvs mailing list