Remove 'unboundRtrn' argument from BindIndicators It was only ever passed as NULL from its single callsite, so just remove it and be done with it. 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
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index b88623f..7cd88b5 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -825,7 +825,7 @@ CompileCompatMap(XkbFile *file, struct xkb_keymap *keymap, enum merge_mode merge
info.leds = NULL;
}
- if (!BindIndicators(keymap, unbound, NULL)) {
+ if (!BindIndicators(keymap, unbound)) {
while (unbound) {
next = (LEDInfo *) unbound->defs.next;
free(unbound);
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index 7c0f9b6..211a47c 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -433,7 +433,7 @@ CopyIndicatorMapDefs(struct xkb_keymap *keymap, LEDInfo *leds,
}
bool
-BindIndicators(struct xkb_keymap *keymap, LEDInfo *unbound, LEDInfo **unboundRtrn)
+BindIndicators(struct xkb_keymap *keymap, LEDInfo *unbound)
{
int i;
LEDInfo *led, *next, *last;
@@ -525,17 +525,12 @@ BindIndicators(struct xkb_keymap *keymap, LEDInfo *unbound, LEDInfo **unboundRtr
}
}
}
- if (unboundRtrn)
+
+ for (led = unbound; led != NULL; led = next)
{
- *unboundRtrn = unbound;
- }
- else
- {
- for (led = unbound; led != NULL; led = next)
- {
- next = led ? (LEDInfo *) led->defs.next : NULL;
- free(led);
- }
+ next = led ? (LEDInfo *) led->defs.next : NULL;
+ free(led);
}
+
return true;
}
diff --git a/src/xkbcomp/indicators.h b/src/xkbcomp/indicators.h
index 6d7f2b0..c46814f 100644
--- a/src/xkbcomp/indicators.h
+++ b/src/xkbcomp/indicators.h
@@ -73,7 +73,6 @@ CopyIndicatorMapDefs(struct xkb_keymap *keymap, LEDInfo *leds,
LEDInfo **unboundRtrn);
extern bool
-BindIndicators(struct xkb_keymap *keymap, LEDInfo *unbound,
- LEDInfo **unboundRtrn);
+BindIndicators(struct xkb_keymap *keymap, LEDInfo *unbound);
#endif /* INDICATORS_H */