[libvirt] [PATCH] Fix unused parameters / functions in virsh on Win32

From: "Daniel P. Berrange" <berrange@redhat.com> The vshPrintRaw function is not used on Win32, and neither is the 'msg' parameter of vshAskReedit. Change the nesting of #ifdef WIN32 conditionals to address this --- tools/virsh.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 1b4f771..b84c4bc 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -655,6 +655,7 @@ vshReconnect(vshControl *ctl) ctl->useSnapshotOld = false; } +#ifndef WIN32 static void vshPrintRaw(vshControl *ctl, ...) { @@ -684,7 +685,6 @@ vshPrintRaw(vshControl *ctl, ...) static int vshAskReedit(vshControl *ctl, const char *msg) { -#ifndef WIN32 int c = -1; struct termios ttyattr; @@ -720,12 +720,16 @@ vshAskReedit(vshControl *ctl, const char *msg) vshPrint(ctl, "\r\n"); return c; +} #else +static int +vshAskReedit(vshControl *ctl, const char *msg ATTRIBUTE_UNUSED) +{ vshDebug(ctl, VSH_ERR_WARNING, "%s", _("This function is not " "supported on WIN32 platform")); return 0; -#endif } +#endif /* --------------- * Commands -- 1.7.10.2

On 06/21/2012 07:47 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The vshPrintRaw function is not used on Win32, and neither is the 'msg' parameter of vshAskReedit. Change the nesting of #ifdef WIN32 conditionals to address this --- tools/virsh.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
ACK. However,.
return c; +} #else +static int +vshAskReedit(vshControl *ctl, const char *msg ATTRIBUTE_UNUSED) +{ vshDebug(ctl, VSH_ERR_WARNING, "%s", _("This function is not " "supported on WIN32 platform")); return 0; -#endif } +#endif
now that these are starting to get further away from the #if, it might help to add a comment explaining what this #else and #endif pair to. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Daniel P. Berrange
-
Eric Blake