From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uomuo-0003hZ-HS for qemu-devel@nongnu.org; Mon, 17 Jun 2013 23:49:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uomun-0000xT-Mj for qemu-devel@nongnu.org; Mon, 17 Jun 2013 23:49:06 -0400 From: liguang Date: Tue, 18 Jun 2013 11:45:35 +0800 Message-Id: <1371527137-16949-3-git-send-email-lig.fnst@cn.fujitsu.com> In-Reply-To: <1371527137-16949-1-git-send-email-lig.fnst@cn.fujitsu.com> References: <1371527137-16949-1-git-send-email-lig.fnst@cn.fujitsu.com> Subject: [Qemu-devel] [PATCH v2 3/5] qemu-char: use bool in qemu_chr_open_socket List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Cc: liguang local variables is_* should be bool by usage, and last parameter of qemu_opt_get_bool is bool, so pass true/false for it. Signed-off-by: liguang --- qemu-char.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 2c3cfe6..0d695e0 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2679,16 +2679,16 @@ static CharDriverState *qemu_chr_open_socket(QemuOpts *opts) CharDriverState *chr = NULL; Error *local_err = NULL; int fd = -1; - int is_listen; - int is_waitconnect; - int do_nodelay; - int is_unix; - int is_telnet; - - is_listen = qemu_opt_get_bool(opts, "server", 0); - is_waitconnect = qemu_opt_get_bool(opts, "wait", 1); - is_telnet = qemu_opt_get_bool(opts, "telnet", 0); - do_nodelay = !qemu_opt_get_bool(opts, "delay", 1); + bool is_listen; + bool is_waitconnect; + bool do_nodelay; + bool is_unix; + bool is_telnet; + + is_listen = qemu_opt_get_bool(opts, "server", false); + is_waitconnect = qemu_opt_get_bool(opts, "wait", true); + is_telnet = qemu_opt_get_bool(opts, "telnet", false); + do_nodelay = !qemu_opt_get_bool(opts, "delay", true); is_unix = qemu_opt_get(opts, "path") != NULL; if (!is_listen) is_waitconnect = 0; -- 1.7.2.5