vmod: Pass xkb_desc explicitly to vmod functions
Some error paths don't set info->xkb correctly, so just do like most utility functions and pass the xkb_desc explicitly. Signed-off-by: Daniel Stone <daniel@fooishbar.org>master
parent
4e22851141
commit
1a6c3807d6
|
@ -515,7 +515,7 @@ SetInterpField(SymInterpInfo * si,
|
|||
{
|
||||
if (arrayNdx != NULL)
|
||||
return ReportSINotArray(si, field, info);
|
||||
ok = ResolveVirtualModifier(value, &tmp, &info->vmods);
|
||||
ok = ResolveVirtualModifier(value, xkb, &tmp, &info->vmods);
|
||||
if (ok)
|
||||
{
|
||||
si->interp.virtual_mod = tmp.uval;
|
||||
|
@ -765,7 +765,7 @@ HandleCompatMapFile(XkbFile * file,
|
|||
info->errorCount++;
|
||||
break;
|
||||
case StmtVModDef:
|
||||
if (!HandleVModDef((VModDef *) stmt, merge, &info->vmods))
|
||||
if (!HandleVModDef((VModDef *) stmt, xkb, merge, &info->vmods))
|
||||
info->errorCount++;
|
||||
break;
|
||||
case StmtKeycodeDef:
|
||||
|
|
|
@ -1068,7 +1068,7 @@ HandleKeyTypesFile(XkbFile * file,
|
|||
info->errorCount++;
|
||||
break;
|
||||
case StmtVModDef: /* virtual_modifiers NumLock, ... */
|
||||
if (!HandleVModDef((VModDef *) stmt, merge, &info->vmods))
|
||||
if (!HandleVModDef((VModDef *) stmt, xkb, merge, &info->vmods))
|
||||
info->errorCount++;
|
||||
break;
|
||||
case StmtKeyAliasDef:
|
||||
|
|
|
@ -1683,7 +1683,7 @@ HandleSymbolsFile(XkbFile * file,
|
|||
info->errorCount++;
|
||||
break;
|
||||
case StmtVModDef:
|
||||
if (!HandleVModDef((VModDef *) stmt, merge, &info->vmods))
|
||||
if (!HandleVModDef((VModDef *) stmt, xkb, merge, &info->vmods))
|
||||
info->errorCount++;
|
||||
break;
|
||||
case StmtInterpDef:
|
||||
|
|
|
@ -79,15 +79,16 @@ ClearVModInfo(VModInfo * info, struct xkb_desc * xkb)
|
|||
* @param mergeMode Merge strategy (e.g. MergeOverride)
|
||||
*/
|
||||
Bool
|
||||
HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
|
||||
HandleVModDef(VModDef * stmt, struct xkb_desc *xkb, unsigned mergeMode,
|
||||
VModInfo * info)
|
||||
{
|
||||
register int i, bit, nextFree;
|
||||
ExprResult mod;
|
||||
struct xkb_server_map * srv;
|
||||
struct xkb_names * names;
|
||||
|
||||
srv = info->xkb->server;
|
||||
names = info->xkb->names;
|
||||
srv = xkb->server;
|
||||
names = xkb->names;
|
||||
for (i = 0, bit = 1, nextFree = -1; i < XkbNumVirtualMods; i++, bit <<= 1)
|
||||
{
|
||||
if (info->defined & bit)
|
||||
|
@ -228,11 +229,12 @@ FindKeypadVMod(struct xkb_desc * xkb)
|
|||
}
|
||||
|
||||
Bool
|
||||
ResolveVirtualModifier(ExprDef * def, ExprResult * val_rtrn, VModInfo * info)
|
||||
ResolveVirtualModifier(ExprDef * def, struct xkb_desc *xkb,
|
||||
ExprResult * val_rtrn, VModInfo * info)
|
||||
{
|
||||
struct xkb_names * names;
|
||||
|
||||
names = info->xkb->names;
|
||||
names = xkb->names;
|
||||
if (def->op == ExprIdent)
|
||||
{
|
||||
int i, bit;
|
||||
|
|
|
@ -45,6 +45,7 @@ extern void ClearVModInfo(VModInfo * /* info */ ,
|
|||
);
|
||||
|
||||
extern Bool HandleVModDef(VModDef * /* stmt */ ,
|
||||
struct xkb_desc * /* xkb */ ,
|
||||
unsigned /* mergeMode */ ,
|
||||
VModInfo * /* info */
|
||||
);
|
||||
|
@ -64,6 +65,7 @@ extern int FindKeypadVMod(struct xkb_desc * /* xkb */
|
|||
);
|
||||
|
||||
extern Bool ResolveVirtualModifier(ExprDef * /* def */ ,
|
||||
struct xkb_desc * /* xkb */ ,
|
||||
ExprResult * /* value_rtrn */ ,
|
||||
VModInfo * /* info */
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue