scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 15cfc88a6819c09e4c93054b31c0be4d48b0aeb0
parent cf5c3a1d54e206326de7e2a7b9e12f6c179e866e
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  5 Jul 2013 09:09:17 +0200

Change c_type to c_typedef

The struct ctype has also a type variable, so it was a bit confusing
each time you write one of them know what variable was used.

Diffstat:
decl.c | 2+-
symbol.h | 2+-
types.c | 14+++++++-------
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/decl.c b/decl.c @@ -18,7 +18,7 @@ newiden(struct ctype *tp) { register unsigned char sns, ns; - ns = tp->c_type ? NS_TYPEDEF : NS_IDEN; + ns = tp->c_typedef ? NS_TYPEDEF : NS_IDEN; sns = yyval.sym->ns; if (sns == NS_ANY) { /* First appearence of the symbol */ diff --git a/symbol.h b/symbol.h @@ -22,7 +22,7 @@ enum namespace { struct ctype { unsigned type : 5; - bool c_type : 1; + bool c_typedef : 1; bool c_extern : 1; bool c_static : 1; bool c_auto : 1; diff --git a/types.c b/types.c @@ -26,7 +26,7 @@ delctype(register struct ctype *tp) { if (!tp) return; - tp->c_type = 0; /* this flag only is important in */ + tp->c_typedef = 0; /* this flag only is important in */ if (--tp->refcnt == 0) { /* the parsing */ if (tp->base) delctype(tp->base); @@ -168,30 +168,30 @@ storage(register struct ctype *tp, unsigned char mod) tp = newctype(); switch (mod) { case TYPEDEF: - if (tp->c_type) + if (tp->c_typedef) goto duplicated; if (tp->c_extern | tp->c_auto | tp->c_reg | tp->c_static) goto two_storage; - tp->c_type = 1; + tp->c_typedef = 1; return tp; case EXTERN: if (tp->c_extern) goto duplicated; - if (tp->c_type | tp->c_auto | tp->c_reg | tp->c_static) + if (tp->c_typedef | tp->c_auto | tp->c_reg | tp->c_static) goto two_storage; tp->c_extern = 1; return tp; case STATIC: if (tp->c_static) goto duplicated; - if (tp->c_type | tp->c_extern | tp->c_auto | tp->c_reg) + if (tp->c_typedef | tp->c_extern | tp->c_auto | tp->c_reg) goto two_storage; tp->c_static = 1; return tp; case AUTO: if (curctx != CTX_OUTER) goto bad_file_scope_storage; - if (tp->c_type | tp->c_extern | tp->c_static | tp->c_reg) + if (tp->c_typedef | tp->c_extern | tp->c_static | tp->c_reg) goto two_storage; if (tp->c_auto) goto duplicated; @@ -200,7 +200,7 @@ storage(register struct ctype *tp, unsigned char mod) case REGISTER: if (curctx != CTX_OUTER) goto bad_file_scope_storage; - if (tp->c_type | tp->c_extern | tp->c_auto | tp->c_static) + if (tp->c_typedef | tp->c_extern | tp->c_auto | tp->c_static) goto two_storage; if (tp->c_reg) goto duplicated;