scc

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

commit 15b5db8b6c5c767cf9c538f3cdafa8926b4b7430
parent 542b9640930da321fa75bc470c03274bd274fb21
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed,  9 Oct 2013 22:35:30 +0200

Some changes in function names

We were calling struct_spec to the function called from spec, but we
were calling union_dcl to the similar function for unions, and it was
confusing, because struct_dcl was the function where struct fields
were defined. This patch change struct_dcl to field_dcl, and struct_spec
to struct_dcl, so the code is more clever now.

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

diff --git a/decl.c b/decl.c @@ -101,10 +101,10 @@ new_struct(register struct ctype *tp) tp->sym = sym; } -static struct ctype * spec(void); +static struct ctype *spec(void); static struct ctype * -struct_dcl(unsigned char ns) +field_dcl(unsigned char ns) { register struct ctype *tp, *base; @@ -141,7 +141,7 @@ struct_dcl(unsigned char ns) } static struct ctype * -struct_spec(register struct ctype *tp) +struct_dcl(register struct ctype *tp) { new_struct(tp); @@ -151,7 +151,7 @@ struct_spec(register struct ctype *tp) error("struct/union already defined"); do - struct_dcl(tp->ns); + field_dcl(tp->ns); while (!accept('}')); tp->forward = 0; @@ -214,7 +214,7 @@ spec(void) case STRUCT: case UNION: tp = btype(tp, yytoken); next(); - return struct_spec(tp); + return struct_dcl(tp); case IDEN: if (!tp || !tp->type) { struct symbol *sym;