]> git.ozlabs.org Git - ccan/blobdiff - ccan/typesafe_cb/typesafe_cb.h
typesafe_cb: Fix warnings with gcc-4.5:
[ccan] / ccan / typesafe_cb / typesafe_cb.h
index e48741a9d15962650e267a61e1a87ed7cc4ef21c..7347b7b2912c20291bfbdd9adfdcbb430334c07c 100644 (file)
  *             _register_callback(typesafe_cb_def(void, (fn), (arg)), (arg))
  */
 #define typesafe_cb_def(rtype, fn, arg)                        \
-       cast_if_any(rtype (*)(void *), (fn), &*(fn),    \
+       cast_if_any(rtype (*)(void *), (fn), (fn)+0,    \
                    rtype (*)(typeof(*arg)*),           \
                    rtype (*)(const typeof(*arg)*),     \
                    rtype (*)(volatile typeof(*arg)*))
  *             _register_callback(typesafe_cb_exact(void, (fn), (arg)), (arg))
  */
 #define typesafe_cb_exact(rtype, fn, arg)                              \
-       cast_if_type(rtype (*)(void *), (fn), &*(fn), rtype (*)(typeof(arg)))
+       cast_if_type(rtype (*)(void *), (fn), (fn)+0, rtype (*)(typeof(arg)))
 
 /**
  * typesafe_cb_const - cast a const callback function if it matches the arg
  *                                (arg))
  */
 #define typesafe_cb_preargs(rtype, fn, arg, ...)                       \
-       cast_if_type(rtype (*)(__VA_ARGS__, void *), (fn), &*(fn),      \
+       cast_if_type(rtype (*)(__VA_ARGS__, void *), (fn), (fn)+0,      \
                     rtype (*)(__VA_ARGS__, typeof(arg)))
 
 /**
  *                                (arg))
  */
 #define typesafe_cb_postargs(rtype, fn, arg, ...)                      \
-       cast_if_type(rtype (*)(void *, __VA_ARGS__), (fn), &*(fn),      \
+       cast_if_type(rtype (*)(void *, __VA_ARGS__), (fn), (fn)+0,      \
                     rtype (*)(typeof(arg), __VA_ARGS__))
 
 /**
  *                       typesafe_cb_cmp(int, (cmpfn), (base)), (arg))
  */
 #define typesafe_cb_cmp(rtype, cmpfn, arg)                             \
-       cast_if_type(rtype (*)(const void *, const void *), (cmpfn), &*(cmpfn), \
+       cast_if_type(rtype (*)(const void *, const void *), (cmpfn), (cmpfn)+0, \
                     rtype (*)(const typeof(*arg)*, const typeof(*arg)*))
                     
 #endif /* CCAN_CAST_IF_TYPE_H */