Commit 70262292104de444bfd82b2ebdb5043ef28bb85b

Ran Benita 2012-07-23T23:56:28

expr: drop ExprResult from ResolveKeysym Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index 2d71ca7..025010e 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -820,26 +820,24 @@ ExprResolveVModMask(struct xkb_keymap *keymap, ExprDef *expr,
                                  keymap);
 }
 
-int
+bool
 ExprResolveKeySym(struct xkb_context *ctx, ExprDef *expr,
-                  ExprResult *val_rtrn)
+                  xkb_keysym_t *sym_rtrn)
 {
-    int ok = 0;
-    xkb_keysym_t sym;
+    bool ok = false;
+    ExprResult result;
 
     if (expr->op == EXPR_IDENT) {
         const char *str;
         str = xkb_atom_text(ctx, expr->value.str);
-        if (str) {
-            sym = xkb_keysym_from_name(str);
-            if (sym != XKB_KEY_NoSymbol) {
-                val_rtrn->uval = sym;
-                return true;
-            }
-        }
+        *sym_rtrn = xkb_keysym_from_name(str);
+        if (*sym_rtrn != XKB_KEY_NoSymbol)
+            return true;
     }
-    ok = ExprResolveInteger(ctx, expr, val_rtrn);
-    if ((ok) && (val_rtrn->uval < 10))
-        val_rtrn->uval += '0';
+
+    ok = ExprResolveInteger(ctx, expr, &result);
+    if (ok && result.uval < 10)
+        *sym_rtrn = result.uval + '0';
+
     return ok;
 }
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index 214ea8d..c5222a1 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -103,8 +103,8 @@ extern int
 ExprResolveMask(struct xkb_context *ctx, ExprDef *expr, ExprResult *val_rtrn,
                 const LookupEntry *values);
 
-extern int
+bool
 ExprResolveKeySym(struct xkb_context *ctx, ExprDef *expr,
-                  ExprResult *val_rtrn);
+                  xkb_keysym_t *sym_rtrn);
 
 #endif /* EXPR_H */
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 06db89d..97a6543 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1370,13 +1370,15 @@ HandleModMapDef(SymbolsInfo *info, ModMapDef *def)
     ok = true;
     tmp.modifier = rtrn.uval;
     for (key = def->keys; key != NULL; key = (ExprDef *) key->common.next) {
+        xkb_keysym_t sym;
+
         if (key->op == EXPR_VALUE && key->value_type == EXPR_TYPE_KEYNAME) {
             tmp.haveSymbol = false;
             tmp.u.keyName = KeyNameToLong(key->value.keyName);
         }
-        else if (ExprResolveKeySym(ctx, key, &rtrn)) {
+        else if (ExprResolveKeySym(ctx, key, &sym)) {
             tmp.haveSymbol = true;
-            tmp.u.keySym = rtrn.uval;
+            tmp.u.keySym = sym;
         }
         else {
             log_err(info->keymap->ctx,