Remove 'unboundRtrn' argument from BindIndicators
authorDaniel Stone <daniel@fooishbar.org>
Tue, 3 Jul 2012 20:15:28 +0000 (21:15 +0100)
committerDaniel Stone <daniel@fooishbar.org>
Thu, 12 Jul 2012 08:42:27 +0000 (09:42 +0100)
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>
src/xkbcomp/compat.c
src/xkbcomp/indicators.c
src/xkbcomp/indicators.h

index b88623f..7cd88b5 100644 (file)
@@ -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);
index 7c0f9b6..211a47c 100644 (file)
@@ -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;
 }
index 6d7f2b0..c46814f 100644 (file)
@@ -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 */