Browse Source

improve print_hex() prototype

Steffen Jaeckel 9 years ago
parent
commit
08aabc7f8c
3 changed files with 4 additions and 3 deletions
  1. 1 1
      src/headers/tomcrypt_misc.h
  2. 1 1
      testprof/tomcrypt_test.h
  3. 2 1
      testprof/x86_prof.c

+ 1 - 1
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$ */

+ 1 - 1
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);

+ 2 - 1
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; ) {