ref: 2dc7f1dc369c28ef9967e8f46248f33a8c99e0ad
parent: 32397d07defce76d42a038e8b6b339b8a0c14699
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jul 8 19:49:38 EDT 2017
Break up overly long statements. A monster function declaration and if condition.
--- a/mi/match.c
+++ b/mi/match.c
@@ -39,7 +39,10 @@
};
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 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)