Commit 193e9b39137a83fd372053a8cf266329111c2cfb

Daniel Stone 2012-02-20T15:33:40

Introduce ExprResolveRadioGroup helper Just a tiny special-cased version of ExprResolveInteger. Signed-off-by: Daniel Stone <daniel@fooishbar.org>

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