]> granicus.if.org Git - graphviz/commitdiff
expr: remove unused parameters from 'Exdisc_t.binaryf'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 5 Aug 2022 04:15:09 +0000 (21:15 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 6 Aug 2022 17:10:31 +0000 (10:10 -0700)
I guess when I committed b0ec7b2eb448a2cb68ffb3751e9e054aecc60c24 it was not
obvious to me that this is entirely part of private internal interfaces and the
callback signature involved is not exposed publicly.

lib/expr/exeval.c
lib/expr/exgram.h
lib/expr/expr.h
lib/gvpr/compile.c

index 2d35b5f8590949962b0e7351c72d4c21948ad1ca..645013eed57ad5d257cbfba0d6eb0fe074706ffe 100644 (file)
@@ -1680,7 +1680,7 @@ eval(Expr_t* ex, Exnode_t* expr, void* env)
                        tmp.data.constant.value = v;
                        rtmp = *x;
                        rtmp.data.constant.value = r;
-                       if (!ex->disc->binaryf(ex, &tmp, expr, &rtmp, 0, ex->disc))
+                       if (!ex->disc->binaryf(&tmp, expr, &rtmp, 0))
                          return tmp.data.constant.value;
                }
        }
@@ -1803,7 +1803,7 @@ eval(Expr_t* ex, Exnode_t* expr, void* env)
                                rp = &rtmp;
                        } else
                                rp = 0;
-                       if (!ex->disc->binaryf(ex, &tmp, expr, rp, 0, ex->disc))
+                       if (!ex->disc->binaryf(&tmp, expr, rp, 0))
                                return tmp.data.constant.value;
                }
                goto integer;
index 46c7195f7db002c2a72fa02cacf452bc83bc7fe1..f7c64400530e481db4a0f17599d38b7fffbfd098 100644 (file)
@@ -1014,7 +1014,7 @@ exclose(Expr_t* p, int all)
 static void
 checkBinary(Expr_t * p, Exnode_t * l, Exnode_t * ex, Exnode_t * r) 
 {
-       if ((*p->disc->binaryf) (p, l, ex, r, 1, p->disc) < 0) {
+       if ((*p->disc->binaryf) (l, ex, r, 1) < 0) {
            if (r)
                exerror
                    ("cannot apply operator %s to expressions of types %s and %s",
index 013bf19ab916e1e7ae92d1d2520f221c9ee5321e..4b2631b1f5f775080f48d877b9a76d7252a55d24 100644 (file)
@@ -204,7 +204,7 @@ struct Exdisc_s                             /* discipline                   */
                                        /* unknown cast function        */
        int             (*convertf)(Exnode_t*, int, int);
                                        /* type conversion function     */
-       int             (*binaryf) (Expr_t *, Exnode_t *, Exnode_t *, Exnode_t *, int, Exdisc_t *);
+       int             (*binaryf) (Exnode_t *, Exnode_t *, Exnode_t *, int);
                                        /* binary operator function     */
        char*           (*typename) (Expr_t *, int);
                                        /* application type names       */
index a93ab5774516d91c422ee37fe9d9f3c48a589627..6505264205543230545ff9d5dc40f456c0b66866 100644 (file)
@@ -1879,13 +1879,7 @@ refval(Expr_t * pgm, Exnode_t * node, Exid_t * sym, Exref_t * ref)
  * Return -1 if operation cannot be done, 0 otherwise.
  * If arg is > 0, operation unnecessary; just report possibility.
  */
-static int
-binary(Expr_t * pg, Exnode_t * l, Exnode_t * ex, Exnode_t * r, int arg,
-       Exdisc_t * disc)
-{
-    (void)pg;
-    (void)disc;
-
+static int binary(Exnode_t * l, Exnode_t * ex, Exnode_t * r, int arg) {
     Agobj_t *lobjp;
     Agobj_t *robjp;
     int ret = -1;