From 0cd5a5399966eb2999aaf9b19847e0be9d8e4417 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 4 Aug 2022 21:23:19 -0700 Subject: [PATCH] expr: remove dereferencing and parens around calling 'Exdisc_t.stringof' The compiler does not need to be explicitly told how to call through a function pointer. --- lib/expr/exeval.c | 2 +- lib/expr/exgram.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/expr/exeval.c b/lib/expr/exeval.c index 645013eed..2d4e6c448 100644 --- a/lib/expr/exeval.c +++ b/lib/expr/exeval.c @@ -1099,7 +1099,7 @@ xPrint(Expr_t * ex, Exnode_t * expr, Extype_t v, Exnode_t * tmp) { *tmp = *expr->data.operand.left; tmp->data.constant.value = v; - if ((*ex->disc->stringof) (ex, tmp, 0, ex->disc)) + if (ex->disc->stringof(ex, tmp, 0, ex->disc)) exerror("%s: no string representation of %s value", expr->data.operand.left->data.variable.symbol->name, extypename(ex, expr->data.operand.left->type)); diff --git a/lib/expr/exgram.h b/lib/expr/exgram.h index a58d43a1b..ea05255de 100644 --- a/lib/expr/exgram.h +++ b/lib/expr/exgram.h @@ -304,7 +304,7 @@ static Exnode_t *exstringOf(Expr_t * p, Exnode_t * x) { exerror("cannot convert %s to STRING", extypename(p, type)); if (x->op != CONSTANT) { if (!BUILTIN(type)) { - if ((*p->disc->stringof) (p, x, 1, p->disc) < 0) { + if (p->disc->stringof(p, x, 1, p->disc) < 0) { exerror("cannot convert %s to STRING", extypename(p, type)); } @@ -320,7 +320,7 @@ static Exnode_t *exstringOf(Expr_t * p, Exnode_t * x) { } x = exnewnode(p, cvt, 0, STRING, x, 0); } else if (!BUILTIN(type)) { - if ((*p->disc->stringof) (p, x, 0, p->disc) < 0) + if (p->disc->stringof(p, x, 0, p->disc) < 0) exerror("cannot convert constant %s to STRING", extypename(p, x->type)); } else -- 2.40.0