cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit cbff9bf03861b8d63f598d3370c82a96511a754c
parent 3be663812bd6cc94107b8ff8425246441795f30f
Author: Michael Forney <mforney@mforney.org>
Date:   Sat, 20 Apr 2019 19:00:39 -0700

Shorten some names with 'long'

Diffstat:
Mcc.h | 6+++---
Mdecl.c | 30+++++++++++++++---------------
Mexpr.c | 2+-
Mtype.c | 24++++++++++++------------
4 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/cc.h b/cc.h @@ -198,10 +198,10 @@ struct type { BASICINT, BASICENUM, BASICLONG, - BASICLONGLONG, + BASICLLONG, BASICFLOAT, BASICDOUBLE, - BASICLONGDOUBLE, + BASICLDOUBLE, } kind; _Bool issigned, iscomplex; } basic; @@ -416,7 +416,7 @@ extern struct type typeshort, typeushort; extern struct type typeint, typeuint; extern struct type typelong, typeulong; extern struct type typellong, typeullong; -extern struct type typefloat, typedouble, typelongdouble; +extern struct type typefloat, typedouble, typeldouble; extern struct type typevalist, typevalistptr; /* decl */ diff --git a/decl.c b/decl.c @@ -380,36 +380,36 @@ declspecs(struct scope *s, enum storageclass *sc, enum funcspec *fs, int *align) } done: switch ((int)ts) { - case SPECNONE: break; - case SPECCHAR: t = &typechar; break; - case SPECSIGNED|SPECCHAR: t = &typeschar; break; - case SPECUNSIGNED|SPECCHAR: t = &typeuchar; break; + case SPECNONE: break; + case SPECCHAR: t = &typechar; break; + case SPECSIGNED|SPECCHAR: t = &typeschar; break; + case SPECUNSIGNED|SPECCHAR: t = &typeuchar; break; case SPECSHORT: case SPECSHORT|SPECINT: case SPECSIGNED|SPECSHORT: - case SPECSIGNED|SPECSHORT|SPECINT: t = &typeshort; break; + case SPECSIGNED|SPECSHORT|SPECINT: t = &typeshort; break; case SPECUNSIGNED|SPECSHORT: - case SPECUNSIGNED|SPECSHORT|SPECINT: t = &typeushort; break; + case SPECUNSIGNED|SPECSHORT|SPECINT: t = &typeushort; break; case SPECINT: case SPECSIGNED: - case SPECSIGNED|SPECINT: t = &typeint; break; + case SPECSIGNED|SPECINT: t = &typeint; break; case SPECUNSIGNED: - case SPECUNSIGNED|SPECINT: t = &typeuint; break; + case SPECUNSIGNED|SPECINT: t = &typeuint; break; case SPECLONG: case SPECLONG|SPECINT: case SPECSIGNED|SPECLONG: - case SPECSIGNED|SPECLONG|SPECINT: t = &typelong; break; + case SPECSIGNED|SPECLONG|SPECINT: t = &typelong; break; case SPECUNSIGNED|SPECLONG: - case SPECUNSIGNED|SPECLONG|SPECINT: t = &typeulong; break; + case SPECUNSIGNED|SPECLONG|SPECINT: t = &typeulong; break; case SPECLONGLONG: case SPECLONGLONG|SPECINT: case SPECSIGNED|SPECLONGLONG: - case SPECSIGNED|SPECLONGLONG|SPECINT: t = &typellong; break; + case SPECSIGNED|SPECLONGLONG|SPECINT: t = &typellong; break; case SPECUNSIGNED|SPECLONGLONG: - case SPECUNSIGNED|SPECLONGLONG|SPECINT: t = &typeullong; break; - case SPECFLOAT: t = &typefloat; break; - case SPECDOUBLE: t = &typedouble; break; - case SPECLONG|SPECDOUBLE: t = &typelongdouble; break; + case SPECUNSIGNED|SPECLONGLONG|SPECINT: t = &typeullong; break; + case SPECFLOAT: t = &typefloat; break; + case SPECDOUBLE: t = &typedouble; break; + case SPECLONG|SPECDOUBLE: t = &typeldouble; break; default: error(&tok.loc, "invalid combination of type specifiers"); } diff --git a/expr.c b/expr.c @@ -371,7 +371,7 @@ primaryexpr(struct scope *s) else if (tolower(end[0]) == 'f' && !end[1]) e->type = &typefloat; else if (tolower(end[0]) == 'l' && !end[1]) - e->type = &typelongdouble; + e->type = &typeldouble; else error(&tok.loc, "invalid floating constant suffix '%s'", *end); } else { diff --git a/type.c b/type.c @@ -21,13 +21,13 @@ struct type typeuint = {.kind = TYPEBASIC, .size = 4, .align = 4, .repr = struct type typelong = {.kind = TYPEBASIC, .size = 8, .align = 8, .repr = &i64, .basic = {.kind = BASICLONG, .issigned = 1}}; struct type typeulong = {.kind = TYPEBASIC, .size = 8, .align = 8, .repr = &i64, .basic = {.kind = BASICLONG}}; -struct type typellong = {.kind = TYPEBASIC, .size = 8, .align = 8, .repr = &i64, .basic = {.kind = BASICLONGLONG, .issigned = 1}}; -struct type typeullong = {.kind = TYPEBASIC, .size = 8, .align = 8, .repr = &i64, .basic = {.kind = BASICLONGLONG}}; +struct type typellong = {.kind = TYPEBASIC, .size = 8, .align = 8, .repr = &i64, .basic = {.kind = BASICLLONG, .issigned = 1}}; +struct type typeullong = {.kind = TYPEBASIC, .size = 8, .align = 8, .repr = &i64, .basic = {.kind = BASICLLONG}}; struct type typebool = {.kind = TYPEBASIC, .size = 1, .align = 1, .repr = &i8, .basic = {.kind = BASICBOOL}}; struct type typefloat = {.kind = TYPEBASIC, .size = 4, .align = 4, .repr = &f32, .basic = {.kind = BASICFLOAT}}; struct type typedouble = {.kind = TYPEBASIC, .size = 8, .align = 8, .repr = &f64, .basic = {.kind = BASICDOUBLE}}; -struct type typelongdouble = {.kind = TYPEBASIC, .size = 16, .align = 16, .basic = {.kind = BASICLONGDOUBLE}}; // XXX: not supported by qbe +struct type typeldouble = {.kind = TYPEBASIC, .size = 16, .align = 16, .basic = {.kind = BASICLDOUBLE}}; // XXX: not supported by qbe static struct type typevaliststruct = {.kind = TYPESTRUCT, .size = 24, .align = 8}; struct type typevalist = {.kind = TYPEARRAY, .size = 24, .align = 8, .array = {1}, .base = &typevaliststruct}; @@ -94,7 +94,7 @@ typeprop(struct type *t) switch (t->basic.kind) { case BASICFLOAT: case BASICDOUBLE: - case BASICLONGDOUBLE: + case BASICLDOUBLE: p |= PROPFLOAT; break; case BASICCHAR: @@ -132,13 +132,13 @@ typerank(struct type *t) { assert(typeprop(t) & PROPINT); switch (t->basic.kind) { - case BASICBOOL: return 1; - case BASICCHAR: return 2; - case BASICSHORT: return 3; + case BASICBOOL: return 1; + case BASICCHAR: return 2; + case BASICSHORT: return 3; case BASICENUM: - case BASICINT: return 4; - case BASICLONG: return 5; - case BASICLONGLONG: return 6; + case BASICINT: return 4; + case BASICLONG: return 5; + case BASICLLONG: return 6; default: fatal("internal error; unhandled integer type"); } @@ -240,8 +240,8 @@ typecommonreal(struct type *t1, struct type *t2) assert(t1->kind == TYPEBASIC && t2->kind == TYPEBASIC); if (t1 == t2) return t1; - if (t1 == &typelongdouble || t2 == &typelongdouble) - return &typelongdouble; + if (t1 == &typeldouble || t2 == &typeldouble) + return &typeldouble; if (t1 == &typedouble || t2 == &typedouble) return &typedouble; if (t1 == &typefloat || t2 == &typefloat)