diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-12-02 12:05:46 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2015-01-13 13:43:29 +0000 |
commit | 6d86ae0824bdd6175dd3874688a871e981093888 (patch) | |
tree | dac6f0cd324f9adcc3485eccfb7f55b84b0f0747 /tests/test-coroutine.c | |
parent | ef57137f1b30545a477ab798d34a669b0abf5320 (diff) | |
download | qemu-6d86ae0824bdd6175dd3874688a871e981093888.tar.gz qemu-6d86ae0824bdd6175dd3874688a871e981093888.tar.bz2 qemu-6d86ae0824bdd6175dd3874688a871e981093888.zip |
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>
Diffstat (limited to 'tests/test-coroutine.c')
-rw-r--r-- | tests/test-coroutine.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c index e22fae170a..27d1b6f8e8 100644 --- a/tests/test-coroutine.c +++ b/tests/test-coroutine.c @@ -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) |