]> granicus.if.org Git - graphviz/commitdiff
expr: remove dereferencing and parens around calling 'Exdisc_t.convertf'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 5 Aug 2022 04:10:26 +0000 (21:10 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 6 Aug 2022 17:10:31 +0000 (10:10 -0700)
The compiler does not need to be explicitly told how to call through a function
pointer.

lib/expr/exgram.h

index ae67380ed6df774bc431f041bdd30abbc904fc92..46c7195f7db002c2a72fa02cacf452bc83bc7fe1 100644 (file)
@@ -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);
                                        }