scc

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

commit 789d2fd3540d4403d0fc0b0d0c91103d77109c35
parent bb26fe4e3eb31be8459380fb6ffee8c639bcef34
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 28 Oct 2013 19:57:05 +0100

Change btype to ctype

The name of the struct is ctype, and btype is a type of constructor
of ctypes object based in other ctype, so a better name is ctype.

Diffstat:
Mdecl.c | 10+++++-----
Mlex.c | 6+++---
Msymbol.h | 2+-
Mtypes.c | 2+-
4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/decl.c b/decl.c @@ -100,7 +100,7 @@ fielddcl(unsigned char ns) expect(CONSTANT); switch (tp->type) { case INT: case BOOL: - tp = btype(NULL, BITFLD); + tp = ctype(NULL, BITFLD); tp->len = yyval->i; break; default: @@ -145,7 +145,7 @@ enumdcl(struct ctype *base) do { register struct symbol *sym; - register struct ctype *tp = btype(NULL, INT); + register struct ctype *tp = ctype(NULL, INT); if (yytoken == '}') break; @@ -181,14 +181,14 @@ spec(void) case FLOAT: case DOUBLE: case BOOL: case VOID: case CHAR: case SHORT: case INT: case LONG: - tp = btype(tp, yytoken); + tp = ctype(tp, yytoken); break; case ENUM: - tp = btype(tp, yytoken); + tp = ctype(tp, yytoken); next(); return enumdcl(tp); case STRUCT: case UNION: - tp = btype(tp, yytoken); + tp = ctype(tp, yytoken); next(); return structdcl(tp); case IDEN: diff --git a/lex.c b/lex.c @@ -36,14 +36,14 @@ integer(char *s, char base) static long long v; static char ch; - tp = btype(NULL, INT); + tp = ctype(NULL, INT); type: switch (ch = toupper(getc(yyin))) { case 'L': - tp = btype(tp, LONG); + tp = ctype(tp, LONG); goto type; case 'U': - tp = btype(tp, UNSIGNED); + tp = ctype(tp, UNSIGNED); goto type; default: ungetc(ch, yyin); diff --git a/symbol.h b/symbol.h @@ -68,7 +68,7 @@ struct symbol { extern struct ctype *decl_type(struct ctype *t); extern void pushtype(unsigned mod); -extern struct ctype *btype(struct ctype *tp, unsigned char tok); +extern struct ctype *ctype(struct ctype *tp, unsigned char tok); extern void new_ctx(void); extern void del_ctx(void); extern void freesyms(void); diff --git a/types.c b/types.c @@ -84,7 +84,7 @@ decl_type(struct ctype *tp) } struct ctype * -btype(struct ctype *tp, unsigned char tok) +ctype(struct ctype *tp, unsigned char tok) { register unsigned char type;