shithub: scc

Download patch

ref: 665c38d088b19183501943cd0b179bc8d6b75357
parent: 5e7b55dcc252f28c5c21b347dadaa8209fd061bb
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Apr 21 09:47:45 EDT 2015

Rewrite main loop in cc1

The original loop was a bit ugly because the three parts of
the for were totally unrelated, so it was an abuse of the for
loop, where it helps if the three parts are concerned about
some common thing.

--- a/cc1/main.c
+++ b/cc1/main.c
@@ -69,8 +69,10 @@
 	init_keywords();
 	init_expr();
 	open_file(input);
-	for (next(); yytoken != EOFTOK; extdecl());
-		/* nothing */;
+	next();
+
+	while (yytoken != EOFTOK)
+		extdecl();
 
 	if (ferror(stdin) || ferror(stdout)) {
 		die("error reading/writing from input/output:%s",