Introduce ExprResolveRadioGroup helper

Just a tiny special-cased version of ExprResolveInteger.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2012-02-20 15:33:40 +00:00
parent 26285a7bd9
commit 193e9b3913
3 changed files with 12 additions and 1 deletions

View File

@ -650,6 +650,13 @@ ExprResolveInteger(ExprDef * expr,
return False;
}
int
ExprResolveRadioGroup(ExprDef * expr,
ExprResult * val_rtrn)
{
return ExprResolveInteger(expr, val_rtrn, RadioLookup, NULL);
}
int
ExprResolveString(ExprDef * expr,
ExprResult * val_rtrn)

View File

@ -116,6 +116,10 @@ extern int ExprResolveInteger(ExprDef * /* expr */ ,
char * /* lookupPriv */
);
extern int ExprResolveRadioGroup(ExprDef * /* expr */ ,
ExprResult * /* val_rtrn */
);
extern int ExprResolveFloat(ExprDef * /* expr */ ,
ExprResult * /* val_rtrn */
);

View File

@ -1061,7 +1061,7 @@ SetAllowNone(KeyInfo * key, ExprDef * arrayNdx, ExprDef * value)
}
else
{
if (!ExprResolveInteger(arrayNdx, &tmp, RadioLookup, NULL))
if (!ExprResolveRadioGroup(arrayNdx, &tmp))
{
ERROR("Illegal index in group name definition\n");
ACTION("Definition with non-integer array index ignored\n");