shithub: scc

Download patch

ref: 449b361b5e44127d7ca45773cab7d8f4c4b496df
parent: 1e658a6b2cea5c52bad3a79e3a068c47337f3163
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Mar 9 06:38:25 EDT 2014

Simplify directdcl

--- a/decl.c
+++ b/decl.c
@@ -47,15 +47,13 @@
 			else
 				/* TODO: prototyped function */;
 		} else if (accept('[')) {
-			unsigned len;
+			unsigned len = '0';
 
-			if (accept(']')) {
-				len = 0;
-			} else {
+			if (yytoken != ']') {
 				expect(CONSTANT);
 				len = yyval->i;
-				expect(']');
 			}
+			expect(']');
 			pushtype(len);
 			pushtype(ARY);
 		} else {
--