From ecb5f46d1637298030a4679d5725ac4eb1531318 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 4 Aug 2022 20:56:27 -0700 Subject: [PATCH] expr: remove dereferencing and parens around calling 'Exdisc_t.reff' The compiler does not need to be explicitly told how to call through a function pointer. --- lib/expr/exgram.h | 3 +-- lib/expr/exparse.y | 2 +- lib/expr/extoken.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/expr/exgram.h b/lib/expr/exgram.h index cf5dad23b..680bd5c49 100644 --- a/lib/expr/exgram.h +++ b/lib/expr/exgram.h @@ -397,8 +397,7 @@ static Exnode_t *makeVar(Expr_t * prog, Exid_t * s, Exnode_t * idx, if (!prog->disc->getf) exerror("%s: identifier references not supported", sym->name); else if (expr.program->disc->reff) - (*expr.program->disc->reff) (prog, nn, - nn->data.variable.symbol, refs); + expr.program->disc->reff(prog, nn, nn->data.variable.symbol, refs); return nn; } diff --git a/lib/expr/exparse.y b/lib/expr/exparse.y index 1d86eeda7..c02e03ce0 100644 --- a/lib/expr/exparse.y +++ b/lib/expr/exparse.y @@ -1009,7 +1009,7 @@ constant : CONSTANT if (!expr.program->disc->reff) exerror("%s: identifier references not supported", $1->name); else - $$->data.constant.value = (*expr.program->disc->reff)(expr.program, $$, $1, NULL); + $$->data.constant.value = expr.program->disc->reff(expr.program, $$, $1, NULL); } | FLOATING { diff --git a/lib/expr/extoken.c b/lib/expr/extoken.c index b736d5252..7d28466ed 100644 --- a/lib/expr/extoken.c +++ b/lib/expr/extoken.c @@ -859,7 +859,7 @@ extoken_fn(Expr_t* ex) } break; } - (*ex->disc->reff)(ex, NULL, ex_lval.id, NULL); + ex->disc->reff(ex, NULL, ex_lval.id, NULL); /*..INDENT*/ } -- 2.40.0