]> granicus.if.org Git - graphviz/commitdiff
expr: remove unused parameters from 'Exdisc_t.matchf' smattr/03db530d-2fe9-47e3-b566-bda45c2928ce
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 5 Aug 2022 04:43:03 +0000 (21:43 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 5 Aug 2022 04:43:03 +0000 (21:43 -0700)
I guess when I committed 260f650085eb25b5b68c81a5960232d025fb6942 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/expr.h
lib/gvpr/compile.c

index 4ec7328787af8ea70af949e45f12678d19aa48c6..5d0590c9d627db6d8c0c56e03eaf3636837b063c 100644 (file)
@@ -1297,8 +1297,7 @@ eval(Expr_t* ex, Exnode_t* expr, void* env)
                                                continue;
                                        case STRING:
                                                if ((ex->disc->version >= 19981111L && ex->disc->matchf)
-                                                     ? ex->disc->matchf(ex, x, (*t)->string, expr->data.operand.left,
-                                                                        v.string, env, ex->disc)
+                                                     ? ex->disc->matchf((*t)->string, v.string)
                                                      : strmatch((*t)->string, v.string))
                                                        break;
                                                continue;
@@ -1974,9 +1973,7 @@ eval(Expr_t* ex, Exnode_t* expr, void* env)
                case NE:
                        v.integer = ((v.string && r.string)
                                      ? ((ex->disc->version >= 19981111L && ex->disc->matchf)
-                                       ? ex->disc->matchf(ex, expr->data.operand.left, v.string,
-                                                          expr->data.operand.right, r.string, env,
-                                                          ex->disc)
+                                       ? ex->disc->matchf(v.string, r.string)
                                        : strmatch(v.string, r.string))
                                      : (v.string == r.string)) == (expr->op == EQ);
                        return v;
index 0cfe15d5bfc7f6553c18e6d55a408133a82b136f..ddadb0a8f5c066b090b50f36cf0172973bdd1994 100644 (file)
@@ -219,7 +219,7 @@ struct Exdisc_s                             /* discipline                   */
                                        /* reference value function     */
        int             (*setf)(Expr_t*, Exnode_t*, Exid_t*, Exref_t*, void*, Extype_t);
                                        /* set value function           */
-       int             (*matchf)(Expr_t*, Exnode_t*, const char*, Exnode_t*, const char*, void*, Exdisc_t*);
+       int             (*matchf)(const char*, const char*);
        /* exit function           */
        Exexit_f        exitf;
        int*            types;
index 1f41dda81b7fecdca78aeb3a998a96ab813c2979..d770b3a0c3ca3e61cf210aff5ed6df7a3ca079e8 100644 (file)
@@ -2212,16 +2212,7 @@ static Extype_t keyval(Extype_t v, int type) {
 /* matchval:
  * Pattern match strings.
  */
-static int
-matchval(Expr_t * pgm, Exnode_t * xstr, const char *str, Exnode_t * xpat,
-        const char *pat, void *env, Exdisc_t * disc)
-{
-    (void)pgm;
-    (void)xstr;
-    (void)xpat;
-    (void)env;
-    (void)disc;
-
+static int matchval(const char *str, const char *pat) {
     return strgrpmatch(str, pat, NULL, 0,
                       STR_MAXIMAL | STR_LEFT | STR_RIGHT);
 }