Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
test: Fix 64-bit type and printf format issues
Browse files Browse the repository at this point in the history
Signed-off-by: Pekka Enberg <penberg@iki.fi>
  • Loading branch information
penberg committed Jan 8, 2014
1 parent 05ad61f commit 5a7d0c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions test/mips/main.cpp
Expand Up @@ -15,6 +15,7 @@

#include <libcpu.h>
#include "arch/mips/mips_interface.h"
#include <inttypes.h>
//////////////////////////////////////////////////////////////////////
// command line parsing helpers
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -131,7 +132,7 @@ main(int argc, char **argv)
cpu_t *cpu;
uint8_t *RAM;
FILE *f;
int ramsize;
unsigned long ramsize;
char *stack;
int i;
#ifdef BENCHMARK_FIB
Expand Down Expand Up @@ -309,7 +310,7 @@ main(int argc, char **argv)
printf("done!\n");

printf("%d -- %d\n", r1, r2);
printf("%lld -- %lld\n", t2-t1, t4-t3);
printf("%" PRIu64 " -- %" PRIu64 "\n", t2-t1, t4-t3);
printf("%f%%\n", (float)(t2-t1)/(float)(t4-t3));
#endif
#endif
Expand Down
5 changes: 3 additions & 2 deletions test/multi/fib.cpp
Expand Up @@ -8,6 +8,7 @@
#include <libcpu.h>
#include "arch/arm/arm_types.h"
#include "arch/m88k/m88k_isa.h"
#include <inttypes.h>

#define RET_MAGIC 0x4D495354

Expand Down Expand Up @@ -165,8 +166,8 @@ main(int argc, char **argv)

cpu_free(cpu);

printf("Time GUEST: %lld\n", t2-t1);
printf("Time HOST: %lld\n", t4-t3);
printf("Time GUEST: %" PRIu64 "\n", t2-t1);
printf("Time HOST: %" PRIu64 "\n", t4-t3);
printf("Result HOST: %d\n", r2);
printf("Result GUEST: %d\n", r1);
printf("GUEST required \033[1m%.2f%%\033[22m of HOST time.\n", (float)(t2-t1)/(float)(t4-t3)*100);
Expand Down

0 comments on commit 5a7d0c9

Please sign in to comment.