From 919b97d6e573eb794d7819f1af8da29023d6b193 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 31 Oct 2012 22:01:59 +1030 Subject: [PATCH] tlist: remove unused var warning in example. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- ccan/tlist/tlist.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ccan/tlist/tlist.h b/ccan/tlist/tlist.h index 1ce0b85e..937a834c 100644 --- a/ccan/tlist/tlist.h +++ b/ccan/tlist/tlist.h @@ -185,6 +185,8 @@ * 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)) \ @@ -202,6 +204,8 @@ * 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)) \ -- 2.39.2