diff options
Diffstat (limited to 'JavaScriptCore/wtf/MD5.cpp')
-rw-r--r-- | JavaScriptCore/wtf/MD5.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/JavaScriptCore/wtf/MD5.cpp b/JavaScriptCore/wtf/MD5.cpp index e995102..375446e 100644 --- a/JavaScriptCore/wtf/MD5.cpp +++ b/JavaScriptCore/wtf/MD5.cpp @@ -54,6 +54,7 @@ #include "StringExtras.h" #include "text/CString.h" #endif +#include <wtf/StdLibExtras.h> namespace WTF { @@ -103,7 +104,7 @@ static void reverseBytes(uint8_t* buf, unsigned longs) do { uint32_t t = static_cast<uint32_t>(buf[3] << 8 | buf[2]) << 16 | buf[1] << 8 | buf[0]; ASSERT_WITH_MESSAGE(!(reinterpret_cast<uintptr_t>(buf) % sizeof(t)), "alignment error of buf"); - *reinterpret_cast<uint32_t *>(buf) = t; + *reinterpret_cast_ptr<uint32_t *>(buf) = t; buf += 4; } while (--longs); } @@ -238,7 +239,7 @@ void MD5::addBytes(const uint8_t* input, size_t length) } memcpy(p, buf, t); reverseBytes(m_in, 16); - MD5Transform(m_buf, reinterpret_cast<uint32_t*>(m_in)); // m_in is 4-byte aligned. + MD5Transform(m_buf, reinterpret_cast_ptr<uint32_t*>(m_in)); // m_in is 4-byte aligned. buf += t; length -= t; } @@ -248,7 +249,7 @@ void MD5::addBytes(const uint8_t* input, size_t length) while (length >= 64) { memcpy(m_in, buf, 64); reverseBytes(m_in, 16); - MD5Transform(m_buf, reinterpret_cast<uint32_t*>(m_in)); // m_in is 4-byte aligned. + MD5Transform(m_buf, reinterpret_cast_ptr<uint32_t*>(m_in)); // m_in is 4-byte aligned. buf += 64; length -= 64; } @@ -275,7 +276,7 @@ void MD5::checksum(Vector<uint8_t, 16>& digest) // Two lots of padding: Pad the first block to 64 bytes memset(p, 0, count); reverseBytes(m_in, 16); - MD5Transform(m_buf, reinterpret_cast<uint32_t *>(m_in)); // m_in is 4-byte aligned. + MD5Transform(m_buf, reinterpret_cast_ptr<uint32_t *>(m_in)); // m_in is 4-byte aligned. // Now fill the next block with 56 bytes memset(m_in, 0, 56); @@ -287,10 +288,10 @@ void MD5::checksum(Vector<uint8_t, 16>& digest) // Append length in bits and transform // m_in is 4-byte aligned. - (reinterpret_cast<uint32_t*>(m_in))[14] = m_bits[0]; - (reinterpret_cast<uint32_t*>(m_in))[15] = m_bits[1]; + (reinterpret_cast_ptr<uint32_t*>(m_in))[14] = m_bits[0]; + (reinterpret_cast_ptr<uint32_t*>(m_in))[15] = m_bits[1]; - MD5Transform(m_buf, reinterpret_cast<uint32_t*>(m_in)); + MD5Transform(m_buf, reinterpret_cast_ptr<uint32_t*>(m_in)); reverseBytes(reinterpret_cast<uint8_t*>(m_buf), 4); // Now, m_buf contains checksum result. |