diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2017-02-14 13:10:02 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2017-02-14 13:10:02 -0500 |
commit | 249af91ff9d9ffbd8962efcad999de442e609658 (patch) | |
tree | 0277b75b9175ba4db808c303ca10819bd0f2b1a1 | |
parent | b698584443f17b8d0cfd88e0afe037ce351e0ee6 (diff) | |
download | roux-249af91ff9d9ffbd8962efcad999de442e609658.tar.gz |
minor cleanup in all.h
-rw-r--r-- | all.h | 16 | ||||
-rw-r--r-- | parse.c | 14 | ||||
-rw-r--r-- | sysv.c | 10 |
3 files changed, 19 insertions, 21 deletions
diff --git a/all.h b/all.h index d13ef5c..a038612 100644 --- a/all.h +++ b/all.h @@ -9,7 +9,6 @@ #define die(...) die_(__FILE__, __VA_ARGS__) typedef unsigned int uint; -typedef unsigned short ushort; typedef unsigned long ulong; typedef unsigned long long bits; @@ -101,8 +100,8 @@ struct BSet { }; struct Ref { - uint32_t type:3; - uint32_t val:29; + uint type:3; + uint val:29; }; enum { @@ -456,14 +455,13 @@ struct Typ { int align; size_t size; int nunion; - struct Seg { enum { - Send, - Spad, - Sint, - Sflt, - Styp, + SEnd, + SPad, + SInt, + SFlt, + STyp, } type; uint len; /* index in typ[] for Styp */ } (*seg)[NSeg+1]; diff --git a/parse.c b/parse.c index 913fc07..a61ff1b 100644 --- a/parse.c +++ b/parse.c @@ -872,17 +872,17 @@ parseseg(Seg *seg, Typ *ty, int t) sz = 0; al = ty->align; while (t != Trbrace) { - type = Sint; + type = SInt; switch (t) { default: err("invalid type member specifier"); - case Td: type = Sflt; + case Td: type = SFlt; case Tl: s = 8; a = 3; break; - case Ts: type = Sflt; + case Ts: type = SFlt; case Tw: s = 4; a = 2; break; case Th: s = 2; a = 1; break; case Tb: s = 1; a = 0; break; case Ttyp: - type = Styp; + type = STyp; ty1 = &typ[findtyp(ntyp-1)]; s = ty1->size; a = ty1->align; @@ -894,7 +894,7 @@ parseseg(Seg *seg, Typ *ty, int t) a = s - a; if (n < NSeg) { /* padding segment */ - seg[n].type = Spad; + seg[n].type = SPad; seg[n].len = a; n++; } @@ -906,7 +906,7 @@ parseseg(Seg *seg, Typ *ty, int t) } else c = 1; sz += a + c*s; - if (type == Styp) + if (type == STyp) s = ty1 - typ; for (; c>0 && n<NSeg; c--, n++) { seg[n].type = type; @@ -918,7 +918,7 @@ parseseg(Seg *seg, Typ *ty, int t) } if (t != Trbrace) err(", or } expected"); - seg[n].type = Send; + seg[n].type = SEnd; a = 1 << al; sz = (sz + a - 1) & -a; if (sz >= ty->size) diff --git a/sysv.c b/sysv.c index f4b167b..1a036a3 100644 --- a/sysv.c +++ b/sysv.c @@ -28,19 +28,19 @@ classify(AClass *a, Typ *t, int *pn, int *pe) cls = &a->cls[*pe]; for (; *pn<8; s++) { switch (seg[s].type) { - case Send: + case SEnd: goto Done; - case Spad: + case SPad: /* don't change anything */ break; - case Sflt: + case SFlt: if (*cls == Kx) *cls = Kd; break; - case Sint: + case SInt: *cls = Kl; break; - case Styp: + case STyp: classify(a, &typ[seg[s].len], pn, pe); continue; } |