scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 449b361b5e44127d7ca45773cab7d8f4c4b496df
parent 1e658a6b2cea5c52bad3a79e3a068c47337f3163
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun,  9 Mar 2014 10:38:25 +0100

Simplify directdcl

Diffstat:
Mdecl.c | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/decl.c b/decl.c @@ -47,15 +47,13 @@ directdcl(register struct ctype *tp, unsigned char ns) 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 {