From d38d16e113af3d8ee85fb199a589fcb38d972eed Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 3 Jul 2012 21:17:11 +0100 Subject: [PATCH] Change BindIndicators return to void Since it could only ever return true, which avoids a totally unnecessary cleanup path. Signed-off-by: Daniel Stone --- src/xkbcomp/compat.c | 12 ++---------- src/xkbcomp/indicators.c | 4 +--- src/xkbcomp/indicators.h | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) 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 */