typesafe_cb: simplify, preserve namespace.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 6 Apr 2011 22:54:41 +0000 (08:24 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 6 Apr 2011 22:54:41 +0000 (08:24 +0930)
commitb0fa019adb998c20a8740f5696b61ae87d2a77a6
tree5a31f4193c4ed57f79564041d84bb45bd6831c06
parent076877c266706ba432987195422a1e8653bd0c3b
typesafe_cb: simplify, preserve namespace.

Get rid of many variants, which were just confusing for most people.
Keep typesafe_cb(), typesafe_cb_preargs() and typesafe_cb_postarts(),
and rework cast_if_type() into typesafe_cb_cast() so we stay in our
namespace.

I should have done this as soon as I discovered the limitation that
the types have to be defined if I want const-taking callbacks.
28 files changed:
ccan/antithread/antithread.h
ccan/asearch/asearch.h
ccan/asort/asort.h
ccan/opt/opt.h
ccan/sparse_bsearch/_info
ccan/sparse_bsearch/sparse_bsearch.h
ccan/talloc/talloc.h
ccan/tdb2/tdb2.h
ccan/typesafe_cb/_info
ccan/typesafe_cb/test/compile_fail-cast_if_any.c [deleted file]
ccan/typesafe_cb/test/compile_fail-cast_if_type-promotable.c
ccan/typesafe_cb/test/compile_fail-cast_if_type.c [deleted file]
ccan/typesafe_cb/test/compile_fail-typesafe_cb.c
ccan/typesafe_cb/test/compile_fail-typesafe_cb_cast-multi.c [new file with mode: 0644]
ccan/typesafe_cb/test/compile_fail-typesafe_cb_cast.c [new file with mode: 0644]
ccan/typesafe_cb/test/compile_fail-typesafe_cb_exact.c [deleted file]
ccan/typesafe_cb/test/compile_fail-typesafe_cb_postargs.c
ccan/typesafe_cb/test/compile_fail-typesafe_cb_preargs.c
ccan/typesafe_cb/test/compile_ok-cast_if_any.c [deleted file]
ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c
ccan/typesafe_cb/test/compile_ok-typesafe_cb-const.c [deleted file]
ccan/typesafe_cb/test/compile_ok-typesafe_cb-undefined.c
ccan/typesafe_cb/test/compile_ok-typesafe_cb-vars.c
ccan/typesafe_cb/test/compile_ok-typesafe_cb-volatile.c [deleted file]
ccan/typesafe_cb/test/compile_ok-typesafe_cb_cast.c [new file with mode: 0644]
ccan/typesafe_cb/test/compile_ok-typesafe_cb_def-const.c [deleted file]
ccan/typesafe_cb/test/run.c
ccan/typesafe_cb/typesafe_cb.h