shithub: scc

Download patch

ref: 789d2fd3540d4403d0fc0b0d0c91103d77109c35
parent: bb26fe4e3eb31be8459380fb6ffee8c639bcef34
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Oct 28 15:57:05 EDT 2013

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.

--- a/decl.c
+++ b/decl.c
@@ -100,7 +100,7 @@
 			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 @@
 
 	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 @@
 		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:
--- a/lex.c
+++ b/lex.c
@@ -36,14 +36,14 @@
 	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);
--- a/symbol.h
+++ b/symbol.h
@@ -68,7 +68,7 @@
 
 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);
--- a/types.c
+++ b/types.c
@@ -84,7 +84,7 @@
 }
 
 struct ctype *
-btype(struct ctype *tp, unsigned char tok)
+ctype(struct ctype *tp, unsigned char tok)
 {
 	register unsigned char type;
 
--