From: Timo Kokkonen Date: Thu, 15 May 2008 17:32:39 +0000 (+0300) Subject: Add cast to suppress compile warnings on both 32 and 64 bit architectures X-Git-Url: http://git.itanic.dy.fi/?p=membench;a=commitdiff_plain;h=da6eaefac097f1722d9e875db53c043a38c148e8 Add cast to suppress compile warnings on both 32 and 64 bit architectures --- diff --git a/membench.c b/membench.c index aae4842..4aaa8b9 100644 --- a/membench.c +++ b/membench.c @@ -18,6 +18,9 @@ int main(int argc, char *argv[]) unsigned long *buf, i, tmp = 0; struct timeval start, end; + printf("Benchmark sequential access bandwidth " + "and random access latency\n\n"); + if (argc > 1) iterations = atoi(argv[1]); else @@ -32,7 +35,7 @@ int main(int argc, char *argv[]) printf("Doing %d runs with buffer size goin up to %dk\n", iterations, 1 << (iterations - 10)); printf("Running each round %d times\n", count); - printf("Size of unsigned long is %lu bits\n\n", lsize * 8); + printf("Size of unsigned long is %d bits\n\n", (int)lsize * 8); switch (lsize) { case 4: @@ -74,7 +77,7 @@ int main(int argc, char *argv[]) for (i = 0; i < size; i++) buf[i] = i; - printf("%8luk |", size * lsize / 1024); + printf("%8dk |", (int)(size * lsize / 1024)); /* Read bandwidth*/