X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fasearch%2Fasearch.h;h=aae6eeda959acd9a18695f7f9707fa83c3170392;hb=d3981d63df15b369426fae97a8144ce24fbfa699;hp=84625d986d6adef3848dbcdcc71dfa3bfe826afb;hpb=d707abbb2ff707dd34aa77c9028f23f2266f8d5f;p=ccan diff --git a/ccan/asearch/asearch.h b/ccan/asearch/asearch.h index 84625d98..aae6eeda 100644 --- a/ccan/asearch/asearch.h +++ b/ccan/asearch/asearch.h @@ -1,3 +1,4 @@ +/* Licensed under LGPLv2.1+ - see LICENSE file for details */ #ifndef CCAN_ASEARCH_H #define CCAN_ASEARCH_H #include @@ -23,10 +24,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), &*(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)), \