From bf71865ce3967b27a33d3295de75063893882ada Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 4 Aug 2022 21:20:54 -0700 Subject: [PATCH] expr: remove unused 'pg' parameter from 'Exdisc_t.typename' --- lib/expr/exgram.h | 2 +- lib/expr/expr.h | 2 +- lib/gvpr/compile.c | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/expr/exgram.h b/lib/expr/exgram.h index 57a17d88e..8c36fe3a2 100644 --- a/lib/expr/exgram.h +++ b/lib/expr/exgram.h @@ -430,7 +430,7 @@ static int typecast[6][6] = char *extypename(Expr_t * p, int type) { if (BUILTIN(type)) return TYPENAME(type); - return (p->disc->typename) (p, type); + return (p->disc->typename) (type); } /* exnoncast: diff --git a/lib/expr/expr.h b/lib/expr/expr.h index 4b2631b1f..1383fcd71 100644 --- a/lib/expr/expr.h +++ b/lib/expr/expr.h @@ -206,7 +206,7 @@ struct Exdisc_s /* discipline */ /* type conversion function */ int (*binaryf) (Exnode_t *, Exnode_t *, Exnode_t *, int); /* binary operator function */ - char* (*typename) (Expr_t *, int); + char* (*typename) (int); /* application type names */ int (*stringof) (Expr_t *, Exnode_t *, int, Exdisc_t *); /* value to string conversion */ diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index 650526420..d20f338e1 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -1592,8 +1592,7 @@ getval(Expr_t * pgm, Exnode_t * node, Exid_t * sym, Exref_t * ref, #define MINTYPE (LAST_M+1) /* First type occurs after last M_ */ -static char *typeName(Expr_t * pg, int op) -{ +static char *typeName(int op) { return typenames[op - MINTYPE]; } @@ -1635,7 +1634,7 @@ setval(Expr_t * pgm, Exnode_t * x, Exid_t * sym, Exref_t * ref, state->tvt = (trav_type) iv; else error(1, "unexpected value %lld assigned to %s : ignored", - iv, typeName(pgm, T_tvtyp)); + iv, typeName(T_tvtyp)); break; } case V_travroot: @@ -2107,8 +2106,7 @@ static int stringOf(Expr_t * prog, Exnode_t * x, int arg, Exdisc_t* disc) } else { objp = int2ptr(x->data.constant.value.integer); if (!objp) { - exerror("cannot generate name for NULL %s", - typeName(prog, x->type)); + exerror("cannot generate name for NULL %s", typeName(x->type)); rv = -1; } else { -- 2.40.0