From: Eric Blake Date: Thu, 3 May 2012 23:04:34 +0000 (-0600) Subject: qemu: avoid 32-bit compiler warning X-Git-Tag: v0.9.12-rc2~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdce2f42d;p=thirdparty%2Flibvirt.git qemu: avoid 32-bit compiler warning On 32-bit platforms, gcc warns that the comparison between a long and (ULLONG_MAX/1024/1024) is always false; throwing in a type conversion shuts up the warning. * src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Shut gcc up. --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index ca1c7aa910..0d4319da86 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2785,7 +2785,7 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon, modern); /* Convert bandwidth MiB to bytes */ - if (bandwidth > ULLONG_MAX / 1024 / 1024) { + if (bandwidth * 1ULL > ULLONG_MAX / 1024 / 1024) { qemuReportError(VIR_ERR_OVERFLOW, _("bandwidth must be less than %llu"), ULLONG_MAX / 1024 / 1024);