summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-08 23:49:38 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-08 23:49:38 -0700
commit2dc7f1dc369c28ef9967e8f46248f33a8c99e0ad (patch)
tree561f349294672a940a593381bb9ec8866c08defe /mi
parent32397d07defce76d42a038e8b6b339b8a0c14699 (diff)
downloadmc-2dc7f1dc369c28ef9967e8f46248f33a8c99e0ad.tar.gz
Break up overly long statements.
A monster function declaration and if condition.
Diffstat (limited to 'mi')
-rw-r--r--mi/match.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/mi/match.c b/mi/match.c
index 3d15962..0ea30ea 100644
--- a/mi/match.c
+++ b/mi/match.c
@@ -39,7 +39,10 @@ struct Dtree {
};
Dtree *gendtree(Node *m, Node *val, Node **lbl, size_t nlbl);
-static int addpat(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend);
+static int addpat(Node *pat, Node *val,
+ Dtree *start, Dtree *accept,
+ Node ***cap, size_t *ncap,
+ Dtree ***end, size_t *nend);
void dtreedump(FILE *fd, Dtree *dt);
@@ -248,9 +251,13 @@ static int acceptall(Dtree *t, Dtree *accept)
static int isnonrecursive(Dtree *dt, Type *ty)
{
- return istyprimitive(ty) || ty->type == Tyvoid || ty->type == Tyfunc ||
- ty->type == Typtr || (ty->type == Tystruct && ty->nmemb == 0) ||
- (ty->type == Tyarray && fold(ty->asize, 1)->expr.args[0]->lit.intval == 0);
+ if (istyprimitive(ty) || ty->type == Tyvoid || ty->type == Tyfunc || ty->type == Typtr)
+ return 1;
+ if (ty->type == Tystruct)
+ return ty->nmemb == 0;
+ if (ty->type == Tyarray)
+ return fold(ty->asize, 1)->expr.args[0]->lit.intval == 0;
+ return 0;
}
static int ismatchable(Type *ty)