diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2014-07-10 13:52:19 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2014-08-18 09:59:55 +0300 |
commit | 61559415c5d83ce19b63e32e2c09c47c26204003 (patch) | |
tree | 3eadd22084e066e7b7b20b18383f292e766ff2da | |
parent | 23bd5ceb911d0e0c6eb1dea573921e5ea8f07d90 (diff) | |
download | rpm-61559415c5d83ce19b63e32e2c09c47c26204003.tar.gz |
Eliminate unused spec argument from parseExpressionBoolean()
- Its never been used beyond assignment to the internal state struct,
so in reality this is entirely free of any rpmbuild-specifics.
Meaning we could trivially lift it to librpmio for macros...
- No functional changes here
(cherry picked from commit e49c51e451584d3229f629ed2923ccb34a94987b)
-rw-r--r-- | build/expression.c | 4 | ||||
-rw-r--r-- | build/parseSpec.c | 2 | ||||
-rw-r--r-- | build/rpmbuild_internal.h | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/build/expression.c b/build/expression.c index a71ad095c..581a79e19 100644 --- a/build/expression.c +++ b/build/expression.c @@ -105,7 +105,6 @@ typedef struct _parseState { char *p; /*!< current position in expression string */ int nextToken; /*!< current lookahead token */ Value tokenValue; /*!< valid when TOK_INTEGER or TOK_STRING */ - rpmSpec spec; /*!< spec file that we are parsing inside of */ } *ParseState; @@ -644,7 +643,7 @@ static Value doLogical(ParseState state) return v1; } -int parseExpressionBoolean(rpmSpec spec, const char *expr) +int parseExpressionBoolean(const char *expr) { struct _parseState state; int result = -1; @@ -654,7 +653,6 @@ int parseExpressionBoolean(rpmSpec spec, const char *expr) /* Initialize the expression parser state. */ state.p = state.str = xstrdup(expr); - state.spec = spec; state.nextToken = 0; state.tokenValue = NULL; (void) rdToken(&state); diff --git a/build/parseSpec.c b/build/parseSpec.c index 3489eaa7b..e38a4d9df 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -352,7 +352,7 @@ int readLine(rpmSpec spec, int strip) match = !match; } else if (ISMACROWITHARG(s, "%if")) { s += 3; - match = parseExpressionBoolean(spec, s); + match = parseExpressionBoolean(s); if (match < 0) { rpmlog(RPMLOG_ERR, _("%s:%d: bad %%if condition\n"), diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h index d6ece22f6..9d2a28094 100644 --- a/build/rpmbuild_internal.h +++ b/build/rpmbuild_internal.h @@ -290,12 +290,11 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char * field, rpmTagVal tagN, /** \ingroup rpmbuild * Evaluate boolean expression. - * @param spec spec file control structure * @param expr expression to parse * @return */ RPM_GNUC_INTERNAL -int parseExpressionBoolean(rpmSpec spec, const char * expr); +int parseExpressionBoolean(const char * expr); /** \ingroup rpmbuild * Run a build script, assembled from spec file scriptlet section. |