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:
parent
e6ea36806b
commit
e49c51e451
|
@ -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);
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue