diff options
author | Ori Bernstein <ori@eigenstate.org> | 2017-07-08 23:49:38 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2017-07-08 23:49:38 -0700 |
commit | 2dc7f1dc369c28ef9967e8f46248f33a8c99e0ad (patch) | |
tree | 561f349294672a940a593381bb9ec8866c08defe /mi | |
parent | 32397d07defce76d42a038e8b6b339b8a0c14699 (diff) | |
download | mc-2dc7f1dc369c28ef9967e8f46248f33a8c99e0ad.tar.gz |
Break up overly long statements.
A monster function declaration and if condition.
Diffstat (limited to 'mi')
-rw-r--r-- | mi/match.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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) |