frontend/define.c, cleanup `prtree1()'

This commit is contained in:
rlar
2015-11-13 20:17:13 +01:00
parent 83938330eb
commit 045de93d3b
+6 -10
View File
@@ -261,11 +261,10 @@ prtree1(struct pnode *pn, FILE *fp)
struct pnode *
ft_substdef(const char *name, struct pnode *args)
{
struct udfunc *udf;
struct udfunc *udf, *wrong_udf = NULL;
struct pnode *tp;
char *s;
int arity = 0, rarity = 0;
bool found = FALSE;
int arity = 0;
if (args)
arity = 1;
@@ -276,19 +275,16 @@ ft_substdef(const char *name, struct pnode *args)
for (udf = udfuncs; udf; udf = udf->ud_next)
if (eq(name, udf->ud_name)) {
if (arity == udf->ud_arity) {
if (arity == udf->ud_arity)
break;
} else {
found = TRUE;
rarity = udf->ud_arity;
}
wrong_udf = udf;
}
if (udf == NULL) {
if (found)
if (wrong_udf)
fprintf(cp_err,
"Warning: the user-defined function %s has %d args\n",
name, rarity);
name, wrong_udf->ud_arity);
return NULL;
}