]> granicus.if.org Git - graphviz/commitdiff
expr excomp: remove unused string path
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 14 Aug 2022 21:36:52 +0000 (14:36 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 20 Aug 2022 03:02:56 +0000 (20:02 -0700)
This function could accept either a string or a file handle. But only the file
handle code path is used.

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

index 21ae82962bd3c6233fe2bb206e3bdd6720f23e33..4288785246c494fa97bff2c7079e306768c714ac 100644 (file)
@@ -924,23 +924,21 @@ void exinit(void) {
 }
 
 /*
- * compile the expression in [sf]p
+ * compile the expression in fp
  */
 
-int
-excomp(Expr_t* p, const char* name, int line, const char* sp, Sfio_t* fp)
-{
+int excomp(Expr_t *p, const char *name, int line, Sfio_t *fp) {
        Exid_t* v;
        int     eof;
 
        p->more = 0;
        eof = p->eof;
-       if (!sp && !fp)
+       if (!fp)
        {
                if (!p->input)
                        return -1;
        }
-       else if (expush(p, name, line, sp, fp))
+       else if (expush(p, name, line, NULL, fp))
                return -1;
        else
                p->input->unit = line >= 0;
index 607e7acf8f43142b098e7a972535cb9f63467243..047c5cdf762de748e0f137a11ddbd0135cab1f46 100644 (file)
@@ -243,7 +243,7 @@ struct Expr_s                               /* ex program state             */
 extern Exnode_t*       excast(Expr_t*, Exnode_t*, int, Exnode_t*, int);
 extern Exnode_t*       exnoncast(Exnode_t *);
 extern void            exclose(Expr_t*, int);
-extern int             excomp(Expr_t*, const char*, int, const char*, Sfio_t*);
+extern int             excomp(Expr_t*, const char*, int, Sfio_t*);
 extern char*           excontext(Expr_t*, char*, int);
 extern int             exdump(Expr_t*, Exnode_t*, agxbuf*);
 #ifdef __GNUC__
index d824174c30ce46951b24d7c3bbdedd106ae03913..46cec9594b326f190edd19f8494ba3a4290d99d3 100644 (file)
@@ -2297,7 +2297,7 @@ static Exnode_t *compile(Expr_t * prog, char *src, char *input, int line,
 
     if (!src)
        src = "<command line>";
-    rv = excomp(prog, src, line, 0, sf);
+    rv = excomp(prog, src, line, sf);
     sfclose(sf);
 
     if (rv >= 0 && getErrorErrors() == 0)