diff options
Diffstat (limited to 'vmod.c')
-rw-r--r-- | vmod.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -47,8 +47,6 @@ InitVModInfo(VModInfo * info, XkbDescPtr xkb) void ClearVModInfo(VModInfo * info, XkbDescPtr xkb) { - int i; - if (XkbAllocNames(xkb, XkbVirtualModNamesMask, 0, 0) != Success) return; if (XkbAllocServerMap(xkb, XkbVirtualModsMask, 0) != Success) @@ -57,7 +55,8 @@ ClearVModInfo(VModInfo * info, XkbDescPtr xkb) info->newlyDefined = info->defined = info->available = 0; if (xkb && xkb->names) { - int bit; + int i, bit; + for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (xkb->names->vmods[i] != None) @@ -172,7 +171,6 @@ LookupVModIndex(XPointer priv, { int i; char *fieldStr; - char *modStr; XkbDescPtr xkb; xkb = (XkbDescPtr) priv; @@ -192,7 +190,7 @@ LookupVModIndex(XPointer priv, */ for (i = 0; i < XkbNumVirtualMods; i++) { - modStr = XkbAtomGetString(xkb->dpy, xkb->names->vmods[i]); + char *modStr = XkbAtomGetString(xkb->dpy, xkb->names->vmods[i]); if ((modStr != NULL) && (uStrCaseCmp(fieldStr, modStr) == 0)) { val_rtrn->uval = i; |