diff options
author | marha <marha@users.sourceforge.net> | 2013-02-27 10:45:05 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-02-27 10:45:05 +0100 |
commit | c74ef795c7282681616decc36a9a81cd1b1b6ec7 (patch) | |
tree | beb5f13ba78bd7920eae918b6aa5db5bac83f0da /libX11/src/KeysymStr.c | |
parent | f51268259621a21d14e40b8a41c5803a5c2ce706 (diff) | |
download | vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.tar.gz vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.tar.bz2 vcxsrv-c74ef795c7282681616decc36a9a81cd1b1b6ec7.zip |
libX11 mesa pixman xkeyboard-config
xkeyboard-config commit 9993f996e75232385b19cc5078f7fecde6b399b9
libX11 commit b687440c28c7da6ee0ae44514d20248db5161606
pixman commit 2156fb51b353867d5a18b734690ca551f74d4fb1
mesa commit f987d23b28491bd7b0552bd9daffa53a8e073c71
Diffstat (limited to 'libX11/src/KeysymStr.c')
-rw-r--r-- | libX11/src/KeysymStr.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/libX11/src/KeysymStr.c b/libX11/src/KeysymStr.c index 101f29733..c7c470468 100644 --- a/libX11/src/KeysymStr.c +++ b/libX11/src/KeysymStr.c @@ -70,11 +70,6 @@ SameValue( char *XKeysymToString(KeySym ks) { - register int i, n; - int h; - register int idx; - const unsigned char *entry; - unsigned char val1, val2, val3, val4; XrmDatabase keysymdb; if (!ks || (ks & ((unsigned long) ~0x1fffffff)) != 0) @@ -83,16 +78,17 @@ char *XKeysymToString(KeySym ks) ks = 0; if (ks <= 0x1fffffff) { - val1 = ks >> 24; - val2 = (ks >> 16) & 0xff; - val3 = (ks >> 8) & 0xff; - val4 = ks & 0xff; - i = ks % VTABLESIZE; - h = i + 1; - n = VMAXHASH; + unsigned char val1 = ks >> 24; + unsigned char val2 = (ks >> 16) & 0xff; + unsigned char val3 = (ks >> 8) & 0xff; + unsigned char val4 = ks & 0xff; + int i = ks % VTABLESIZE; + int h = i + 1; + int n = VMAXHASH; + int idx; while ((idx = hashKeysym[i])) { - entry = &_XkeyTable[idx]; + const unsigned char *entry = &_XkeyTable[idx]; if ((entry[0] == val1) && (entry[1] == val2) && (entry[2] == val3) && (entry[3] == val4)) return ((char *)entry + 4); @@ -111,7 +107,7 @@ char *XKeysymToString(KeySym ks) XrmQuark empty = NULLQUARK; GRNData data; - sprintf(buf, "%lX", ks); + snprintf(buf, sizeof(buf), "%lX", ks); resval.addr = (XPointer)buf; resval.size = strlen(buf) + 1; data.name = (char *)NULL; @@ -136,7 +132,7 @@ char *XKeysymToString(KeySym ks) i--; s[i--] = '\0'; for (; i; i--){ - val1 = val & 0xf; + unsigned char val1 = val & 0xf; val >>= 4; if (val1 < 10) s[i] = '0'+ val1; |