X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fasearch%2Fasearch.h;h=d252284e7d845b19070921868dbdbf45adabb60b;hp=8e317b47cf4d110a88d57815e7cce83bc18fb5fe;hb=d0842865ca94a1bf4f7cdad329a2a0fc5d01b53a;hpb=b1c867121f379d76dc7fb7d99bae77e2b7d99841;ds=sidebyside diff --git a/ccan/asearch/asearch.h b/ccan/asearch/asearch.h index 8e317b47..d252284e 100644 --- a/ccan/asearch/asearch.h +++ b/ccan/asearch/asearch.h @@ -3,7 +3,7 @@ #include #include -/* +/** * asearch - search an array of elements * @key: pointer to item being searched for * @base: pointer to data to sort @@ -23,10 +23,11 @@ #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), \ - 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)), \