From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvlHh-0005iH-PO for qemu-devel@nongnu.org; Tue, 02 Dec 2014 06:06:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvlHa-0003kt-8w for qemu-devel@nongnu.org; Tue, 02 Dec 2014 06:06:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvlHa-0003km-2e for qemu-devel@nongnu.org; Tue, 02 Dec 2014 06:06:14 -0500 From: Paolo Bonzini Date: Tue, 2 Dec 2014 12:05:46 +0100 Message-Id: <1417518350-6167-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1417518350-6167-1-git-send-email-pbonzini@redhat.com> References: <1417518350-6167-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v2 3/7] test-coroutine: avoid overflow on 32-bit systems List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, ming.lei@canonical.com, pl@kamp.de, stefanha@redhat.com unsigned long is not large enough to represent 1000000000 * duration there. Just use floating point. Signed-off-by: Paolo Bonzini --- tests/test-coroutine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-coroutine.c b/tests/test-coroutine.c index e22fae1..27d1b6f 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) -- 2.1.0