From 84e6218cd5bc501f7e79b36274383bf97957e830 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 14 Jan 2016 15:20:08 +0100 Subject: [PATCH] extra static assert, as suggested by @t-mat --- xxhash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xxhash.c b/xxhash.c index 02e47b0..35f5315 100644 --- a/xxhash.c +++ b/xxhash.c @@ -988,12 +988,14 @@ XXH_PUBLIC_API unsigned long long XXH64_digest (const XXH64_state_t* state_in) XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash) { + XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t)); if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash); memcpy(dst, &hash, sizeof(*dst)); } XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash) { + XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t)); if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash); memcpy(dst, &hash, sizeof(*dst)); }