compat: move some unclear code where it belongs
It seems like at some point it was needed to break the abstraction and perform this piece of code in the context above CompileCompatMap. The extra argument and the typedef look strange now, and doesn't seem to be needed any more, so move them back. Signed-off-by: Ran Benita <ran234@gmail.com>master
parent
213dcf686f
commit
7111eb8e8a
|
@ -779,12 +779,12 @@ CopyInterps(CompatInfo * info,
|
|||
}
|
||||
|
||||
bool
|
||||
CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge,
|
||||
LEDInfoPtr *unboundLEDs)
|
||||
CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge)
|
||||
{
|
||||
int i;
|
||||
CompatInfo info;
|
||||
GroupCompatInfo *gcm;
|
||||
LEDInfo *unbound = NULL, *next;
|
||||
|
||||
InitCompatInfo(&info, keymap);
|
||||
info.dflt.defs.merge = merge;
|
||||
|
@ -820,11 +820,21 @@ CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge
|
|||
}
|
||||
|
||||
if (info.leds != NULL) {
|
||||
if (!CopyIndicatorMapDefs(keymap, info.leds, unboundLEDs))
|
||||
if (!CopyIndicatorMapDefs(keymap, info.leds, &unbound))
|
||||
info.errorCount++;
|
||||
info.leds = NULL;
|
||||
}
|
||||
|
||||
if (!BindIndicators(keymap, true, unbound, NULL)) {
|
||||
while (unbound) {
|
||||
next = (LEDInfo *) unbound->defs.next;
|
||||
free(unbound);
|
||||
unbound = next;
|
||||
}
|
||||
|
||||
goto err_info;
|
||||
}
|
||||
|
||||
ClearCompatInfo(&info, keymap);
|
||||
return true;
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ CompileKeymap(struct xkb_context *ctx, XkbFile *file)
|
|||
bool ok;
|
||||
enum xkb_file_type mainType;
|
||||
const char *mainName;
|
||||
LEDInfo *unbound = NULL, *next;
|
||||
struct xkb_keymap *keymap = XkbcAllocKeyboard(ctx);
|
||||
struct {
|
||||
XkbFile *keycodes;
|
||||
|
@ -144,7 +143,7 @@ CompileKeymap(struct xkb_context *ctx, XkbFile *file)
|
|||
goto err;
|
||||
}
|
||||
if (sections.compat == NULL ||
|
||||
!CompileCompatMap(sections.compat, keymap, MERGE_OVERRIDE, &unbound))
|
||||
!CompileCompatMap(sections.compat, keymap, MERGE_OVERRIDE))
|
||||
{
|
||||
ERROR("Failed to compile compat map\n");
|
||||
goto err;
|
||||
|
@ -156,10 +155,6 @@ CompileKeymap(struct xkb_context *ctx, XkbFile *file)
|
|||
goto err;
|
||||
}
|
||||
|
||||
ok = BindIndicators(keymap, true, unbound, NULL);
|
||||
if (!ok)
|
||||
goto err;
|
||||
|
||||
ok = UpdateModifiersFromCompat(keymap);
|
||||
if (!ok)
|
||||
goto err;
|
||||
|
@ -169,10 +164,5 @@ CompileKeymap(struct xkb_context *ctx, XkbFile *file)
|
|||
err:
|
||||
ACTION("Failed to compile keymap\n");
|
||||
xkb_map_unref(keymap);
|
||||
while (unbound) {
|
||||
next = (LEDInfo *) unbound->defs.next;
|
||||
free(unbound);
|
||||
unbound = next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -258,11 +258,9 @@ extern bool
|
|||
CompileKeyTypes(XkbFile *file, struct xkb_keymap *keymap,
|
||||
enum merge_mode merge);
|
||||
|
||||
typedef struct _LEDInfo *LEDInfoPtr;
|
||||
|
||||
extern bool
|
||||
CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap,
|
||||
enum merge_mode merge, LEDInfoPtr *unboundLEDs);
|
||||
enum merge_mode merge);
|
||||
|
||||
extern bool
|
||||
CompileSymbols(XkbFile *file, struct xkb_keymap *keymap,
|
||||
|
|
Loading…
Reference in New Issue