Commit 3f69aa2b authored by Stefan Westerfeld's avatar Stefan Westerfeld

Use portable printf format for uint64_t.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 9fa4bf9e
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include "utils.hh" #include "utils.hh"
#include "random.hh" #include "random.hh"
#include <inttypes.h>
using std::vector; using std::vector;
using std::string; using std::string;
...@@ -28,7 +30,7 @@ main (int argc, char **argv) ...@@ -28,7 +30,7 @@ main (int argc, char **argv)
for (size_t i = 0; i < 20; i++) for (size_t i = 0; i < 20; i++)
{ {
uint64_t x = rng(); uint64_t x = rng();
printf ("%016lx\n", x); printf ("%016" PRIx64 "\n", x);
} }
uint64_t s = 0; uint64_t s = 0;
...@@ -39,7 +41,7 @@ main (int argc, char **argv) ...@@ -39,7 +41,7 @@ main (int argc, char **argv)
s += rng(); s += rng();
} }
double t_end = get_time(); double t_end = get_time();
printf ("s=%016lx\n\n", s); printf ("s=%016" PRIx64 "\n\n", s);
printf ("%f Mvalues/sec\n", runs / (t_end - t_start) / 1000000); printf ("%f Mvalues/sec\n", runs / (t_end - t_start) / 1000000);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment