From 2c8cf549571bbe0b245fc4f9680e1dbde39a015c Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Tue, 11 Jun 2013 15:42:44 +0400 Subject: vnc: use booleans for vnc_connect, vnc_listen_read and vnc_display_add_client Some arguments to these functions are booleans - either by declaration, or by actual usage, but sometimes value of 0 or 1 is passed for a bool, and sometimes it is declared as int but a bool value, or true/false, is passed to it instead. Clean it up a bit. Cc: liguang Signed-off-by: Michael Tokarev --- ui/vnc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ui') diff --git a/ui/vnc.c b/ui/vnc.c index dfc74591f4..5601cc34ef 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2771,7 +2771,8 @@ static void vnc_refresh(DisplayChangeListener *dcl) } } -static void vnc_connect(VncDisplay *vd, int csock, int skipauth, bool websocket) +static void vnc_connect(VncDisplay *vd, int csock, + bool skipauth, bool websocket) { VncState *vs = g_malloc0(sizeof(VncState)); int i; @@ -2883,19 +2884,19 @@ static void vnc_listen_read(void *opaque, bool websocket) } if (csock != -1) { - vnc_connect(vs, csock, 0, websocket); + vnc_connect(vs, csock, false, websocket); } } static void vnc_listen_regular_read(void *opaque) { - vnc_listen_read(opaque, 0); + vnc_listen_read(opaque, false); } #ifdef CONFIG_VNC_WS static void vnc_listen_websocket_read(void *opaque) { - vnc_listen_read(opaque, 1); + vnc_listen_read(opaque, true); } #endif /* CONFIG_VNC_WS */ @@ -3283,7 +3284,7 @@ void vnc_display_open(DisplayState *ds, const char *display, Error **errp) if (csock < 0) { goto fail; } - vnc_connect(vs, csock, 0, 0); + vnc_connect(vs, csock, false, false); } else { /* listen for connects */ char *dpy; @@ -3341,9 +3342,9 @@ fail: #endif /* CONFIG_VNC_WS */ } -void vnc_display_add_client(DisplayState *ds, int csock, int skipauth) +void vnc_display_add_client(DisplayState *ds, int csock, bool skipauth) { VncDisplay *vs = vnc_display; - vnc_connect(vs, csock, skipauth, 0); + vnc_connect(vs, csock, skipauth, false); } -- cgit v1.2.3