]> git.itanic.dy.fi Git - membench/commitdiff
Add cast to suppress compile warnings on both 32 and 64 bit architectures
authorTimo Kokkonen <kaapeli@ee.oulu.fi>
Thu, 15 May 2008 17:32:39 +0000 (20:32 +0300)
committerTimo Kokkonen <kaapeli@ee.oulu.fi>
Thu, 15 May 2008 17:32:39 +0000 (20:32 +0300)
membench.c

index aae48425eb812ce24cabe4d3b46dd0a57c282e46..4aaa8b9745656e2726839a86b984cb6387969b7b 100644 (file)
@@ -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*/