[Cryptech-Commits] [sw/libhal] 01/06: fix printf warnings, fix time_check calculation

git at cryptech.is git at cryptech.is
Mon Nov 16 21:42:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/libhal.

commit 49ac8847de1120a4ae7b72747ee259bc0f5ffb3c
Author: Paul Selkirk <paul at psgd.org>
Date:   Thu Nov 12 22:56:32 2015 -0500

    fix printf warnings, fix time_check calculation
---
 tests/test-bus.c | 4 ++--
 utils/cores.c    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/test-bus.c b/tests/test-bus.c
index 3af4dc9..bffe5d3 100644
--- a/tests/test-bus.c
+++ b/tests/test-bus.c
@@ -80,7 +80,7 @@ static int sanity(void)
     }
 
     if (data != rnd) {
-        printf("Data bus fail: expected %08x, got %08x, diff %08x\n", rnd, data, data ^ rnd);
+        printf("Data bus fail: expected %08lx, got %08lx, diff %08lx\n", rnd, data, data ^ rnd);
         return 1;
     }
 
@@ -97,7 +97,7 @@ static void _time_check(char *label, const struct timeval t0, const int err)
   float rounds;
   gettimeofday(&t, NULL);
   t.tv_sec -= t0.tv_sec;
-  t.tv_usec = t0.tv_usec;
+  t.tv_usec -= t0.tv_usec;
   if (t.tv_usec < 0) {
     t.tv_usec += 1000000;
     t.tv_sec  -= 1;
diff --git a/utils/cores.c b/utils/cores.c
index a499e9e..da823a7 100644
--- a/utils/cores.c
+++ b/utils/cores.c
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
 	}
 
 	if (name[0] != 0)
-	    printf("%08x: %8s %4s\n", cores[i], name, version);
+	    printf("%08lx: %8s %4s\n", cores[i], name, version);
     }
 
     return 0;



More information about the Commits mailing list