Introduce ExprResolveRadioGroup helper Just a tiny special-cased version of ExprResolveInteger. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index 7bfc0a3..217656c 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -651,6 +651,13 @@ ExprResolveInteger(ExprDef * expr,
}
int
+ExprResolveRadioGroup(ExprDef * expr,
+ ExprResult * val_rtrn)
+{
+ return ExprResolveInteger(expr, val_rtrn, RadioLookup, NULL);
+}
+
+int
ExprResolveString(ExprDef * expr,
ExprResult * val_rtrn)
{
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index 2f3dd79..4aca3d4 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -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 */
);
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index e666256..c98fc1c 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -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");