aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>2019-09-19 19:10:29 -0400
committerGitHub <noreply@github.com>2019-09-19 19:10:29 -0400
commit42efb6c38424254b75e91b171214e2ead5515130 (patch)
tree0083f27ff7170630420cb0aed69950821076a566
parentMerge pull request #17 from altendky/format_specifiers (diff)
parentCorrect \ alignment (diff)
downloadsiphash-42efb6c38424254b75e91b171214e2ead5515130.tar.gz
siphash-42efb6c38424254b75e91b171214e2ead5515130.tar.xz
Merge pull request #21 from altendky/full_siphash_format_specifiers
Use size_t and fixed width format specifiers for printf()... for siphash.c
Diffstat (limited to '')
-rw-r--r--siphash.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/siphash.c b/siphash.c
index 78bdf9f..71d85de 100644
--- a/siphash.c
+++ b/siphash.c
@@ -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