Commit bf27d58b authored by Ulrich Sibiller's avatar Ulrich Sibiller

Keystroke.c: move some vars to inner scope

parent ba5183f8
...@@ -190,9 +190,8 @@ static Bool read_binding_from_xmlnode(xmlNode *node, struct nxagentSpecialKeystr ...@@ -190,9 +190,8 @@ static Bool read_binding_from_xmlnode(xmlNode *node, struct nxagentSpecialKeystr
.modifierAltMeta = False, .modifierAltMeta = False,
.keysym = NoSymbol .keysym = NoSymbol
}; };
xmlAttr *attr;
for (attr = node->properties; attr; attr = attr->next) for (xmlAttr *attr = node->properties; attr; attr = attr->next)
{ {
/* ignore attributes without data (which should never happen anyways) */ /* ignore attributes without data (which should never happen anyways) */
if (attr->children->content == NULL) if (attr->children->content == NULL)
...@@ -482,7 +481,6 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X) ...@@ -482,7 +481,6 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X)
{ {
enum nxagentSpecialKeystroke ret = KEYSTROKE_NOTHING; enum nxagentSpecialKeystroke ret = KEYSTROKE_NOTHING;
int keysyms_per_keycode_return; int keysyms_per_keycode_return;
struct nxagentSpecialKeystrokeMap *cur = map;
XlibKeySym *keysym = XGetKeyboardMapping(nxagentDisplay, XlibKeySym *keysym = XGetKeyboardMapping(nxagentDisplay,
X->keycode, X->keycode,
...@@ -492,7 +490,7 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X) ...@@ -492,7 +490,7 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X)
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: got keysym '%c' (%d)\n", __func__, keysym[0], keysym[0]); fprintf(stderr, "%s: got keysym '%c' (%d)\n", __func__, keysym[0], keysym[0]);
#endif #endif
while (cur->stroke != KEYSTROKE_END_MARKER) { for (struct nxagentSpecialKeystrokeMap *cur = map; cur->stroke != KEYSTROKE_END_MARKER; cur++) {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: checking keysym '%c' (%d)\n", __func__, cur->keysym, cur->keysym); fprintf(stderr, "%s: checking keysym '%c' (%d)\n", __func__, cur->keysym, cur->keysym);
#endif #endif
...@@ -503,7 +501,6 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X) ...@@ -503,7 +501,6 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X)
free(keysym); free(keysym);
return cur->stroke; return cur->stroke;
} }
cur++;
} }
free(keysym); free(keysym);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment