diff options
author | Kyle Altendorf <sda@fstab.net> | 2019-09-18 11:57:01 -0400 |
---|---|---|
committer | Kyle Altendorf <sda@fstab.net> | 2019-09-18 11:57:02 -0400 |
commit | 5a8b62a6f8dab82c3bf8b8b1812da0857fb893e6 (patch) | |
tree | 7432da0b30d4bdb60f88c5d821743490b1283ae7 /siphash.c | |
parent | Merge pull request #17 from altendky/format_specifiers (diff) | |
download | siphash-5a8b62a6f8dab82c3bf8b8b1812da0857fb893e6.tar.gz siphash-5a8b62a6f8dab82c3bf8b8b1812da0857fb893e6.tar.xz |
Use size_t and fixed width format specifiers for printf()... for siphash.c
It was forgotten in #17 to apply this to siphash.c as well as halfsiphash.c. Note
that as-is this does change to a single 16-hex-char string for v0/1/2/3 in debug
output rather than having 8 then a space then 8. If preferred it can be changed
back to having the space and using `PRIx32` twice instead of `PRIx64` once.
Diffstat (limited to 'siphash.c')
-rw-r--r-- | siphash.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -15,6 +15,7 @@ <http://creativecommons.org/publicdomain/zero/1.0/>. */ #include <assert.h> +#include <inttypes.h> #include <stdint.h> #include <stdio.h> #include <string.h> @@ -66,14 +67,10 @@ #ifdef DEBUG #define TRACE \ do { \ - printf("(%3d) v0 %08x %08x\n", (int)inlen, (uint32_t)(v0 >> 32), \ - (uint32_t)v0); \ - printf("(%3d) v1 %08x %08x\n", (int)inlen, (uint32_t)(v1 >> 32), \ - (uint32_t)v1); \ - printf("(%3d) v2 %08x %08x\n", (int)inlen, (uint32_t)(v2 >> 32), \ - (uint32_t)v2); \ - printf("(%3d) v3 %08x %08x\n", (int)inlen, (uint32_t)(v3 >> 32), \ - (uint32_t)v3); \ + printf("(%3zu) v0 %016"PRIx64"\n", inlen, v0); \ + printf("(%3zu) v1 %016"PRIx64"\n", inlen, v1); \ + printf("(%3zu) v2 %016"PRIx64"\n", inlen, v2); \ + printf("(%3zu) v3 %016"PRIx64"\n", inlen, v3); \ } while (0) #else #define TRACE |