aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-03-23 23:32:24 +0100
committerUlrich Sibiller <uli42@gmx.de>2017-04-03 21:28:11 +0200
commitbf27d58b7e65d30d84704e7efd2d29002903030d (patch)
tree041414bca4ec6d6ad5db95da6d4267b40d59fc94 /nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
parentba5183f80836042ce90be7dde29cc2c5f13baf9d (diff)
downloadnx-libs-bf27d58b7e65d30d84704e7efd2d29002903030d.tar.gz
nx-libs-bf27d58b7e65d30d84704e7efd2d29002903030d.tar.bz2
nx-libs-bf27d58b7e65d30d84704e7efd2d29002903030d.zip
Keystroke.c: move some vars to inner scope
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keystroke.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keystroke.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
index 8a5347a53..ff6a2939e 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
@@ -190,9 +190,8 @@ static Bool read_binding_from_xmlnode(xmlNode *node, struct nxagentSpecialKeystr
.modifierAltMeta = False,
.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) */
if (attr->children->content == NULL)
@@ -482,7 +481,6 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X)
{
enum nxagentSpecialKeystroke ret = KEYSTROKE_NOTHING;
int keysyms_per_keycode_return;
- struct nxagentSpecialKeystrokeMap *cur = map;
XlibKeySym *keysym = XGetKeyboardMapping(nxagentDisplay,
X->keycode,
@@ -492,7 +490,7 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X)
#ifdef DEBUG
fprintf(stderr, "%s: got keysym '%c' (%d)\n", __func__, keysym[0], keysym[0]);
#endif
- while (cur->stroke != KEYSTROKE_END_MARKER) {
+ for (struct nxagentSpecialKeystrokeMap *cur = map; cur->stroke != KEYSTROKE_END_MARKER; cur++) {
#ifdef DEBUG
fprintf(stderr, "%s: checking keysym '%c' (%d)\n", __func__, cur->keysym, cur->keysym);
#endif
@@ -503,7 +501,6 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X)
free(keysym);
return cur->stroke;
}
- cur++;
}
free(keysym);