shithub: scc

Download patch

ref: ec024fa76037859d683d2befaee81b93e586fea1
parent: 11c2f9d8aedc5338cdb03b6c53d9461e12f9aaaa
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue May 12 04:02:03 EDT 2015

Simplify mkdefine

The type value of the format string of macros is not needed, because
we can use the value of number of arguments directly.

--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -115,17 +115,9 @@
 {
 	int nargs;
 	char *args[NR_MACROARG], buff[LINESIZ+1];
-	char type;
 
 	s = parseargs(s, args, &nargs);
-	if (nargs == -1) {
-		type = 'N';
-		++nargs;
-	} else {
-		type = 'P';
-	}
-
-	sprintf(buff, "%c%02d", type, nargs);
+	sprintf(buff, "%02d#", nargs);
 
 	while (isspace(*s))
 		++s;