summaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-10 11:38:04 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-11 14:35:34 -0800
commit64761ee9424f755b84ab0ce02d13eda32d215a14 (patch)
tree0d5369ba1460fb9c4be686511de659ed653362ba /expr.c
parent9737af15196380a1687d18a17d297ee17b45a83f (diff)
Variable scope reductions
Some found by cppcheck, some found by manual code inspection Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/expr.c b/expr.c
index b5e7222..2c9bb06 100644
--- a/expr.c
+++ b/expr.c
@@ -157,7 +157,6 @@ Bool
SimpleLookup(XPointer priv,
Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
{
- LookupEntry *entry;
char *str;
if ((priv == NULL) ||
@@ -167,7 +166,7 @@ SimpleLookup(XPointer priv,
return False;
}
str = XkbAtomGetString(NULL, field);
- for (entry = (LookupEntry *) priv;
+ for (LookupEntry *entry = (LookupEntry *) priv;
(entry != NULL) && (entry->name != NULL); entry++)
{
if (uStrCaseCmp(str, entry->name) == 0)
@@ -1051,11 +1050,12 @@ ExprResolveKeySym(ExprDef * expr,
IdentLookupFunc lookup, XPointer lookupPriv)
{
int ok = 0;
- KeySym sym;
if (expr->op == ExprIdent)
{
char *str;
+ KeySym sym;
+
str = XkbAtomGetString(NULL, expr->value.str);
if ((str != NULL) && ((sym = XStringToKeysym(str)) != NoSymbol))
{