]> git.ozlabs.org Git - ccan/blob - ccan/typesafe_cb/test/compile_ok-typesafe_cb_cast.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / typesafe_cb / test / compile_ok-typesafe_cb_cast.c
1 #include <ccan/typesafe_cb/typesafe_cb.h>
2 #include <stdlib.h>
3
4 struct foo {
5         int x;
6 };
7
8 struct bar {
9         int x;
10 };
11
12 struct baz {
13         int x;
14 };
15
16 struct any {
17         int x;
18 };
19
20 static void take_any(struct any *any)
21 {
22         (void)any;
23 }
24
25 int main(void)
26 {
27         /* Otherwise we get unused warnings for these. */
28         struct foo *foo = NULL;
29         struct bar *bar = NULL;
30         struct baz *baz = NULL;
31
32         take_any(typesafe_cb_cast3(struct any *,
33                                    struct foo *, struct bar *, struct baz *,
34                                    foo));
35         take_any(typesafe_cb_cast3(struct any *, 
36                                    struct foo *, struct bar *, struct baz *,
37                                    bar));
38         take_any(typesafe_cb_cast3(struct any *, 
39                                    struct foo *, struct bar *, struct baz *,
40                                    baz));
41         return 0;
42 }