diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-09-13 10:28:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-13 10:28:29 -0700 |
commit | d669b5f960ad521d0371739bbf225829889b39f3 (patch) | |
tree | 3f5b2a1cc6af0b3137665f9fa50c9fb44bf752c1 /src | |
parent | 048bcadbc0fdc9866e70995984813551aa5681ea (diff) | |
download | binaryen-d669b5f960ad521d0371739bbf225829889b39f3.tar.gz binaryen-d669b5f960ad521d0371739bbf225829889b39f3.tar.bz2 binaryen-d669b5f960ad521d0371739bbf225829889b39f3.zip |
disambiguate hash usage (#1182)
Diffstat (limited to 'src')
-rw-r--r-- | src/literal.h | 4 | ||||
-rw-r--r-- | src/support/hash.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/literal.h b/src/literal.h index c55d645ad..55efbd31e 100644 --- a/src/literal.h +++ b/src/literal.h @@ -158,8 +158,8 @@ namespace std { template<> struct hash<wasm::Literal> { size_t operator()(const wasm::Literal& a) const { return wasm::rehash( - hash<size_t>()(size_t(a.type)), - hash<int64_t>()(a.getBits()) + uint64_t(hash<size_t>()(size_t(a.type))), + uint64_t(hash<int64_t>()(a.getBits())) ); } }; diff --git a/src/support/hash.h b/src/support/hash.h index 5ee3b8a3d..9edbdd2c7 100644 --- a/src/support/hash.h +++ b/src/support/hash.h @@ -35,7 +35,7 @@ inline uint32_t rehash(uint32_t x, uint32_t y) { // see http://www.cse.yorku.ca/ return hash; } -inline size_t rehash(uint64_t x, uint64_t y) { // see boost and https://stackoverflow.com/a/2595226/1176841 +inline uint64_t rehash(uint64_t x, uint64_t y) { // see boost and https://stackoverflow.com/a/2595226/1176841 return x ^ (y + 0x9e3779b9 + (x << 6) + (x >> 2)); } |