From: Matthew Fernandez Date: Fri, 5 Aug 2022 04:15:09 +0000 (-0700) Subject: expr: remove unused parameters from 'Exdisc_t.binaryf' X-Git-Tag: 5.0.1~18^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96d4d88fe64525120592fed42bdc233d42f51885;p=graphviz expr: remove unused parameters from 'Exdisc_t.binaryf' I guess when I committed b0ec7b2eb448a2cb68ffb3751e9e054aecc60c24 it was not obvious to me that this is entirely part of private internal interfaces and the callback signature involved is not exposed publicly. --- diff --git a/lib/expr/exeval.c b/lib/expr/exeval.c index 2d35b5f85..645013eed 100644 --- a/lib/expr/exeval.c +++ b/lib/expr/exeval.c @@ -1680,7 +1680,7 @@ eval(Expr_t* ex, Exnode_t* expr, void* env) tmp.data.constant.value = v; rtmp = *x; rtmp.data.constant.value = r; - if (!ex->disc->binaryf(ex, &tmp, expr, &rtmp, 0, ex->disc)) + if (!ex->disc->binaryf(&tmp, expr, &rtmp, 0)) return tmp.data.constant.value; } } @@ -1803,7 +1803,7 @@ eval(Expr_t* ex, Exnode_t* expr, void* env) rp = &rtmp; } else rp = 0; - if (!ex->disc->binaryf(ex, &tmp, expr, rp, 0, ex->disc)) + if (!ex->disc->binaryf(&tmp, expr, rp, 0)) return tmp.data.constant.value; } goto integer; diff --git a/lib/expr/exgram.h b/lib/expr/exgram.h index 46c7195f7..f7c644005 100644 --- a/lib/expr/exgram.h +++ b/lib/expr/exgram.h @@ -1014,7 +1014,7 @@ exclose(Expr_t* p, int all) static void checkBinary(Expr_t * p, Exnode_t * l, Exnode_t * ex, Exnode_t * r) { - if ((*p->disc->binaryf) (p, l, ex, r, 1, p->disc) < 0) { + if ((*p->disc->binaryf) (l, ex, r, 1) < 0) { if (r) exerror ("cannot apply operator %s to expressions of types %s and %s", diff --git a/lib/expr/expr.h b/lib/expr/expr.h index 013bf19ab..4b2631b1f 100644 --- a/lib/expr/expr.h +++ b/lib/expr/expr.h @@ -204,7 +204,7 @@ struct Exdisc_s /* discipline */ /* unknown cast function */ int (*convertf)(Exnode_t*, int, int); /* type conversion function */ - int (*binaryf) (Expr_t *, Exnode_t *, Exnode_t *, Exnode_t *, int, Exdisc_t *); + int (*binaryf) (Exnode_t *, Exnode_t *, Exnode_t *, int); /* binary operator function */ char* (*typename) (Expr_t *, int); /* application type names */ diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index a93ab5774..650526420 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -1879,13 +1879,7 @@ refval(Expr_t * pgm, Exnode_t * node, Exid_t * sym, Exref_t * ref) * Return -1 if operation cannot be done, 0 otherwise. * If arg is > 0, operation unnecessary; just report possibility. */ -static int -binary(Expr_t * pg, Exnode_t * l, Exnode_t * ex, Exnode_t * r, int arg, - Exdisc_t * disc) -{ - (void)pg; - (void)disc; - +static int binary(Exnode_t * l, Exnode_t * ex, Exnode_t * r, int arg) { Agobj_t *lobjp; Agobj_t *robjp; int ret = -1;