--- a/src/core/model/hash.cc Tue Nov 13 16:35:21 2012 -0800
+++ b/src/core/model/hash.cc Tue Nov 13 16:35:51 2012 -0800
@@ -42,11 +42,11 @@
NS_ASSERT (m_impl != 0);
}
-Hash *
+Hash &
Hash::clear (void)
{
m_impl->clear();
- return this;
+ return *this;
}
} // namespace ns3
--- a/src/core/model/hash.h Tue Nov 13 16:35:21 2012 -0800
+++ b/src/core/model/hash.h Tue Nov 13 16:35:51 2012 -0800
@@ -109,7 +109,7 @@
*
* \return this
*/
- Hash * clear (void);
+ Hash & clear (void);
private:
Ptr<HashImplementation> m_impl; /** Hash implementation */
--- a/src/core/test/hash-test-suite.cc Tue Nov 13 16:35:21 2012 -0800
+++ b/src/core/test/hash-test-suite.cc Tue Nov 13 16:35:51 2012 -0800
@@ -98,14 +98,14 @@
Hash hasher = Hash ( Create<HashFunction::Fnv1a> () );
uint32_t h32r = 0x5735855b; // FNV1A(key)
- uint32_t h32 = hasher.GetHash32 (key);
+ uint32_t h32 = hasher.clear ().GetHash32 (key);
NS_TEST_ASSERT_MSG_EQ (h32, h32r,
"Hash32 produced " << std::hex << std::setw ( 8) << h32
<< ", expected " << std::hex << std::setw ( 8) << h32r
);
uint64_t h64r = 0x6fb0aea4ad83c27b;
- uint64_t h64 = hasher.GetHash64 (key);
+ uint64_t h64 = hasher.clear ().GetHash64 (key);
NS_TEST_ASSERT_MSG_EQ (h64, h64r,
"Hash64 produced " << std::hex << std::setw (16) << h64
<< ", expected " << std::hex << std::setw (16) << h64r
@@ -142,14 +142,14 @@
Hash hasher = Hash ( Create<HashFunction::Murmur3> () );
uint32_t h32r = 0xe8a2d100; // Murmur3(key)
- uint32_t h32 = hasher.GetHash32 (key);
+ uint32_t h32 = hasher.clear ().GetHash32 (key);
NS_TEST_ASSERT_MSG_EQ (h32, h32r,
"Hash32 produced " << std::hex << std::setw ( 8) << h32
<< ", expected " << std::hex << std::setw ( 8) << h32r
);
uint64_t h64r = 0x95373d091a691071;
- uint64_t h64 = hasher.GetHash64 (key);
+ uint64_t h64 = hasher.clear ().GetHash64 (key);
NS_TEST_ASSERT_MSG_EQ (h64, h64r,
"Hash64 produced " << std::hex << std::setw (16) << h64
<< ", expected " << std::hex << std::setw (16) << h64r