Change BindIndicators return to void
authorDaniel Stone <daniel@fooishbar.org>
Tue, 3 Jul 2012 20:17:11 +0000 (21:17 +0100)
committerDaniel Stone <daniel@fooishbar.org>
Thu, 12 Jul 2012 08:42:27 +0000 (09:42 +0100)
Since it could only ever return true, which avoids a totally unnecessary
cleanup path.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
src/xkbcomp/compat.c
src/xkbcomp/indicators.c
src/xkbcomp/indicators.h

index 7cd88b5..5da98d7 100644 (file)
@@ -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;
index 211a47c..f1daca9 100644 (file)
@@ -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;
 }
index c46814f..713d46c 100644 (file)
@@ -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 */