scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit ec024fa76037859d683d2befaee81b93e586fea1
parent 11c2f9d8aedc5338cdb03b6c53d9461e12f9aaaa
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 12 May 2015 08:02:03 +0200

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.

Diffstat:
Mcc1/cpp.c | 10+---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/cc1/cpp.c b/cc1/cpp.c @@ -115,17 +115,9 @@ mkdefine(char *s, Symbol *sym) { 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;