Skip to content

Commit

Permalink
Merge pull request #52 from Cyan4973/dev
Browse files Browse the repository at this point in the history
extra static assert, as suggested by @t-mat
  • Loading branch information
Cyan4973 committed Jan 14, 2016
2 parents 4ab1e57 + 84e6218 commit fec956e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xxhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit fec956e

Please sign in to comment.