tdb2: rename the tools to tdb2torture, tdb2tool and mktdb2
[ccan] / ccan / asearch / asearch.h
index 84625d986d6adef3848dbcdcc71dfa3bfe826afb..d252284e7d845b19070921868dbdbf45adabb60b 100644 (file)
 #if HAVE_TYPEOF
 #define asearch(key, base, num, cmp)                                   \
        ((__typeof__(*(base))*)(bsearch((key), (base), (num), sizeof(*(base)), \
-               cast_if_type(int (*)(const void *, const void *),       \
-                            (cmp), &*(cmp),                            \
-                            int (*)(const __typeof__(*(key)) *,        \
-                                    const __typeof__(*(base)) *)))))
+               typesafe_cb_cast(int (*)(const void *, const void *),   \
+                                int (*)(const __typeof__(*(key)) *,    \
+                                        const __typeof__(*(base)) *),  \
+                                (cmp)))))
+
 #else
 #define asearch(key, base, num, cmp)                           \
        (bsearch((key), (base), (num), sizeof(*(base)),         \