typesafe_cb: fix up (and test!) cast_if_any.
[ccan] / ccan / typesafe_cb / typesafe_cb.h
index f5e416de2de26c0e65605c5ed923ce0177cf4c33..4aabecf53e1228bbe4d2dd3ce69b505bbfb84311 100644 (file)
@@ -61,7 +61,9 @@ __builtin_choose_expr(__builtin_types_compatible_p(typeof(1?(test):0), oktype),
        cast_if_type(desttype,                                          \
                     cast_if_type(desttype,                             \
                                  cast_if_type(desttype, (expr), (test), ok1), \
+                                 (test),                               \
                                  ok2),                                 \
+                    (test),                                            \
                     ok3)
 
 /**