Skip to content

Commit

Permalink
Use explicit casting in cuckoocache's compute_hashes(...) to clarify …
Browse files Browse the repository at this point in the history
…integer conversion
  • Loading branch information
practicalswift committed Mar 26, 2018
1 parent 0a01843 commit 9142dfe
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/cuckoocache.h
Expand Up @@ -242,14 +242,14 @@ class cache
*/
inline std::array<uint32_t, 8> compute_hashes(const Element& e) const
{
return {{(uint32_t)((hash_function.template operator()<0>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<1>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<2>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<3>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<4>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<5>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<6>(e) * (uint64_t)size) >> 32),
(uint32_t)((hash_function.template operator()<7>(e) * (uint64_t)size) >> 32)}};
return {{(uint32_t)(((uint64_t)hash_function.template operator()<0>(e) * (uint64_t)size) >> 32),
(uint32_t)(((uint64_t)hash_function.template operator()<1>(e) * (uint64_t)size) >> 32),
(uint32_t)(((uint64_t)hash_function.template operator()<2>(e) * (uint64_t)size) >> 32),
(uint32_t)(((uint64_t)hash_function.template operator()<3>(e) * (uint64_t)size) >> 32),
(uint32_t)(((uint64_t)hash_function.template operator()<4>(e) * (uint64_t)size) >> 32),
(uint32_t)(((uint64_t)hash_function.template operator()<5>(e) * (uint64_t)size) >> 32),
(uint32_t)(((uint64_t)hash_function.template operator()<6>(e) * (uint64_t)size) >> 32),
(uint32_t)(((uint64_t)hash_function.template operator()<7>(e) * (uint64_t)size) >> 32)}};
}

/* end
Expand Down

0 comments on commit 9142dfe

Please sign in to comment.