Fix fileID mess

A few problems here:
* In e.g. keycodes.c the fileID field of the Info struct was never
  initialized to the id of the appropriate file, so it was always 0.
  There's some code which uses it, mostly for warnings.
* Some of the fileID fields were unsigned char, which overflows several
  times, seeing as the ID in some of our tests can get > 1000 (because
  we reuse the context).
* Some sign mismatches.
* fileID vs file_id.

Hopefully this fixes everything. I doubt this stuff had ever worked as
intended, in xkbcomp or otherwise.

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2012-07-14 15:19:12 +03:00
parent 70683f7deb
commit 43bf4136c9
10 changed files with 70 additions and 76 deletions

View File

@ -37,7 +37,7 @@ struct xkb_context {
darray(char *) includes;
/* xkbcomp needs to assign sequential IDs to XkbFile's it creates. */
int file_id;
unsigned file_id;
struct atom_table *atom_table;
};
@ -144,7 +144,7 @@ xkb_context_include_path_get(struct xkb_context *ctx, unsigned int idx)
return darray_item(ctx->includes, idx);
}
int
unsigned
xkb_context_take_file_id(struct xkb_context *ctx)
{
return ctx->file_id++;

View File

@ -453,7 +453,7 @@ xkb_map_new_from_kccgst(struct xkb_context *ctx,
const struct xkb_component_names *kccgst,
enum xkb_map_compile_flags flags);
extern int
extern unsigned
xkb_context_take_file_id(struct xkb_context *ctx);
bool

View File

@ -32,7 +32,7 @@ HandleCollision(AliasInfo * old, AliasInfo * new)
{
if (strncmp(new->real, old->real, XkbKeyNameLength) == 0)
{
if (((new->def.fileID == old->def.fileID) && (warningLevel > 0)) ||
if (((new->def.file_id == old->def.file_id) && (warningLevel > 0)) ||
(warningLevel > 9))
{
WARN("Alias of %s for %s declared more than once\n",
@ -53,7 +53,7 @@ HandleCollision(AliasInfo * old, AliasInfo * new)
use = new->real;
ignore = old->real;
}
if (((old->def.fileID == new->def.fileID) && (warningLevel > 0)) ||
if (((old->def.file_id == new->def.file_id) && (warningLevel > 0)) ||
(warningLevel > 9))
{
WARN("Multiple definitions for alias %s\n",
@ -64,7 +64,7 @@ HandleCollision(AliasInfo * old, AliasInfo * new)
if (use != old->real)
memcpy(old->real, use, XkbKeyNameLength);
}
old->def.fileID = new->def.fileID;
old->def.file_id = new->def.file_id;
old->def.merge = new->def.merge;
}
@ -74,7 +74,7 @@ InitAliasInfo(AliasInfo * info,
{
memset(info, 0, sizeof(AliasInfo));
info->def.merge = merge;
info->def.fileID = file_id;
info->def.file_id = file_id;
strncpy(info->alias, alias, XkbKeyNameLength);
strncpy(info->real, real, XkbKeyNameLength);
}
@ -101,7 +101,7 @@ HandleAliasDef(KeyAliasDef * def,
WSGO("Allocation failure in HandleAliasDef\n");
return false;
}
info->def.fileID = file_id;
info->def.file_id = file_id;
info->def.merge = merge;
info->def.next = (CommonInfo *) * info_in;
memcpy(info->alias, def->alias, XkbKeyNameLength);
@ -140,7 +140,7 @@ MergeAliases(AliasInfo ** into, AliasInfo ** merge, unsigned how_merge)
def.merge = how_merge;
memcpy(def.alias, tmp->alias, XkbKeyNameLength);
memcpy(def.real, tmp->real, XkbKeyNameLength);
if (!HandleAliasDef(&def, def.merge, tmp->def.fileID, into))
if (!HandleAliasDef(&def, def.merge, tmp->def.file_id, into))
return false;
}
return true;

View File

@ -44,7 +44,7 @@ typedef struct _SymInterpInfo
typedef struct _GroupCompatInfo
{
unsigned char fileID;
unsigned file_id;
unsigned char merge;
bool defined;
unsigned char real_mods;
@ -54,7 +54,7 @@ typedef struct _GroupCompatInfo
typedef struct _CompatInfo
{
char *name;
unsigned fileID;
unsigned file_id;
int errorCount;
int nInterps;
SymInterpInfo *interps;
@ -96,18 +96,18 @@ siText(SymInterpInfo * si, CompatInfo * info)
}
static void
InitCompatInfo(CompatInfo *info, struct xkb_keymap *keymap)
InitCompatInfo(CompatInfo *info, struct xkb_keymap *keymap, unsigned file_id)
{
unsigned int i;
info->keymap = keymap;
info->name = NULL;
info->fileID = 0;
info->file_id = file_id;
info->errorCount = 0;
info->nInterps = 0;
info->interps = NULL;
info->act = NULL;
info->dflt.defs.fileID = info->fileID;
info->dflt.defs.file_id = file_id;
info->dflt.defs.defined = 0;
info->dflt.defs.merge = MERGE_OVERRIDE;
info->dflt.interp.flags = 0;
@ -116,7 +116,7 @@ InitCompatInfo(CompatInfo *info, struct xkb_keymap *keymap)
for (i = 0; i < sizeof(info->dflt.interp.act.any.data); i++)
info->dflt.interp.act.any.data[i] = 0;
ClearIndicatorMapInfo(keymap->ctx, &info->ledDflt);
info->ledDflt.defs.fileID = info->fileID;
info->ledDflt.defs.file_id = file_id;
info->ledDflt.defs.defined = 0;
info->ledDflt.defs.merge = MERGE_OVERRIDE;
memset(&info->groupCompat[0], 0,
@ -200,7 +200,7 @@ AddInterp(CompatInfo * info, SymInterpInfo * new)
if (new->defs.merge == MERGE_REPLACE)
{
SymInterpInfo *next = (SymInterpInfo *) old->defs.next;
if (((old->defs.fileID == new->defs.fileID)
if (((old->defs.file_id == new->defs.file_id)
&& (warningLevel > 0)) || (warningLevel > 9))
{
WARN("Multiple definitions for \"%s\"\n", siText(new, info));
@ -266,7 +266,7 @@ AddGroupCompat(CompatInfo * info, unsigned group, GroupCompatInfo * newGC)
{
return true;
}
if (((gc->fileID == newGC->fileID) && (warningLevel > 0))
if (((gc->file_id == newGC->file_id) && (warningLevel > 0))
|| (warningLevel > 9))
{
WARN("Compat map for group %d redefined\n", group + 1);
@ -407,12 +407,9 @@ HandleIncludeCompatMap(IncludeStmt *stmt, struct xkb_keymap *keymap,
else if (ProcessIncludeFile(keymap->ctx, stmt, FILE_TYPE_COMPAT, &rtrn,
&newMerge))
{
InitCompatInfo(&included, keymap);
included.fileID = rtrn->id;
InitCompatInfo(&included, keymap, rtrn->id);
included.dflt = info->dflt;
included.dflt.defs.fileID = rtrn->id;
included.dflt.defs.merge = newMerge;
included.ledDflt.defs.fileID = rtrn->id;
included.ledDflt.defs.merge = newMerge;
included.act = info->act;
HandleCompatMapFile(rtrn, keymap, MERGE_OVERRIDE, &included);
@ -448,12 +445,12 @@ HandleIncludeCompatMap(IncludeStmt *stmt, struct xkb_keymap *keymap,
else if (ProcessIncludeFile(keymap->ctx, next, FILE_TYPE_COMPAT,
&rtrn, &op))
{
InitCompatInfo(&next_incl, keymap);
next_incl.fileID = rtrn->id;
InitCompatInfo(&next_incl, keymap, rtrn->id);
next_incl.file_id = rtrn->id;
next_incl.dflt = info->dflt;
next_incl.dflt.defs.fileID = rtrn->id;
next_incl.dflt.defs.file_id = rtrn->id;
next_incl.dflt.defs.merge = op;
next_incl.ledDflt.defs.fileID = rtrn->id;
next_incl.ledDflt.defs.file_id = rtrn->id;
next_incl.ledDflt.defs.merge = op;
next_incl.act = info->act;
HandleCompatMapFile(rtrn, keymap, MERGE_OVERRIDE, &next_incl);
@ -678,7 +675,7 @@ HandleGroupCompatDef(GroupCompatDef *def, struct xkb_keymap *keymap,
def->group);
return false;
}
tmp.fileID = info->fileID;
tmp.file_id = info->file_id;
tmp.merge = merge;
if (!ExprResolveVModMask(def->def, &val, keymap))
{
@ -785,7 +782,7 @@ CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge
CompatInfo info;
GroupCompatInfo *gcm;
InitCompatInfo(&info, keymap);
InitCompatInfo(&info, keymap, file->id);
info.dflt.defs.merge = merge;
info.ledDflt.defs.merge = merge;
@ -817,7 +814,7 @@ CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge
}
for (i = 0, gcm = &info.groupCompat[0]; i < XkbNumKbdGroups; i++, gcm++) {
if ((gcm->fileID != 0) || (gcm->real_mods != 0) || (gcm->vmods != 0)) {
if ((gcm->file_id != 0) || (gcm->real_mods != 0) || (gcm->vmods != 0)) {
keymap->compat->groups[i].mask = gcm->real_mods;
keymap->compat->groups[i].real_mods = gcm->real_mods;
keymap->compat->groups[i].vmods = gcm->vmods;

View File

@ -74,7 +74,7 @@ AddIndicatorMap(struct xkb_keymap *keymap, LEDInfo *oldLEDs, LEDInfo *new)
if (new->defs.merge == MERGE_REPLACE)
{
CommonInfo *next = old->defs.next;
if (((old->defs.fileID == new->defs.fileID)
if (((old->defs.file_id == new->defs.file_id)
&& (warningLevel > 0)) || (warningLevel > 9))
{
WARN("Map for indicator %s redefined\n",

View File

@ -63,7 +63,7 @@ typedef struct _KeyNamesInfo
{
char *name; /* e.g. evdev+aliases(qwerty) */
int errorCount;
unsigned fileID;
unsigned file_id;
enum merge_mode merge;
xkb_keycode_t computedMin; /* lowest keycode stored */
xkb_keycode_t computedMax; /* highest keycode stored */
@ -93,7 +93,7 @@ InitIndicatorNameInfo(IndicatorNameInfo * ii, KeyNamesInfo * info)
{
ii->defs.defined = 0;
ii->defs.merge = info->merge;
ii->defs.fileID = info->fileID;
ii->defs.file_id = info->file_id;
ii->defs.next = NULL;
ii->ndx = 0;
ii->name = XKB_ATOM_NONE;
@ -163,7 +163,7 @@ AddIndicatorName(KeyNamesInfo *info, struct xkb_keymap *keymap, enum merge_mode
old = FindIndicatorByName(info, new->name);
if (old)
{
if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
if (((old->defs.file_id == new->defs.file_id) && (warningLevel > 0))
|| (warningLevel > 9))
{
WARN("Multiple indicators named %s\n",
@ -216,7 +216,7 @@ AddIndicatorName(KeyNamesInfo *info, struct xkb_keymap *keymap, enum merge_mode
old = FindIndicatorByIndex(info, new->ndx);
if (old)
{
if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
if (((old->defs.file_id == new->defs.file_id) && (warningLevel > 0))
|| (warningLevel > 9))
{
WARN("Multiple names for indicator %d\n", new->ndx);
@ -286,11 +286,12 @@ ClearKeyNamesInfo(KeyNamesInfo * info)
}
static void
InitKeyNamesInfo(KeyNamesInfo * info)
InitKeyNamesInfo(KeyNamesInfo * info, unsigned file_id)
{
info->name = NULL;
info->leds = NULL;
info->aliases = NULL;
info->file_id = file_id;
darray_init(info->names);
darray_init(info->files);
ClearKeyNamesInfo(info);
@ -316,8 +317,8 @@ FindKeyByLong(KeyNamesInfo * info, unsigned long name)
*/
static bool
AddKeyName(KeyNamesInfo * info,
xkb_keycode_t kc,
char *name, enum merge_mode merge, unsigned fileID, bool reportCollisions)
xkb_keycode_t kc, char *name, enum merge_mode merge,
unsigned file_id, bool reportCollisions)
{
xkb_keycode_t old;
unsigned long lval;
@ -334,7 +335,7 @@ AddKeyName(KeyNamesInfo * info,
{
reportCollisions = (warningLevel > 7 ||
(warningLevel > 0 &&
fileID == darray_item(info->files, kc)));
file_id == darray_item(info->files, kc)));
}
if (darray_item(info->names, kc) != 0)
@ -394,7 +395,7 @@ AddKeyName(KeyNamesInfo * info,
}
}
darray_item(info->names, kc) = lval;
darray_item(info->files, kc) = fileID;
darray_item(info->files, kc) = file_id;
return true;
}
@ -426,7 +427,7 @@ MergeIncludedKeycodes(KeyNamesInfo *into, struct xkb_keymap *keymap,
continue;
LongToKeyName(darray_item(from->names, i), buf);
buf[4] = '\0';
if (!AddKeyName(into, i, buf, merge, from->fileID, false))
if (!AddKeyName(into, i, buf, merge, from->file_id, false))
into->errorCount++;
}
if (from->leds)
@ -492,7 +493,7 @@ HandleIncludeKeycodes(IncludeStmt *stmt, struct xkb_keymap *keymap,
else if (ProcessIncludeFile(keymap->ctx, stmt, FILE_TYPE_KEYCODES, &rtrn,
&newMerge))
{
InitKeyNamesInfo(&included);
InitKeyNamesInfo(&included, rtrn->id);
HandleKeycodesFile(rtrn, keymap, MERGE_OVERRIDE, &included);
if (stmt->stmt != NULL)
{
@ -525,7 +526,7 @@ HandleIncludeKeycodes(IncludeStmt *stmt, struct xkb_keymap *keymap,
else if (ProcessIncludeFile(keymap->ctx, next, FILE_TYPE_KEYCODES,
&rtrn, &op))
{
InitKeyNamesInfo(&next_incl);
InitKeyNamesInfo(&next_incl, rtrn->id);
HandleKeycodesFile(rtrn, keymap, MERGE_OVERRIDE, &next_incl);
MergeIncludedKeycodes(&included, keymap, &next_incl, op);
ClearKeyNamesInfo(&next_incl);
@ -572,7 +573,7 @@ HandleKeycodeDef(KeycodeDef *stmt, enum merge_mode merge, KeyNamesInfo *info)
else
merge = stmt->merge;
}
return AddKeyName(info, stmt->value, stmt->name, merge, info->fileID,
return AddKeyName(info, stmt->value, stmt->name, merge, info->file_id,
true);
}
@ -745,7 +746,7 @@ HandleKeycodesFile(XkbFile *file, struct xkb_keymap *keymap,
info->errorCount++;
break;
case StmtKeyAliasDef: /* e.g. alias <MENU> = <COMP>; */
if (!HandleAliasDef((KeyAliasDef *) stmt, merge, info->fileID,
if (!HandleAliasDef((KeyAliasDef *) stmt, merge, info->file_id,
&info->aliases))
info->errorCount++;
break;
@ -799,7 +800,7 @@ CompileKeycodes(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge)
{
KeyNamesInfo info; /* contains all the info after parsing */
InitKeyNamesInfo(&info);
InitKeyNamesInfo(&info, file->id);
HandleKeycodesFile(file, keymap, merge, &info);

View File

@ -48,7 +48,7 @@ typedef struct _KeyTypeInfo
{
CommonInfo defs;
xkb_atom_t name;
int fileID;
unsigned file_id;
unsigned mask;
unsigned vmask;
bool groupInfo;
@ -62,7 +62,7 @@ typedef struct _KeyTypesInfo
{
char *name;
int errorCount;
int fileID;
unsigned file_id;
unsigned stdPresent;
unsigned nTypes;
KeyTypeInfo *types;
@ -99,7 +99,7 @@ static xkb_atom_t tok_KEYPAD;
static void
InitKeyTypesInfo(KeyTypesInfo *info, struct xkb_keymap *keymap,
KeyTypesInfo *from)
KeyTypesInfo *from, unsigned file_id)
{
tok_ONE_LEVEL = xkb_atom_intern(keymap->ctx, "ONE_LEVEL");
tok_TWO_LEVEL = xkb_atom_intern(keymap->ctx, "TWO_LEVEL");
@ -110,8 +110,9 @@ InitKeyTypesInfo(KeyTypesInfo *info, struct xkb_keymap *keymap,
info->stdPresent = 0;
info->nTypes = 0;
info->types = NULL;
info->file_id = file_id;
info->dflt.defs.defined = 0;
info->dflt.defs.fileID = 0;
info->dflt.defs.file_id = file_id;
info->dflt.defs.merge = MERGE_OVERRIDE;
info->dflt.defs.next = NULL;
info->dflt.name = XKB_ATOM_NONE;
@ -190,7 +191,7 @@ NextKeyType(KeyTypesInfo * info)
if (type != NULL)
{
memset(type, 0, sizeof(KeyTypeInfo));
type->defs.fileID = info->fileID;
type->defs.file_id = info->file_id;
info->types = AddCommonInfo(&info->types->defs, &type->defs);
info->nTypes++;
}
@ -262,7 +263,7 @@ AddKeyType(struct xkb_keymap *keymap, KeyTypesInfo *info, KeyTypeInfo *new)
|| (new->defs.merge == MERGE_OVERRIDE))
{
KeyTypeInfo *next = (KeyTypeInfo *) old->defs.next;
if (((old->defs.fileID == new->defs.fileID)
if (((old->defs.file_id == new->defs.file_id)
&& (warningLevel > 0)) || (warningLevel > 9))
{
WARN("Multiple definitions of the %s key type\n",
@ -277,7 +278,7 @@ AddKeyType(struct xkb_keymap *keymap, KeyTypesInfo *info, KeyTypeInfo *new)
old->defs.next = &next->defs;
return true;
}
report = (old->defs.fileID == new->defs.fileID) && (warningLevel > 0);
report = (old->defs.file_id == new->defs.file_id) && (warningLevel > 0);
if (report)
{
WARN("Multiple definitions of the %s key type\n",
@ -349,8 +350,7 @@ HandleIncludeKeyTypes(IncludeStmt *stmt, struct xkb_keymap *keymap,
else if (ProcessIncludeFile(keymap->ctx, stmt, FILE_TYPE_TYPES, &rtrn,
&newMerge))
{
InitKeyTypesInfo(&included, keymap, info);
included.fileID = included.dflt.defs.fileID = rtrn->id;
InitKeyTypesInfo(&included, keymap, info, rtrn->id);
included.dflt.defs.merge = newMerge;
HandleKeyTypesFile(rtrn, keymap, newMerge, &included);
@ -384,8 +384,7 @@ HandleIncludeKeyTypes(IncludeStmt *stmt, struct xkb_keymap *keymap,
else if (ProcessIncludeFile(keymap->ctx, next, FILE_TYPE_TYPES,
&rtrn, &op))
{
InitKeyTypesInfo(&next_incl, keymap, &included);
next_incl.fileID = next_incl.dflt.defs.fileID = rtrn->id;
InitKeyTypesInfo(&next_incl, keymap, &included, rtrn->id);
next_incl.dflt.defs.merge = op;
HandleKeyTypesFile(rtrn, keymap, op, &next_incl);
MergeIncludedKeyTypes(&included, &next_incl, op, keymap);
@ -857,7 +856,7 @@ HandleKeyTypeDef(KeyTypeDef *def, struct xkb_keymap *keymap,
merge = def->merge;
type.defs.defined = 0;
type.defs.fileID = info->fileID;
type.defs.file_id = info->file_id;
type.defs.merge = merge;
type.defs.next = NULL;
type.name = def->name;
@ -1218,8 +1217,7 @@ CompileKeyTypes(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge)
KeyTypesInfo info;
KeyTypeInfo *def;
InitKeyTypesInfo(&info, keymap, NULL);
info.fileID = file->id;
InitKeyTypesInfo(&info, keymap, NULL, file->id);
HandleKeyTypesFile(file, keymap, merge, &info);

View File

@ -164,7 +164,7 @@ UseNewField(unsigned field,
{
if (newDefs->defined & field)
{
if (((oldDefs->fileID == newDefs->fileID)
if (((oldDefs->file_id == newDefs->file_id)
&& (warningLevel > 0)) || (warningLevel > 9))
{
*pCollide |= field;

View File

@ -90,13 +90,13 @@ typedef struct _KeyInfo
* Init the given key info to sane values.
*/
static void
InitKeyInfo(KeyInfo * info)
InitKeyInfo(KeyInfo * info, unsigned file_id)
{
int i;
static const char dflt[4] = "*";
info->defs.defined = 0;
info->defs.fileID = 0;
info->defs.file_id = file_id;
info->defs.merge = MERGE_OVERRIDE;
info->defs.next = NULL;
info->name = KeyNameToLong(dflt);
@ -127,7 +127,7 @@ FreeKeyInfo(KeyInfo * info)
int i;
info->defs.defined = 0;
info->defs.fileID = 0;
info->defs.file_id = 0;
info->defs.merge = MERGE_OVERRIDE;
info->defs.next = NULL;
info->groupInfo = 0;
@ -200,7 +200,7 @@ typedef struct _SymbolsInfo
{
char *name; /* e.g. pc+us+inet(evdev) */
int errorCount;
unsigned fileID;
unsigned file_id;
enum merge_mode merge;
unsigned explicit_group;
darray(KeyInfo) keys;
@ -214,21 +214,22 @@ typedef struct _SymbolsInfo
} SymbolsInfo;
static void
InitSymbolsInfo(SymbolsInfo * info, struct xkb_keymap *keymap)
InitSymbolsInfo(SymbolsInfo * info, struct xkb_keymap *keymap,
unsigned file_id)
{
int i;
info->name = NULL;
info->explicit_group = 0;
info->errorCount = 0;
info->fileID = 0;
info->file_id = file_id;
info->merge = MERGE_OVERRIDE;
darray_init(info->keys);
darray_growalloc(info->keys, 110);
info->modMap = NULL;
for (i = 0; i < XkbNumKbdGroups; i++)
info->groupNames[i] = XKB_ATOM_NONE;
InitKeyInfo(&info->dflt);
InitKeyInfo(&info->dflt, file_id);
InitVModInfo(&info->vmods, keymap);
info->action = NULL;
info->aliases = NULL;
@ -303,7 +304,7 @@ MergeKeyGroups(SymbolsInfo * info,
clobber = (from->defs.merge != MERGE_AUGMENT);
report = (warningLevel > 9) ||
((into->defs.fileID == from->defs.fileID) && (warningLevel > 0));
((into->defs.file_id == from->defs.file_id) && (warningLevel > 0));
darray_init(resultSyms);
@ -533,7 +534,7 @@ MergeKeys(SymbolsInfo *info, struct xkb_keymap *keymap,
return true;
}
report = ((warningLevel > 9) ||
((into->defs.fileID == from->defs.fileID)
((into->defs.file_id == from->defs.file_id)
&& (warningLevel > 0)));
for (i = 0; i < XkbNumKbdGroups; i++)
{
@ -809,8 +810,7 @@ HandleIncludeSymbols(IncludeStmt *stmt, struct xkb_keymap *keymap,
else if (ProcessIncludeFile(keymap->ctx, stmt, FILE_TYPE_SYMBOLS, &rtrn,
&newMerge))
{
InitSymbolsInfo(&included, keymap);
included.fileID = included.dflt.defs.fileID = rtrn->id;
InitSymbolsInfo(&included, keymap, rtrn->id);
included.merge = included.dflt.defs.merge = MERGE_OVERRIDE;
if (stmt->modifier)
{
@ -851,8 +851,7 @@ HandleIncludeSymbols(IncludeStmt *stmt, struct xkb_keymap *keymap,
else if (ProcessIncludeFile(keymap->ctx, next, FILE_TYPE_SYMBOLS,
&rtrn, &op))
{
InitSymbolsInfo(&next_incl, keymap);
next_incl.fileID = next_incl.dflt.defs.fileID = rtrn->id;
InitSymbolsInfo(&next_incl, keymap, rtrn->id);
next_incl.merge = next_incl.dflt.defs.merge = MERGE_OVERRIDE;
if (next->modifier)
{
@ -1433,7 +1432,7 @@ HandleSymbolsDef(SymbolsDef *stmt, struct xkb_keymap *keymap,
{
KeyInfo key;
InitKeyInfo(&key);
InitKeyInfo(&key, info->file_id);
CopyKeyInfo(&info->dflt, &key, false);
key.defs.merge = stmt->merge;
key.name = KeyNameToLong(stmt->keyName);
@ -2086,8 +2085,7 @@ CompileSymbols(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge)
SymbolsInfo info;
KeyInfo *key;
InitSymbolsInfo(&info, keymap);
info.dflt.defs.fileID = file->id;
InitSymbolsInfo(&info, keymap, file->id);
info.dflt.defs.merge = merge;
HandleSymbolsFile(file, keymap, merge, &info);

View File

@ -35,7 +35,7 @@
typedef struct _CommonInfo
{
unsigned short defined;
unsigned char fileID;
unsigned file_id;
unsigned char merge;
struct _CommonInfo *next;
} CommonInfo;