From 08aabc7f8ca560b64f74b5652ee9bab02b586b60 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 3 Apr 2016 02:39:25 +0200 Subject: [PATCH] improve print_hex() prototype --- src/headers/tomcrypt_misc.h | 2 +- testprof/tomcrypt_test.h | 2 +- testprof/x86_prof.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index d538077..2f670cc 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -95,7 +95,7 @@ int crc32_test(void); /* yeah it's not exactly in misc in the library, but in testprof/x86_prof.c */ #if defined(LTC_TEST) && defined(LTC_TEST_DBG) -void print_hex(const char* what, const unsigned char* p, const unsigned long l); +void print_hex(const char* what, const void* p, const unsigned long l); #endif /* $Source$ */ diff --git a/testprof/tomcrypt_test.h b/testprof/tomcrypt_test.h index f6951fc..abb5fc8 100644 --- a/testprof/tomcrypt_test.h +++ b/testprof/tomcrypt_test.h @@ -80,7 +80,7 @@ extern int no_results; extern const struct ltc_prng_descriptor no_prng_desc; #endif -void print_hex(const char* what, const unsigned char* p, const unsigned long l); +void print_hex(const char* what, const void* v, const unsigned long l); int sorter(const void *a, const void *b); void tally_results(int type); ulong64 rdtsc (void); diff --git a/testprof/x86_prof.c b/testprof/x86_prof.c index ba12db2..baf03d2 100644 --- a/testprof/x86_prof.c +++ b/testprof/x86_prof.c @@ -2,8 +2,9 @@ prng_state yarrow_prng; -void print_hex(const char* what, const unsigned char* p, const unsigned long l) +void print_hex(const char* what, const void* v, const unsigned long l) { + const unsigned char* p = v; unsigned long x; fprintf(stderr, "%s contents: \n", what); for (x = 0; x < l; ) {