From 70033b132b4190ff6419a64896170f4611287353 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 20 Feb 2012 14:08:55 +0000 Subject: [PATCH] Remove priv arguments from ExprResolveKeyName They've never been used. Signed-off-by: Daniel Stone --- src/xkbcomp/action.c | 2 +- src/xkbcomp/expr.c | 45 ++++++++++-------------------------------- src/xkbcomp/expr.h | 4 +--- src/xkbcomp/geometry.c | 2 +- src/xkbcomp/symbols.c | 2 +- 5 files changed, 14 insertions(+), 41 deletions(-) diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c index e2b8d40..cf8d852 100644 --- a/src/xkbcomp/action.c +++ b/src/xkbcomp/action.c @@ -1048,7 +1048,7 @@ HandleRedirectKey(struct xkb_desc * xkb, switch (field) { case F_Keycode: - if (!ExprResolveKeyName(value, &rtrn, NULL, NULL)) + if (!ExprResolveKeyName(value, &rtrn)) return ReportMismatch(action->type, field, "key name"); tmp = KeyNameToLong(rtrn.keyName.name); if (!FindNamedKey(xkb, tmp, &kc, True, CreateKeyNames(xkb), 0)) diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c index f5b1129..df94824 100644 --- a/src/xkbcomp/expr.c +++ b/src/xkbcomp/expr.c @@ -761,12 +761,8 @@ ExprResolveString(ExprDef * expr, int ExprResolveKeyName(ExprDef * expr, - ExprResult * val_rtrn, - IdentLookupFunc lookup, char * lookupPriv) + ExprResult * val_rtrn) { - int ok = 0; - ExprDef *left; - ExprResult leftRtrn; char *bogus = NULL; switch (expr->op) @@ -781,27 +777,14 @@ ExprResolveKeyName(ExprDef * expr, memcpy(val_rtrn->keyName.name, expr->value.keyName, XkbKeyNameLength); return True; case ExprIdent: - if (lookup) - { - ok = (*lookup) (lookupPriv, - None, expr->value.str, TypeString, val_rtrn); - } - if (!ok) - ERROR("Identifier \"%s\" of type string not found\n", - XkbcAtomText(expr->value.str)); - return ok; + ERROR("Identifier \"%s\" of type string not found\n", + XkbcAtomText(expr->value.str)); + return False; case ExprFieldRef: - if (lookup) - { - ok = (*lookup) (lookupPriv, - expr->value.field.element, - expr->value.field.field, TypeString, val_rtrn); - } - if (!ok) - ERROR("Default \"%s.%s\" of type key name not found\n", - XkbcAtomText(expr->value.field.element), - XkbcAtomText(expr->value.field.field)); - return ok; + ERROR("Default \"%s.%s\" of type key name not found\n", + XkbcAtomText(expr->value.field.element), + XkbcAtomText(expr->value.field.field)); + return False; case OpAdd: if (bogus == NULL) bogus = "Addition"; @@ -826,18 +809,10 @@ ExprResolveKeyName(ExprDef * expr, ERROR("%s of key name values not permitted\n", bogus); return False; case OpNot: - left = expr->value.binary.left; - if (ExprResolveString(left, &leftRtrn, lookup, lookupPriv)) - { - ERROR("The ! operator cannot be applied to a key name\n"); - } + ERROR("The ! operator cannot be applied to a key name\n"); return False; case OpUnaryPlus: - left = expr->value.binary.left; - if (ExprResolveString(left, &leftRtrn, lookup, lookupPriv)) - { - ERROR("The + operator cannot be applied to a key name\n"); - } + ERROR("The + operator cannot be applied to a key name\n"); return False; default: WSGO("Unknown operator %d in ResolveKeyName\n", expr->op); diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h index 782cf20..fabb0ec 100644 --- a/src/xkbcomp/expr.h +++ b/src/xkbcomp/expr.h @@ -127,9 +127,7 @@ extern int ExprResolveString(ExprDef * /* expr */ , ); extern int ExprResolveKeyName(ExprDef * /* expr */ , - ExprResult * /* val_rtrn */ , - IdentLookupFunc /* lookup */ , - char * /* lookupPriv */ + ExprResult * /* val_rtrn */ ); extern int ExprResolveEnum(ExprDef * /* expr */ , diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c index bd3e5e6..f2eb5da 100644 --- a/src/xkbcomp/geometry.c +++ b/src/xkbcomp/geometry.c @@ -2078,7 +2078,7 @@ SetKeyField(KeyInfo * key, info->errorCount++; return ReportNotArray("key", field, keyText(key)); } - if (!ExprResolveKeyName(value, &tmp, NULL, NULL)) + if (!ExprResolveKeyName(value, &tmp)) { info->errorCount++; return ReportBadType("key", field, keyText(key), "key name"); diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index 8c261fb..5934c3e 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -1272,7 +1272,7 @@ SetSymbolsField(KeyInfo * key, ACTION("Ignored\n"); return False; } - ok = ExprResolveKeyName(value, &tmp, NULL, NULL); + ok = ExprResolveKeyName(value, &tmp); if (!ok) { ERROR("Illegal overlay key specification for %s\n",