Skip to content
Snippets Groups Projects
Commit 6d86ae08 authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Stefan Hajnoczi
Browse files

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: default avatarPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: default avatarFam Zheng <famz@redhat.com>
Message-id: 1417518350-6167-4-git-send-email-pbonzini@redhat.com
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent ef57137f
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment