vnc: avoid write only variables
Compiling with GCC 4.6.0 20100925 produced warnings: /src/qemu/ui/vnc.c: In function 'vnc_client_cache_auth': /src/qemu/ui/vnc.c:217:12: error: variable 'qdict' set but not used [-Werror=unused-but-set-variable] /src/qemu/ui/vnc.c: In function 'vnc_display_open': /src/qemu/ui/vnc.c:2526:9: error: variable 'acl' set but not used [-Werror=unused-but-set-variable] Fix by making the variable declarations and their uses also conditional to debug definition. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
03e654c083
commit
2ded6ad761
8
ui/vnc.c
8
ui/vnc.c
@ -214,13 +214,17 @@ static int vnc_server_info_put(QDict *qdict)
|
|||||||
|
|
||||||
static void vnc_client_cache_auth(VncState *client)
|
static void vnc_client_cache_auth(VncState *client)
|
||||||
{
|
{
|
||||||
|
#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
|
||||||
QDict *qdict;
|
QDict *qdict;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!client->info) {
|
if (!client->info) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
|
||||||
qdict = qobject_to_qdict(client->info);
|
qdict = qobject_to_qdict(client->info);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_VNC_TLS
|
#ifdef CONFIG_VNC_TLS
|
||||||
if (client->tls.session &&
|
if (client->tls.session &&
|
||||||
@ -2523,7 +2527,9 @@ int vnc_display_open(DisplayState *ds, const char *display)
|
|||||||
int sasl = 0;
|
int sasl = 0;
|
||||||
int saslErr;
|
int saslErr;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
|
||||||
int acl = 0;
|
int acl = 0;
|
||||||
|
#endif
|
||||||
int lock_key_sync = 1;
|
int lock_key_sync = 1;
|
||||||
|
|
||||||
if (!vnc_display)
|
if (!vnc_display)
|
||||||
@ -2581,8 +2587,10 @@ int vnc_display_open(DisplayState *ds, const char *display)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
|
||||||
} else if (strncmp(options, "acl", 3) == 0) {
|
} else if (strncmp(options, "acl", 3) == 0) {
|
||||||
acl = 1;
|
acl = 1;
|
||||||
|
#endif
|
||||||
} else if (strncmp(options, "lossy", 5) == 0) {
|
} else if (strncmp(options, "lossy", 5) == 0) {
|
||||||
vs->lossy = true;
|
vs->lossy = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user