Commit c3a934d2 authored by Rusty Russell's avatar Rusty Russell

container_of: Make example compile cleanly with -Wunused

Make register_timer "use" my_timer_callback and its own args.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent a7b9ba00
......@@ -26,17 +26,19 @@
* struct timer timer;
* };
*
* static void register_timer(struct timer *timer)
* {
* //...
* }
*
* static void my_timer_callback(struct timer *timer)
* {
* struct info *info = container_of(timer, struct info, timer);
* printf("my_stuff is %u\n", info->my_stuff);
* }
*
* static void register_timer(struct timer *timer)
* {
* (void)timer;
* (void)my_timer_callback;
* //...
* }
*
* int main(void)
* {
* struct info info = { .my_stuff = 1 };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment