From 8fd974498bb5e76e14d38956fd82a906da8c810d Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 14 Aug 2022 14:36:52 -0700 Subject: [PATCH] expr excomp: remove unused string path This function could accept either a string or a file handle. But only the file handle code path is used. --- lib/expr/exgram.h | 10 ++++------ lib/expr/expr.h | 2 +- lib/gvpr/compile.c | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/expr/exgram.h b/lib/expr/exgram.h index 21ae82962..428878524 100644 --- a/lib/expr/exgram.h +++ b/lib/expr/exgram.h @@ -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; diff --git a/lib/expr/expr.h b/lib/expr/expr.h index 607e7acf8..047c5cdf7 100644 --- a/lib/expr/expr.h +++ b/lib/expr/expr.h @@ -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__ diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index d824174c3..46cec9594 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -2297,7 +2297,7 @@ static Exnode_t *compile(Expr_t * prog, char *src, char *input, int line, if (!src) src = ""; - rv = excomp(prog, src, line, 0, sf); + rv = excomp(prog, src, line, sf); sfclose(sf); if (rv >= 0 && getErrorErrors() == 0) -- 2.50.1