scc

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

commit 80244a46e09e3ce670be5c94ecc836659bff404c
parent d31abf3c36b0f84085c78a35791d8a25cb941da3
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 12 Jun 2012 21:05:19 +0200

Convert next in void function

The value returned by next is used only in a place, so it is better convert
it into  void value and modify the place where return value is used.

Diffstat:
Mdecl.c | 3++-
Mlex.c | 2+-
Mtokens.h | 2+-
3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/decl.c b/decl.c @@ -205,7 +205,8 @@ static void declarator(void) for (bp = qlf; yytoken == '*' && bp != lim; ++bp) { *bp = 0; repeat_qlf: - switch (next()) { + next(); + switch (yytoken) { case CONST: if (!(*bp ^= T_CONST)) goto duplicated; diff --git a/lex.c b/lex.c @@ -128,7 +128,7 @@ static unsigned char minus(void) } } -unsigned char next(void) +void next(void) { register unsigned char c; diff --git a/tokens.h b/tokens.h @@ -48,7 +48,7 @@ extern union yyval yyval; extern void init_lex(void); -extern unsigned char next(void); +extern void next(void); extern char accept(unsigned char tok); extern void expect(unsigned char tok); extern void init_keywords(void);