]> git.ozlabs.org Git - ccan/blobdiff - ccan/container_of/_info
container_of: Make example compile cleanly with -Wunused
[ccan] / ccan / container_of / _info
index 77b3bd15fa5ada5101378a7305cda1d5a1675b37..b1160522edd4fcfd52935d39227d3d19653149ec 100644 (file)
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * container_of - routine for upcasting
  *             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 };