From: Peter Maydell Date: Sat, 7 Jun 2014 16:48:03 +0000 (+0100) Subject: util/qemu-sockets.c: Avoid unused variable warnings X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~629^2~25^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=378c2c2d99368977470b65be6d7aadf3b35e6e5d;p=sdk%2Femulator%2Fqemu.git util/qemu-sockets.c: Avoid unused variable warnings The 'on' variable is never used, and 'off' is only used if IPV6_V6ONLY is defined; delete 'on' and move 'off' to the point where it is used. This avoids warnings from clang 3.4. Change-Id: Ia886bd9b95c0b019d5808834cf704bc97a3cd312 Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 43e48cab1e..18991c10a4 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -30,8 +30,6 @@ # define AI_ADDRCONFIG 0 #endif -static const int on=1, off=0; - /* used temporarily until all users are converted to QemuOpts */ QemuOptsList socket_optslist = { .name = "socket", @@ -159,6 +157,7 @@ int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp) #ifdef IPV6_V6ONLY if (e->ai_family == PF_INET6) { /* listen on both ipv4 and ipv6 */ + const int off = 0; qemu_setsockopt(slisten, IPPROTO_IPV6, IPV6_V6ONLY, &off, sizeof(off)); }