expr: don't expose LookupModIndex The Lookup* functions should remain a private implementation detail of the expr.c file. Signed-off-by: Ran Benita <ran234@gmail.com>
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
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index c8197d1..a66729b 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -81,7 +81,7 @@ SimpleLookup(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
return false;
}
-bool
+static bool
LookupModIndex(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
enum expr_value_type type, xkb_mod_index_t *val_rtrn)
{
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index a5abce1..14a6179 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -33,10 +33,6 @@ ExprResolveLhs(struct xkb_context *ctx, const ExprDef *expr,
ExprDef **index_rtrn);
bool
-LookupModIndex(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
- enum expr_value_type type, xkb_mod_index_t *val_rtrn);
-
-bool
ExprResolveModMask(struct xkb_context *ctx, const ExprDef *expr,
xkb_mod_mask_t *mask_rtrn);
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 06661ae..592e991 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1209,7 +1209,8 @@ HandleModMapDef(SymbolsInfo *info, ModMapDef *def)
bool ok;
struct xkb_context *ctx = info->keymap->ctx;
- if (!LookupModIndex(ctx, NULL, def->modifier, EXPR_TYPE_INT, &ndx)) {
+ ndx = ModNameToIndex(xkb_atom_text(ctx, def->modifier));
+ if (ndx == XKB_MOD_INVALID) {
log_err(info->keymap->ctx,
"Illegal modifier map definition; "
"Ignoring map for non-modifier \"%s\"\n",