From 60e7eeeba1d6c1b17cc71c36381251e633d6716e Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 17 Jun 2010 03:16:09 +0100 Subject: [PATCH] Use CARD32 instead of Atom, drag in XkbClientMapRec On 64-bit architectures, XID varies in size between the server (always 32 bits), and non-server (always unsigned long) for some inexplicable reason. Use CARD32 instead to avoid this horrible trap. This involves dragging in XkbClientMapRec so we don't get stuck in the KeySym trap. Signed-off-by: Daniel Stone --- include/X11/extensions/XKBcommon.h | 44 ++++++++++++++++++++++++++++-- src/alloc.c | 12 ++++---- src/keysym.c | 6 ++-- src/malloc.c | 44 +++++++++++++++--------------- src/misc.c | 4 +-- src/text.c | 4 +-- src/xkballoc.h | 2 +- src/xkbcomp/expr.c | 2 +- src/xkbcomp/keytypes.c | 4 +-- src/xkbcomp/misc.c | 6 ++-- src/xkbcomp/parseutils.c | 6 ++-- src/xkbcomp/parseutils.h | 4 +-- src/xkbcomp/symbols.c | 36 ++++++++++++------------ src/xkbcomp/xkbcomp.h | 2 +- src/xkbmisc.h | 4 +-- 15 files changed, 109 insertions(+), 71 deletions(-) diff --git a/include/X11/extensions/XKBcommon.h b/include/X11/extensions/XKBcommon.h index 2c17304..3d451f8 100644 --- a/include/X11/extensions/XKBcommon.h +++ b/include/X11/extensions/XKBcommon.h @@ -34,6 +34,9 @@ authorization from the authors. #include #include +#define KeySym CARD32 +#define Atom CARD32 + /* Action structures used in the server */ #define XkbcAnyActionDataSize 18 @@ -121,6 +124,35 @@ typedef union _XkbcAction { unsigned char type; } XkbcAction; +typedef struct _XkbcSymInterpretRec { + CARD32 sym; + unsigned char flags; + unsigned char match; + unsigned char mods; + unsigned char virtual_mod; + XkbcAnyAction act; +} XkbcSymInterpretRec,*XkbcSymInterpretPtr; + +typedef struct _XkbcCompatMapRec { + XkbcSymInterpretPtr sym_interpret; + XkbModsRec groups[XkbNumKbdGroups]; + unsigned short num_si; + unsigned short size_si; +} XkbcCompatMapRec, *XkbcCompatMapPtr; + +typedef struct _XkbcClientMapRec { + unsigned char size_types; + unsigned char num_types; + XkbKeyTypePtr types; + + unsigned short size_syms; + unsigned short num_syms; + uint32_t *syms; + XkbSymMapPtr key_sym_map; + + unsigned char *modmap; +} XkbcClientMapRec, *XkbcClientMapPtr; + typedef struct _XkbcServerMapRec { unsigned short num_acts; unsigned short size_acts; @@ -150,7 +182,7 @@ typedef struct _XkbcDesc { XkbControlsPtr ctrls; XkbcServerMapPtr server; - XkbClientMapPtr map; + XkbcClientMapPtr map; XkbIndicatorPtr indicators; XkbNamesPtr names; XkbCompatMapPtr compat; @@ -199,17 +231,23 @@ XkbcCanonicaliseComponents(XkbComponentNamesPtr names, * The string returned may become invalidated after the next call to * XkbcKeysymToString: if you need to preserve it, then you must * duplicate it. + * + * This is CARD32 rather than KeySym, as KeySym changes size between + * client and server (no, really). */ extern char * -XkbcKeysymToString(KeySym ks); +XkbcKeysymToString(CARD32 ks); /* * See XkbcKeysymToString comments: this function will accept any string * from that function. */ -extern KeySym +extern CARD32 XkbcStringToKeysym(const char *s); _XFUNCPROTOEND +#undef KeySym +#undef Atom + #endif /* _XKBCOMMON_H_ */ diff --git a/src/alloc.c b/src/alloc.c index fce6b8c..173a4c2 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -136,7 +136,7 @@ XkbcAllocNames(XkbcDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases) type = xkb->map->types; for (i = 0; i < xkb->map->num_types; i++, type++) { if (!type->level_names) { - type->level_names = _XkbTypedCalloc(type->num_levels, Atom); + type->level_names = _XkbTypedCalloc(type->num_levels, CARD32); if (!type->level_names) return BadAlloc; } @@ -181,15 +181,15 @@ XkbcAllocNames(XkbcDescPtr xkb, unsigned which, int nTotalRG, int nTotalAliases) if ((which & XkbRGNamesMask) && (nTotalRG > 0)) { if (!names->radio_groups) - names->radio_groups = _XkbTypedCalloc(nTotalRG, Atom); + names->radio_groups = _XkbTypedCalloc(nTotalRG, CARD32); else if (nTotalRG > names->num_rg) { - Atom *prev_radio_groups = names->radio_groups; + CARD32 *prev_radio_groups = names->radio_groups; names->radio_groups = _XkbTypedRealloc(names->radio_groups, - nTotalRG, Atom); + nTotalRG, CARD32); if (names->radio_groups) _XkbClearElems(names->radio_groups, names->num_rg, - nTotalRG - 1, Atom); + nTotalRG - 1, CARD32); else _XkbFree(prev_radio_groups); } @@ -216,7 +216,7 @@ XkbcFreeNames(XkbcDescPtr xkb, unsigned which, Bool freeMap) which = XkbAllNamesMask; if (which & XkbKTLevelNamesMask) { - XkbClientMapPtr map = xkb->map; + XkbcClientMapPtr map = xkb->map; if (map && map->types) { int i; diff --git a/src/keysym.c b/src/keysym.c index 1b33151..42a91f5 100644 --- a/src/keysym.c +++ b/src/keysym.c @@ -38,7 +38,7 @@ authorization from the authors. #include "ks_tables.h" char * -XkbcKeysymToString(KeySym ks) +XkbcKeysymToString(CARD32 ks) { int i, n, h, idx; const unsigned char *entry; @@ -91,7 +91,7 @@ XkbcKeysymToString(KeySym ks) return ret; } -KeySym +CARD32 XkbcStringToKeysym(const char *s) { int i, n, h, c, idx; @@ -99,7 +99,7 @@ XkbcStringToKeysym(const char *s) const char *p = s; const unsigned char *entry; unsigned char sig1, sig2; - KeySym val; + CARD32 val; while ((c = *p++)) sig = (sig << 1) + c; diff --git a/src/malloc.c b/src/malloc.c index 1f814a0..9b842a5 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -32,7 +32,7 @@ int XkbcAllocClientMap(XkbcDescPtr xkb, unsigned which, unsigned nTotalTypes) { int i; - XkbClientMapPtr map; + XkbcClientMapPtr map; if (!xkb || ((nTotalTypes > 0) && (nTotalTypes < XkbNumRequiredTypes))) return BadValue; @@ -49,7 +49,7 @@ XkbcAllocClientMap(XkbcDescPtr xkb, unsigned which, unsigned nTotalTypes) } if (!xkb->map) { - map = _XkbTypedCalloc(1, XkbClientMapRec); + map = _XkbTypedCalloc(1, XkbcClientMapRec); if (!map) return BadAlloc; xkb->map = map; @@ -88,7 +88,7 @@ XkbcAllocClientMap(XkbcDescPtr xkb, unsigned which, unsigned nTotalTypes) if (!map->syms) { map->size_syms = (nKeys * 15) / 10; - map->syms = _XkbTypedCalloc(map->size_syms, KeySym); + map->syms = _XkbTypedCalloc(map->size_syms, uint32_t); if (!map->syms) { map->size_syms = 0; return BadAlloc; @@ -268,11 +268,11 @@ XkbcCopyKeyType(XkbKeyTypePtr from, XkbKeyTypePtr into) } if (from->level_names && (into->num_levels > 0)) { - into->level_names = _XkbTypedCalloc(into->num_levels, Atom); + into->level_names = _XkbTypedCalloc(into->num_levels, CARD32); if (!into->level_names) return BadAlloc; memcpy(into->level_names, from->level_names, - into->num_levels * sizeof(Atom)); + into->num_levels * sizeof(CARD32)); } return Success; @@ -362,10 +362,10 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count, } if ((new_num_lvls > type->num_levels) || !type->level_names) { - Atom *prev_level_names = type->level_names; + CARD32 *prev_level_names = type->level_names; type->level_names = _XkbTypedRealloc(type->level_names, new_num_lvls, - Atom); + CARD32); if (!type->level_names) { if (prev_level_names) _XkbFree(prev_level_names); @@ -398,7 +398,7 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count, nMatchingKeys = 0; if (new_num_lvls > type->num_levels) { int nTotal; - KeySym *newSyms; + CARD32 *newSyms; int width, match, nResize = 0; int i, g, nSyms; @@ -427,7 +427,7 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count, int nextMatch; xkb->map->size_syms = (nTotal * 12) / 10; - newSyms = _XkbTypedCalloc(xkb->map->size_syms, KeySym); + newSyms = _XkbTypedCalloc(xkb->map->size_syms, CARD32); if (!newSyms) return BadAlloc; nextMatch = 0; @@ -435,20 +435,20 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count, for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) { if (matchingKeys[nextMatch] == i) { - KeySym *pOld; + CARD32 *pOld; nextMatch++; width = XkbKeyGroupsWidth(xkb, i); pOld = XkbKeySymsPtr(xkb, i); for (g = XkbKeyNumGroups(xkb, i) - 1; g >= 0; g--) memcpy(&newSyms[nSyms+(new_num_lvls * g)], - &pOld[width * g], width * sizeof(KeySym)); + &pOld[width * g], width * sizeof(CARD32)); xkb->map->key_sym_map[i].offset = nSyms; nSyms += XkbKeyNumGroups(xkb, i) * new_num_lvls; } else { memcpy(&newSyms[nSyms], XkbKeySymsPtr(xkb, i), - XkbKeyNumSyms(xkb, i) * sizeof(KeySym)); + XkbKeyNumSyms(xkb, i) * sizeof(CARD32)); xkb->map->key_sym_map[i].offset = nSyms; nSyms += XkbKeyNumSyms(xkb,i); } @@ -491,7 +491,7 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count, firstClear = new_num_lvls; for (i = 0; i < nMatchingKeys; i++) { - KeySym *pSyms; + CARD32 *pSyms; int width, nClear; key = matchingKeys[i]; @@ -502,7 +502,7 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count, if (XkbKeyKeyTypeIndex(xkb, key, g) == type_ndx) { if (nClear>0) bzero(&pSyms[g * width + firstClear], - nClear * sizeof(KeySym)); + nClear * sizeof(CARD32)); } } } @@ -513,12 +513,12 @@ XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count, return Success; } -KeySym * +CARD32 * XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed) { int i, nSyms, nKeySyms; unsigned nOldSyms; - KeySym *newSyms; + CARD32 *newSyms; if (needed == 0) { xkb->map->key_sym_map[key].offset = 0; @@ -532,11 +532,11 @@ XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed) if (xkb->map->size_syms - xkb->map->num_syms >= (unsigned)needed) { if (nOldSyms > 0) memcpy(&xkb->map->syms[xkb->map->num_syms], - XkbKeySymsPtr(xkb, key), nOldSyms * sizeof(KeySym)); + XkbKeySymsPtr(xkb, key), nOldSyms * sizeof(CARD32)); if ((needed - nOldSyms) > 0) bzero(&xkb->map->syms[xkb->map->num_syms + XkbKeyNumSyms(xkb, key)], - (needed - nOldSyms) * sizeof(KeySym)); + (needed - nOldSyms) * sizeof(CARD32)); xkb->map->key_sym_map[key].offset = xkb->map->num_syms; xkb->map->num_syms += needed; @@ -545,7 +545,7 @@ XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed) } xkb->map->size_syms += (needed > 32 ? needed : 32); - newSyms = _XkbTypedCalloc(xkb->map->size_syms, KeySym); + newSyms = _XkbTypedCalloc(xkb->map->size_syms, CARD32); if (!newSyms) return NULL; @@ -562,9 +562,9 @@ XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed) nKeySyms = needed; if (nCopy != 0) memcpy(&newSyms[nSyms], XkbKeySymsPtr(xkb, i), - nCopy * sizeof(KeySym)); + nCopy * sizeof(CARD32)); if (nKeySyms > nCopy) - bzero(&newSyms[nSyms+nCopy], (nKeySyms - nCopy) * sizeof(KeySym)); + bzero(&newSyms[nSyms+nCopy], (nKeySyms - nCopy) * sizeof(CARD32)); xkb->map->key_sym_map[i].offset = nSyms; nSyms += nKeySyms; @@ -878,7 +878,7 @@ XkbcResizeKeyActions(XkbcDescPtr xkb, int key, int needed) void XkbcFreeClientMap(XkbcDescPtr xkb, unsigned what, Bool freeMap) { - XkbClientMapPtr map; + XkbcClientMapPtr map; if (!xkb || !xkb->map) return; diff --git a/src/misc.c b/src/misc.c index e49921a..d568fc8 100644 --- a/src/misc.c +++ b/src/misc.c @@ -86,7 +86,7 @@ static XkbKeyTypeRec canonicalTypes[XkbNumRequiredTypes] = { int XkbcInitCanonicalKeyTypes(XkbcDescPtr xkb, unsigned which, int keypadVMod) { - XkbClientMapPtr map; + XkbcClientMapPtr map; XkbKeyTypePtr from,to; int rtrn; @@ -190,7 +190,7 @@ XkbcEnsureSafeMapName(char *name) } unsigned -_XkbcKSCheckCase(KeySym ks) +_XkbcKSCheckCase(CARD32 ks) { unsigned set = (ks & (~0xff)) >> 8; unsigned rtrn = 0; diff --git a/src/text.c b/src/text.c index 0c641a5..b6318e3 100644 --- a/src/text.c +++ b/src/text.c @@ -60,7 +60,7 @@ char * XkbcVModIndexText(XkbcDescPtr xkb, unsigned ndx) { int len; - Atom *vmodNames; + CARD32 *vmodNames; char *rtrn, *tmp = NULL; if (xkb && xkb->names) @@ -280,7 +280,7 @@ XkbcActionTypeText(unsigned type) } char * -XkbcKeysymText(KeySym sym) +XkbcKeysymText(CARD32 sym) { return XkbcKeysymToString(sym); } diff --git a/src/xkballoc.h b/src/xkballoc.h index 3d28843..0decf87 100644 --- a/src/xkballoc.h +++ b/src/xkballoc.h @@ -82,7 +82,7 @@ extern int XkbcResizeKeyType(XkbcDescPtr xkb, int type_ndx, int map_count, Bool want_preserve, int new_num_lvls); -extern KeySym * +extern CARD32 * XkbcResizeKeySyms(XkbcDescPtr xkb, int key, int needed); extern int diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c index 1a0f8d3..6d67d08 100644 --- a/src/xkbcomp/expr.c +++ b/src/xkbcomp/expr.c @@ -1049,7 +1049,7 @@ ExprResolveKeySym(ExprDef * expr, IdentLookupFunc lookup, char * lookupPriv) { int ok = 0; - KeySym sym; + CARD32 sym; if (expr->op == ExprIdent) { diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c index b15fc3e..dec9893 100644 --- a/src/xkbcomp/keytypes.c +++ b/src/xkbcomp/keytypes.c @@ -1180,12 +1180,12 @@ CopyDefToKeyType(XkbcDescPtr xkb, XkbKeyTypePtr type, KeyTypeInfo * def) type->name = (Atom) def->name; if (def->szNames > 0) { - type->level_names = uTypedCalloc(def->numLevels, Atom); + type->level_names = uTypedCalloc(def->numLevels, CARD32); /* assert def->szNames<=def->numLevels */ for (i = 0; i < def->szNames; i++) { - type->level_names[i] = (Atom) def->lvlNames[i]; + type->level_names[i] = (CARD32) def->lvlNames[i]; } } else diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c index a847f6c..73766d5 100644 --- a/src/xkbcomp/misc.c +++ b/src/xkbcomp/misc.c @@ -258,8 +258,8 @@ AddCommonInfo(CommonInfo * old, CommonInfo * new) typedef struct _KeyNameDesc { - KeySym level1; - KeySym level2; + CARD32 level1; + CARD32 level2; char name[5]; Bool used; } KeyNameDesc; @@ -379,7 +379,7 @@ ComputeKbdDefaults(XkbcDescPtr xkb) int rtrn; register int i, tmp, nUnknown; KeyNameDesc *name; - KeySym *syms; + uint32_t *syms; if ((xkb->names == NULL) || (xkb->names->keys == NULL)) { diff --git a/src/xkbcomp/parseutils.c b/src/xkbcomp/parseutils.c index 9f6c0e4..cea1572 100644 --- a/src/xkbcomp/parseutils.c +++ b/src/xkbcomp/parseutils.c @@ -219,7 +219,7 @@ BoolVarCreate(Atom nameToken, unsigned set) } InterpDef * -InterpCreate(KeySym sym, ExprDef * match) +InterpCreate(CARD32 sym, ExprDef * match) { InterpDef *def; @@ -621,9 +621,9 @@ AppendKeysymList(ExprDef * list, char *sym) } int -LookupKeysym(char *str, KeySym * sym_rtrn) +LookupKeysym(char *str, CARD32 * sym_rtrn) { - KeySym sym; + CARD32 sym; if ((!str) || (uStrCaseCmp(str, "any") == 0) || (uStrCaseCmp(str, "nosymbol") == 0)) diff --git a/src/xkbcomp/parseutils.h b/src/xkbcomp/parseutils.h index 0fecb42..9bc0a6b 100644 --- a/src/xkbcomp/parseutils.h +++ b/src/xkbcomp/parseutils.h @@ -88,7 +88,7 @@ extern VarDef *BoolVarCreate(Atom /* nameToken */ , unsigned /* set */ ); -extern InterpDef *InterpCreate(KeySym /* sym */ , +extern InterpDef *InterpCreate(CARD32 /* sym */ , ExprDef * /* match */ ); @@ -165,7 +165,7 @@ extern ExprDef *AppendKeysymList(ExprDef * /* list */ , ); extern int LookupKeysym(char * /* str */ , - KeySym * /* sym_rtrn */ + CARD32 * /* sym_rtrn */ ); extern IncludeStmt *IncludeCreate(char * /* str */ , diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index ce97a6f..db64977 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -70,7 +70,7 @@ typedef struct _KeyInfo unsigned char symsDefined; unsigned char actsDefined; short numLevels[XkbNumKbdGroups]; - KeySym *syms[XkbNumKbdGroups]; + CARD32 *syms[XkbNumKbdGroups]; XkbcAction *acts[XkbNumKbdGroups]; Atom types[XkbNumKbdGroups]; unsigned repeat; @@ -178,7 +178,7 @@ CopyKeyInfo(KeyInfo * old, KeyInfo * new, Bool clearOld) width = new->numLevels[i]; if (old->syms[i] != NULL) { - new->syms[i] = uTypedCalloc(width, KeySym); + new->syms[i] = uTypedCalloc(width, CARD32); if (!new->syms[i]) { new->syms[i] = NULL; @@ -186,7 +186,7 @@ CopyKeyInfo(KeyInfo * old, KeyInfo * new, Bool clearOld) return False; } memcpy((char *) new->syms[i], (char *) old->syms[i], - width * sizeof(KeySym)); + width * sizeof(CARD32)); } if (old->acts[i] != NULL) { @@ -214,7 +214,7 @@ typedef struct _ModMapEntry union { unsigned long keyName; - KeySym keySym; + CARD32 keySym; } u; } ModMapEntry; @@ -315,7 +315,7 @@ ResizeKeyGroup(KeyInfo * key, { key->syms[group] = uTypedRecalloc(key->syms[group], key->numLevels[group], newWidth, - KeySym); + CARD32); if (!key->syms[group]) return False; } @@ -336,7 +336,7 @@ static Bool MergeKeyGroups(SymbolsInfo * info, KeyInfo * into, KeyInfo * from, unsigned group) { - KeySym *resultSyms; + CARD32 *resultSyms; XkbcAction *resultActs; int resultWidth; register int i; @@ -359,7 +359,7 @@ MergeKeyGroups(SymbolsInfo * info, } if (resultSyms == NULL) { - resultSyms = uTypedCalloc(resultWidth, KeySym); + resultSyms = uTypedCalloc(resultWidth, CARD32); if (!resultSyms) { WSGO("Could not allocate symbols for group merge\n"); @@ -381,7 +381,7 @@ MergeKeyGroups(SymbolsInfo * info, } for (i = 0; i < resultWidth; i++) { - KeySym fromSym, toSym; + CARD32 fromSym, toSym; if (from->syms[group] && (i < from->numLevels[group])) fromSym = from->syms[group][i]; else @@ -396,7 +396,7 @@ MergeKeyGroups(SymbolsInfo * info, resultSyms[i] = fromSym; else { - KeySym use, ignore; + CARD32 use, ignore; if (clobber) { use = fromSym; @@ -1565,7 +1565,7 @@ SetExplicitGroup(SymbolsInfo * info, KeyInfo * key) key->numLevels[i] = 0; if (key->syms[i] != NULL) uFree(key->syms[i]); - key->syms[i] = (KeySym *) NULL; + key->syms[i] = (CARD32 *) NULL; if (key->acts[i] != NULL) uFree(key->acts[i]); key->acts[i] = (XkbcAction *) NULL; @@ -1577,7 +1577,7 @@ SetExplicitGroup(SymbolsInfo * info, KeyInfo * key) key->numLevels[group] = key->numLevels[0]; key->numLevels[0] = 0; key->syms[group] = key->syms[0]; - key->syms[0] = (KeySym *) NULL; + key->syms[0] = (CARD32 *) NULL; key->acts[group] = key->acts[0]; key->acts[0] = (XkbcAction *) NULL; key->types[group] = key->types[0]; @@ -1720,7 +1720,7 @@ HandleSymbolsFile(XkbFile * file, } static Bool -FindKeyForSymbol(XkbcDescPtr xkb, KeySym sym, unsigned int *kc_rtrn) +FindKeyForSymbol(XkbcDescPtr xkb, CARD32 sym, unsigned int *kc_rtrn) { register int i, j; register Bool gotOne; @@ -1791,7 +1791,7 @@ FindNamedType(XkbcDescPtr xkb, Atom name, unsigned *type_rtrn) * @returns True if a type could be found, False otherwise. */ static Bool -FindAutomaticType(int width, KeySym * syms, Atom * typeNameRtrn, +FindAutomaticType(int width, CARD32 * syms, Atom * typeNameRtrn, Bool * autoType) { *autoType = False; @@ -1885,11 +1885,11 @@ PrepareKeyDef(KeyInfo * key) } if ((key->symsDefined & 1) && key->syms[0]) { - key->syms[i] = uTypedCalloc(width, KeySym); + key->syms[i] = uTypedCalloc(width, CARD32); if (key->syms[i] == NULL) continue; memcpy((void *) key->syms[i], (void *) key->syms[0], - width * sizeof(KeySym)); + width * sizeof(CARD32)); key->symsDefined |= 1 << i; } if (defined & 1) @@ -1911,7 +1911,7 @@ PrepareKeyDef(KeyInfo * key) if ((key->syms[i] != key->syms[0]) && (key->syms[i] == NULL || key->syms[0] == NULL || memcmp((void *) key->syms[i], (void *) key->syms[0], - sizeof(KeySym) * key->numLevels[0]))) + sizeof(CARD32) * key->numLevels[0]))) { identical = False; break; @@ -1932,7 +1932,7 @@ PrepareKeyDef(KeyInfo * key) key->numLevels[i] = 0; if (key->syms[i] != NULL) uFree(key->syms[i]); - key->syms[i] = (KeySym *) NULL; + key->syms[i] = (CARD32 *) NULL; if (key->acts[i] != NULL) uFree(key->acts[i]); key->acts[i] = (XkbcAction *) NULL; @@ -1957,7 +1957,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from) unsigned okc, kc, width, tmp, nGroups; XkbKeyTypePtr type; Bool haveActions, autoType, useAlias; - KeySym *outSyms; + CARD32 *outSyms; XkbcAction *outActs; unsigned types[XkbNumKbdGroups]; diff --git a/src/xkbcomp/xkbcomp.h b/src/xkbcomp/xkbcomp.h index c120e24..d44f989 100644 --- a/src/xkbcomp/xkbcomp.h +++ b/src/xkbcomp/xkbcomp.h @@ -242,7 +242,7 @@ typedef struct _InterpDef { ParseCommon common; unsigned merge; - KeySym sym; + CARD32 sym; ExprDef *match; VarDef *def; } InterpDef; diff --git a/src/xkbmisc.h b/src/xkbmisc.h index 324a648..21c970d 100644 --- a/src/xkbmisc.h +++ b/src/xkbmisc.h @@ -52,7 +52,7 @@ extern void XkbcEnsureSafeMapName(char *name); extern unsigned -_XkbcKSCheckCase(KeySym sym); +_XkbcKSCheckCase(CARD32 sym); #define XkbcKSIsLower(k) (_XkbcKSCheckCase(k) & _XkbKSLower) #define XkbcKSIsUpper(k) (_XkbcKSCheckCase(k) & _XkbKSUpper) @@ -95,7 +95,7 @@ extern char * XkbcActionTypeText(unsigned type); extern char * -XkbcKeysymText(KeySym sym); +XkbcKeysymText(CARD32 sym); extern char * XkbcKeyNameText(char *name);