summaryrefslogtreecommitdiff
path: root/parse/stab.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-01 01:30:17 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-01 01:30:17 -0800
commite22c4b573a6d0d71a8781ef655a7249f8b1921a4 (patch)
treeb8987ba2209db53a0f5fdbc27ddac66838e6e754 /parse/stab.c
parentffc55ee721c02d1caede8d7fbad9e8b687f01306 (diff)
downloadmc-e22c4b573a6d0d71a8781ef655a7249f8b1921a4.tar.gz
Fix style.
Diffstat (limited to 'parse/stab.c')
-rw-r--r--parse/stab.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/parse/stab.c b/parse/stab.c
index 061de84..6ba39a5 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -250,12 +250,10 @@ static int mergedecl(Node *old, Node *new)
if (old->decl.vis == Visexport && new->decl.vis != Visexport) {
e = old;
g = new;
- }
- else if (new->decl.vis == Visexport && old->decl.vis != Visexport) {
+ } else if (new->decl.vis == Visexport && old->decl.vis != Visexport) {
e = new;
g = old;
- }
- else {
+ } else {
return 0;
}
old->decl.vis = Visexport;
@@ -329,15 +327,13 @@ int mergetype(Type *old, Type *new)
{
if (!new) {
lfatal(old->loc, "double prototyping of %s", tystr(old));
- }
- else if (old->vis == Visexport && new->vis != Visexport) {
+ } else if (old->vis == Visexport && new->vis != Visexport) {
if (!old->sub && new->sub) {
old->sub = new->sub;
old->nsub = new->nsub;
return 1;
}
- }
- else if (new->vis == Visexport && old->vis != Visexport) {
+ } else if (new->vis == Visexport && old->vis != Visexport) {
if (!new->sub && old->sub) {
new->sub = old->sub;
new->nsub = old->nsub;
@@ -362,16 +358,14 @@ void puttype(Stab *st, Node *n, Type *t)
if (t && hastype(st, n)) {
t->vis = Visexport;
updatetype(st, n, t);
- }
- else {
+ } else {
td = xalloc(sizeof(Tydefn));
td->loc = n->loc;
td->name = n;
td->type = t;
htput(st->ty, td->name, td);
}
- }
- else if (!mergetype(ty, t)) {
+ } else if (!mergetype(ty, t)) {
fatal(n, "Type %s already declared on %s:%d", tystr(ty), fname(ty->loc),
lnum(ty->loc));
}