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
This commit is contained in:
Panu Matilainen 2014-07-10 13:52:19 +03:00
parent e6ea36806b
commit e49c51e451
3 changed files with 3 additions and 6 deletions

View File

@ -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);

View File

@ -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"),

View File

@ -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.