From: Matthew Fernandez Date: Fri, 5 Aug 2022 04:28:01 +0000 (-0700) Subject: expr: remove unused parameters from 'Exdisc_t.keyf' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ad70fbb609697333836526a60d5b37abf26648f;p=graphviz expr: remove unused parameters from 'Exdisc_t.keyf' I guess when I committed 2e9753d9c9886f5bc013212420528e9a18bc592b 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 2d4e6c448..5cdf90a68 100644 --- a/lib/expr/exeval.c +++ b/lib/expr/exeval.c @@ -99,7 +99,7 @@ static int evaldyn(Expr_t *ex, Exnode_t *exnode, void *env, int delete) { int type = exnode->data.variable.index->type; if (type != STRING) { if (!BUILTIN(type)) { - key = (*ex->disc->keyf) (ex, v, type, ex->disc); + key = (*ex->disc->keyf) (v, type); } else key.integer = v.integer; snprintf(buf, sizeof(buf), "%llx", (unsigned long long)key.integer); @@ -146,7 +146,7 @@ static Extype_t getdyn(Expr_t *ex, Exnode_t *exnode, void *env, int type = exnode->data.variable.index->type; if (type != STRING) { if (!BUILTIN(type)) { - key = (*ex->disc->keyf) (ex, v, type, ex->disc); + key = (*ex->disc->keyf) (v, type); } else key.integer = v.integer; snprintf(buf, sizeof(buf), "%llx", (unsigned long long)key.integer); diff --git a/lib/expr/expr.h b/lib/expr/expr.h index 1383fcd71..1b27f1ba0 100644 --- a/lib/expr/expr.h +++ b/lib/expr/expr.h @@ -210,7 +210,7 @@ struct Exdisc_s /* discipline */ /* application type names */ int (*stringof) (Expr_t *, Exnode_t *, int, Exdisc_t *); /* value to string conversion */ - Extype_t (*keyf) (Expr_t *, Extype_t, int, Exdisc_t *); + Extype_t (*keyf) (Extype_t, int); /* dictionary key for external type objects */ Exerror_f errorf; /* error function */ Extype_t (*getf)(Expr_t*, Exnode_t*, Exid_t*, Exref_t*, void*, int, Exdisc_t*); diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index e01aec98f..4b904d0e0 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -2205,11 +2205,7 @@ static int convert(Exnode_t *x, int type, int arg) { * Calculate unique key for object. * We use this to unify local copies of nodes and edges. */ -static Extype_t keyval(Expr_t * pgm, Extype_t v, int type, Exdisc_t * disc) -{ - (void)pgm; - (void)disc; - +static Extype_t keyval(Extype_t v, int type) { if (type <= T_obj) { v.integer = AGID(int2ptr(v.integer)); }