mirror of
https://github.com/qemu/qemu.git
synced 2024-11-23 19:03:38 +08:00
test-coroutine: avoid overflow on 32-bit systems
unsigned long is not large enough to represent 1000000000 * duration there. Just use floating point. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1417518350-6167-4-git-send-email-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
ef57137f1b
commit
6d86ae0824
@ -337,7 +337,7 @@ static void perf_cost(void)
|
||||
"%luns per coroutine",
|
||||
maxcycles,
|
||||
duration, ops,
|
||||
(unsigned long)(1000000000 * duration) / maxcycles);
|
||||
(unsigned long)(1000000000.0 * duration / maxcycles));
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
Loading…
Reference in New Issue
Block a user