From e5b4da866899d8df510207c8e35722eee9ce48d8 Mon Sep 17 00:00:00 2001 From: cherierm Date: Tue, 13 Mar 2007 11:08:21 +0000 Subject: [PATCH] Cast to the proper pointer type to avoid some warnings git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3247 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- testsuite/xbt/heap_bench.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/testsuite/xbt/heap_bench.c b/testsuite/xbt/heap_bench.c index ca64029dc3..a18402bf46 100644 --- a/testsuite/xbt/heap_bench.c +++ b/testsuite/xbt/heap_bench.c @@ -13,6 +13,7 @@ #include #include +#include #include "xbt/heap.h" #include "gras/virtu.h" /* time manipulation in bench */ @@ -47,12 +48,13 @@ int compare_double(const void *a, const void *b) void test_heap_validity(int size) { xbt_heap_t heap = xbt_heap_new(size, NULL); - double *tab = calloc(size, sizeof(double)); + double *tab = (double*)calloc(size,sizeof(double)); + int i; for (i = 0; i < size; i++) { - tab[i] = (10.0 * rand() / (RAND_MAX + 1.0)); - xbt_heap_push(heap, NULL, tab[i]); + tab[i] = (double)(10.0 * rand() / (RAND_MAX + 1.0)); + xbt_heap_push(heap, NULL, (double)tab[i]); } qsort(tab, size, sizeof(double), compare_double); @@ -80,6 +82,7 @@ void test_heap_mean_operation(int size) date = gras_os_time() * 1000000; for (i = 0; i < size; i++) xbt_heap_push(heap, NULL, (10.0 * rand() / (RAND_MAX + 1.0))); + date = gras_os_time() * 1000000 - date; printf("Creation time %d size heap : %g\n", size, date); -- 2.20.1