Change BindIndicators return to void Since it could only ever return true, which avoids a totally unnecessary cleanup path. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 7cd88b5..5da98d7 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -784,7 +784,7 @@ CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge
int i;
CompatInfo info;
GroupCompatInfo *gcm;
- LEDInfo *unbound = NULL, *next;
+ LEDInfo *unbound = NULL;
InitCompatInfo(&info, keymap);
info.dflt.defs.merge = merge;
@@ -825,15 +825,7 @@ CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge
info.leds = NULL;
}
- if (!BindIndicators(keymap, unbound)) {
- while (unbound) {
- next = (LEDInfo *) unbound->defs.next;
- free(unbound);
- unbound = next;
- }
-
- goto err_info;
- }
+ BindIndicators(keymap, unbound);
ClearCompatInfo(&info, keymap);
return true;
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index 211a47c..f1daca9 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -432,7 +432,7 @@ CopyIndicatorMapDefs(struct xkb_keymap *keymap, LEDInfo *leds,
return true;
}
-bool
+void
BindIndicators(struct xkb_keymap *keymap, LEDInfo *unbound)
{
int i;
@@ -531,6 +531,4 @@ BindIndicators(struct xkb_keymap *keymap, LEDInfo *unbound)
next = led ? (LEDInfo *) led->defs.next : NULL;
free(led);
}
-
- return true;
}
diff --git a/src/xkbcomp/indicators.h b/src/xkbcomp/indicators.h
index c46814f..713d46c 100644
--- a/src/xkbcomp/indicators.h
+++ b/src/xkbcomp/indicators.h
@@ -72,7 +72,7 @@ extern bool
CopyIndicatorMapDefs(struct xkb_keymap *keymap, LEDInfo *leds,
LEDInfo **unboundRtrn);
-extern bool
+extern void
BindIndicators(struct xkb_keymap *keymap, LEDInfo *unbound);
#endif /* INDICATORS_H */