container_of: Make example compile cleanly with -Wunused
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 6 Nov 2016 04:38:17 +0000 (15:08 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 6 Nov 2016 05:24:06 +0000 (15:54 +1030)
Make register_timer "use" my_timer_callback and its own args.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/container_of/_info

index d50094bc68ec1ef077182028c0d045923160562f..b1160522edd4fcfd52935d39227d3d19653149ec 100644 (file)
  *             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 };