From: Matthew Fernandez Date: Fri, 5 Aug 2022 04:10:26 +0000 (-0700) Subject: expr: remove dereferencing and parens around calling 'Exdisc_t.convertf' X-Git-Tag: 5.0.1~18^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=085f7dc457d5ae27d6f971545b6f3379cfc24de1;p=graphviz expr: remove dereferencing and parens around calling 'Exdisc_t.convertf' The compiler does not need to be explicitly told how to call through a function pointer. --- diff --git a/lib/expr/exgram.h b/lib/expr/exgram.h index ae67380ed..46c7195f7 100644 --- a/lib/expr/exgram.h +++ b/lib/expr/exgram.h @@ -464,7 +464,7 @@ excast(Expr_t* p, Exnode_t* x, int type, Exnode_t* xref, int arg) Exid_t *sym = (xref ? xref->data.variable.symbol : NULL); if (EXTERNAL(t2t)) { int a = (arg ? arg : 1); - if ((*p->disc->convertf) (x, type, a) < 0) { + if (p->disc->convertf(x, type, a) < 0) { if (xref) { if ((sym->lex == FUNCTION) && arg) exerror ("%s: cannot use value of type %s as argument %d in function %s", @@ -494,10 +494,10 @@ excast(Expr_t* p, Exnode_t* x, int type, Exnode_t* xref, int arg) case X2X: if (xref && xref->op == ID) { - if ((*p->disc->convertf)(x, type, arg) < 0) + if (p->disc->convertf(x, type, arg) < 0) exerror("%s: cannot cast constant %s to %s", xref->data.variable.symbol->name, extypename(p, x->type), extypename(p, type)); } - else if ((*p->disc->convertf)(x, type, arg) < 0) + else if (p->disc->convertf(x, type, arg) < 0) exerror("cannot cast constant %s to %s", extypename(p, x->type), extypename(p, type)); break; case F2I: @@ -785,7 +785,7 @@ preprint(Exnode_t* args) { if (x->arg->op == CONSTANT && x->arg->data.constant.reference && expr.program->disc->convertf) { - if ((*expr.program->disc->convertf)(x->arg, STRING, 0) < 0) + if (expr.program->disc->convertf(x->arg, STRING, 0) < 0) exerror("cannot convert string format argument"); else x->arg->data.constant.value.string = vmstrdup(expr.program->vm, x->arg->data.constant.value.string); }