tlist: remove unused var warning in example.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Oct 2012 11:31:59 +0000 (22:01 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Oct 2012 11:31:59 +0000 (22:01 +1030)
Compiler:
/home/rusty/devel/cvs/ccan/ccan/tlist/tlist.h: In function ‘main’:
/home/rusty/devel/cvs/ccan/ccan/tlist/tlist.h:186:15: warning: variable ‘first’ set but not used [-Wunused-but-set-variable]

Compiler:
/home/rusty/devel/cvs/ccan/ccan/tlist/tlist.h: In function ‘main’:
/home/rusty/devel/cvs/ccan/ccan/tlist/tlist.h:205:15: warning: variable ‘last’ set but not used [-Wunused-but-set-variable]

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

index 1ce0b85ed9f03c01333c8412c2d260541f8724cb..937a834c0184fb4d54928ca57db9668a929b1f8c 100644 (file)
  * Example:
  *     struct child *first;
  *     first = tlist_top(&parent->children, list);
+ *     if (!first)
+ *             printf("Empty list!\n");
  */
 #define tlist_top(h, member)                                           \
        ((tcon_type((h), canary))                                       \
  * Example:
  *     struct child *last;
  *     last = tlist_tail(&parent->children, list);
+ *     if (!last)
+ *             printf("Empty list!\n");
  */
 #define tlist_tail(h, member)                                          \
        ((tcon_type((h), canary))                                       \