summaryrefslogtreecommitdiff
path: root/cpp/src/slice2objc/Gen.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-07-06 12:33:45 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-07-06 12:33:45 +0200
commit7f966c4a79be77372cae36c6f8113d6c871b5202 (patch)
tree0d17b1705ee2eb936dfe9bdc84b7f004f21a566c /cpp/src/slice2objc/Gen.cpp
parentFixed ICE-8211 - IceGrid registry inconsistency when resolving dynamically re... (diff)
downloadice-7f966c4a79be77372cae36c6f8113d6c871b5202.tar.bz2
ice-7f966c4a79be77372cae36c6f8113d6c871b5202.tar.xz
ice-7f966c4a79be77372cae36c6f8113d6c871b5202.zip
Fixed ICE-8232 - Objective-C hashing for float/double
Diffstat (limited to 'cpp/src/slice2objc/Gen.cpp')
-rw-r--r--cpp/src/slice2objc/Gen.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp
index 6e34a182f54..c2ff2e2bca9 100644
--- a/cpp/src/slice2objc/Gen.cpp
+++ b/cpp/src/slice2objc/Gen.cpp
@@ -2075,18 +2075,10 @@ Slice::Gen::TypesVisitor::writeMemberHashCode(const DataMemberList& dataMembers,
break;
}
case Builtin::KindFloat:
- {
- _M << sb;
- _M << nl << "uint32_t bits_ = *(uint32_t*)&" << name << ";";
- _M << nl << "h_ = ((h_ << 5) + h_) ^ (uint)bits_;";
- _M << eb;
- break;
- }
case Builtin::KindDouble:
{
_M << sb;
- _M << nl << "uint64_t bits_ = *(uint64_t*)&" << name << ";";
- _M << nl << "h_ = ((h_ << 5) + h_) ^ (uint)(bits_ ^ (bits_ >> 32));";
+ _M << nl << "h_ = ((h_ << 5) + h_) ^ [@(" << name << ") hash];";
_M << eb;
break;
}