diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-11 12:05:04 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-11 12:05:04 -0700 |
commit | 677b8fffb0c76c009ad808ed91a27738e5420254 (patch) | |
tree | 3cf9937569b7ca0cb93b6dfd04ac854f414f9d36 /core/src/fxcrt | |
parent | 2b5e0d5b20654d116045484868c9e015ed698124 (diff) | |
download | pdfium-677b8fffb0c76c009ad808ed91a27738e5420254.tar.xz |
Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.
At one point in time, it may have made sense to indicate the
expected alignment of the memory you're about to copy, but that
was last century. The compiler will take care of it just fine.
I stopped short of removing the FXSYS_ wrapper macros entirely.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1179693003.
Diffstat (limited to 'core/src/fxcrt')
-rw-r--r-- | core/src/fxcrt/extension.h | 8 | ||||
-rw-r--r-- | core/src/fxcrt/fx_basic_array.cpp | 16 | ||||
-rw-r--r-- | core/src/fxcrt/fx_basic_bstring.cpp | 44 | ||||
-rw-r--r-- | core/src/fxcrt/fx_basic_buffer.cpp | 18 | ||||
-rw-r--r-- | core/src/fxcrt/fx_basic_maps.cpp | 8 | ||||
-rw-r--r-- | core/src/fxcrt/fx_basic_wstring.cpp | 34 | ||||
-rw-r--r-- | core/src/fxcrt/fx_extension.cpp | 2 | ||||
-rw-r--r-- | core/src/fxcrt/fxcrt_posix.cpp | 2 |
8 files changed, 66 insertions, 66 deletions
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h index 4c270db403..79efa0e1f0 100644 --- a/core/src/fxcrt/extension.h +++ b/core/src/fxcrt/extension.h @@ -240,7 +240,7 @@ public: m_nCurPos = newPos.ValueOrDie(); if (m_dwFlags & FX_MEMSTREAM_Consecutive) { - FXSYS_memcpy32(buffer, (uint8_t*)m_Blocks[0] + (size_t)offset, size); + FXSYS_memcpy(buffer, (uint8_t*)m_Blocks[0] + (size_t)offset, size); return TRUE; } size_t nStartBlock = (size_t)offset / m_nGrowSize; @@ -250,7 +250,7 @@ public: if (nRead > size) { nRead = size; } - FXSYS_memcpy32(buffer, (uint8_t*)m_Blocks[(int)nStartBlock] + (size_t)offset, nRead); + FXSYS_memcpy(buffer, (uint8_t*)m_Blocks[(int)nStartBlock] + (size_t)offset, nRead); buffer = ((uint8_t*)buffer) + nRead; size -= nRead; nStartBlock ++; @@ -303,7 +303,7 @@ public: return FALSE; } } - FXSYS_memcpy32((uint8_t*)m_Blocks[0] + (size_t)offset, buffer, size); + FXSYS_memcpy((uint8_t*)m_Blocks[0] + (size_t)offset, buffer, size); if (m_nCurSize < m_nCurPos) { m_nCurSize = m_nCurPos; } @@ -327,7 +327,7 @@ public: if (nWrite > size) { nWrite = size; } - FXSYS_memcpy32((uint8_t*)m_Blocks[(int)nStartBlock] + (size_t)offset, buffer, nWrite); + FXSYS_memcpy((uint8_t*)m_Blocks[(int)nStartBlock] + (size_t)offset, buffer, nWrite); buffer = ((uint8_t*)buffer) + nWrite; size -= nWrite; nStartBlock ++; diff --git a/core/src/fxcrt/fx_basic_array.cpp b/core/src/fxcrt/fx_basic_array.cpp index d21909f861..56b2f57f3c 100644 --- a/core/src/fxcrt/fx_basic_array.cpp +++ b/core/src/fxcrt/fx_basic_array.cpp @@ -42,7 +42,7 @@ FX_BOOL CFX_BasicArray::SetSize(int nNewSize) m_nSize = m_nMaxSize = nNewSize; } else if (nNewSize <= m_nMaxSize) { if (nNewSize > m_nSize) { - FXSYS_memset32(m_pData + m_nSize * m_nUnitSize, 0, (nNewSize - m_nSize) * m_nUnitSize); + FXSYS_memset(m_pData + m_nSize * m_nUnitSize, 0, (nNewSize - m_nSize) * m_nUnitSize); } m_nSize = nNewSize; } else { @@ -56,7 +56,7 @@ FX_BOOL CFX_BasicArray::SetSize(int nNewSize) if (pNewData == NULL) { return FALSE; } - FXSYS_memset32(pNewData + m_nSize * m_nUnitSize, 0, (nNewMax - m_nSize) * m_nUnitSize); + FXSYS_memset(pNewData + m_nSize * m_nUnitSize, 0, (nNewMax - m_nSize) * m_nUnitSize); m_pData = pNewData; m_nSize = nNewSize; m_nMaxSize = nNewMax; @@ -72,7 +72,7 @@ FX_BOOL CFX_BasicArray::Append(const CFX_BasicArray& src) return FALSE; } - FXSYS_memcpy32(m_pData + nOldSize * m_nUnitSize, src.m_pData, src.m_nSize * m_nUnitSize); + FXSYS_memcpy(m_pData + nOldSize * m_nUnitSize, src.m_pData, src.m_nSize * m_nUnitSize); return TRUE; } FX_BOOL CFX_BasicArray::Copy(const CFX_BasicArray& src) @@ -80,7 +80,7 @@ FX_BOOL CFX_BasicArray::Copy(const CFX_BasicArray& src) if (!SetSize(src.m_nSize)) { return FALSE; } - FXSYS_memcpy32(m_pData, src.m_pData, src.m_nSize * m_nUnitSize); + FXSYS_memcpy(m_pData, src.m_pData, src.m_nSize * m_nUnitSize); return TRUE; } uint8_t* CFX_BasicArray::InsertSpaceAt(int nIndex, int nCount) @@ -97,9 +97,9 @@ uint8_t* CFX_BasicArray::InsertSpaceAt(int nIndex, int nCount) if (!SetSize(m_nSize + nCount)) { return NULL; } - FXSYS_memmove32(m_pData + (nIndex + nCount)*m_nUnitSize, m_pData + nIndex * m_nUnitSize, + FXSYS_memmove(m_pData + (nIndex + nCount)*m_nUnitSize, m_pData + nIndex * m_nUnitSize, (nOldSize - nIndex) * m_nUnitSize); - FXSYS_memset32(m_pData + nIndex * m_nUnitSize, 0, nCount * m_nUnitSize); + FXSYS_memset(m_pData + nIndex * m_nUnitSize, 0, nCount * m_nUnitSize); } return m_pData + nIndex * m_nUnitSize; } @@ -110,7 +110,7 @@ FX_BOOL CFX_BasicArray::RemoveAt(int nIndex, int nCount) } int nMoveCount = m_nSize - (nIndex + nCount); if (nMoveCount) { - FXSYS_memmove32(m_pData + nIndex * m_nUnitSize, m_pData + (nIndex + nCount) * m_nUnitSize, nMoveCount * m_nUnitSize); + FXSYS_memmove(m_pData + nIndex * m_nUnitSize, m_pData + (nIndex + nCount) * m_nUnitSize, nMoveCount * m_nUnitSize); } m_nSize -= nCount; return TRUE; @@ -126,7 +126,7 @@ FX_BOOL CFX_BasicArray::InsertAt(int nStartIndex, const CFX_BasicArray* pNewArra if (!InsertSpaceAt(nStartIndex, pNewArray->m_nSize)) { return FALSE; } - FXSYS_memcpy32(m_pData + nStartIndex * m_nUnitSize, pNewArray->m_pData, pNewArray->m_nSize * m_nUnitSize); + FXSYS_memcpy(m_pData + nStartIndex * m_nUnitSize, pNewArray->m_pData, pNewArray->m_nSize * m_nUnitSize); return TRUE; } const void* CFX_BasicArray::GetDataPtr(int index) const diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp index c6fa998077..9f54414110 100644 --- a/core/src/fxcrt/fx_basic_bstring.cpp +++ b/core/src/fxcrt/fx_basic_bstring.cpp @@ -89,7 +89,7 @@ CFX_ByteString::CFX_ByteString(const FX_CHAR* lpsz, FX_STRSIZE nLen) if (nLen) { m_pData = StringData::Create(nLen); if (m_pData) { - FXSYS_memcpy32(m_pData->m_String, lpsz, nLen); + FXSYS_memcpy(m_pData->m_String, lpsz, nLen); } } else { m_pData = NULL; @@ -100,7 +100,7 @@ CFX_ByteString::CFX_ByteString(const uint8_t* lpsz, FX_STRSIZE nLen) if (nLen > 0) { m_pData = StringData::Create(nLen); if (m_pData) { - FXSYS_memcpy32(m_pData->m_String, lpsz, nLen); + FXSYS_memcpy(m_pData->m_String, lpsz, nLen); } } else { m_pData = NULL; @@ -146,8 +146,8 @@ CFX_ByteString::CFX_ByteString(const CFX_ByteStringC& str1, const CFX_ByteString } m_pData = StringData::Create(nNewLen); if (m_pData) { - FXSYS_memcpy32(m_pData->m_String, str1.GetCStr(), str1.GetLength()); - FXSYS_memcpy32(m_pData->m_String + str1.GetLength(), str2.GetCStr(), str2.GetLength()); + FXSYS_memcpy(m_pData->m_String, str1.GetCStr(), str1.GetLength()); + FXSYS_memcpy(m_pData->m_String + str1.GetLength(), str2.GetCStr(), str2.GetLength()); } } const CFX_ByteString& CFX_ByteString::operator=(const FX_CHAR* lpsz) @@ -198,7 +198,7 @@ void CFX_ByteString::Load(const uint8_t* buf, FX_STRSIZE len) if (len) { m_pData = StringData::Create(len); if (m_pData) { - FXSYS_memcpy32(m_pData->m_String, buf, len); + FXSYS_memcpy(m_pData->m_String, buf, len); } } else { m_pData = NULL; @@ -241,7 +241,7 @@ bool CFX_ByteString::Equal(const char* ptr) const return m_pData->m_nDataLength == 0; } return FXSYS_strlen(ptr) == m_pData->m_nDataLength && - FXSYS_memcmp32(ptr, m_pData->m_String, m_pData->m_nDataLength) == 0; + FXSYS_memcmp(ptr, m_pData->m_String, m_pData->m_nDataLength) == 0; } bool CFX_ByteString::Equal(const CFX_ByteStringC& str) const { @@ -249,7 +249,7 @@ bool CFX_ByteString::Equal(const CFX_ByteStringC& str) const return str.IsEmpty(); } return m_pData->m_nDataLength == str.GetLength() && - FXSYS_memcmp32(m_pData->m_String, str.GetCStr(), str.GetLength()) == 0; + FXSYS_memcmp(m_pData->m_String, str.GetCStr(), str.GetLength()) == 0; } bool CFX_ByteString::Equal(const CFX_ByteString& other) const { @@ -260,7 +260,7 @@ bool CFX_ByteString::Equal(const CFX_ByteString& other) const return false; } return other.m_pData->m_nDataLength == m_pData->m_nDataLength && - FXSYS_memcmp32(other.m_pData->m_String, + FXSYS_memcmp(other.m_pData->m_String, m_pData->m_String, m_pData->m_nDataLength) == 0; } @@ -304,7 +304,7 @@ bool CFX_ByteString::EqualNoCase(const CFX_ByteStringC& str) const void CFX_ByteString::AssignCopy(FX_STRSIZE nSrcLen, const FX_CHAR* lpszSrcData) { AllocBeforeWrite(nSrcLen); - FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen); + FXSYS_memcpy(m_pData->m_String, lpszSrcData, nSrcLen); m_pData->m_nDataLength = nSrcLen; m_pData->m_String[nSrcLen] = 0; } @@ -318,7 +318,7 @@ void CFX_ByteString::CopyBeforeWrite() FX_STRSIZE nDataLength = pData->m_nDataLength; m_pData = StringData::Create(nDataLength); if (m_pData != NULL) { - FXSYS_memcpy32(m_pData->m_String, pData->m_String, nDataLength + 1); + FXSYS_memcpy(m_pData->m_String, pData->m_String, nDataLength + 1); } } void CFX_ByteString::AllocBeforeWrite(FX_STRSIZE nLen) @@ -377,7 +377,7 @@ FX_CHAR* CFX_ByteString::GetBuffer(FX_STRSIZE nMinBufLength) if (!m_pData) { return NULL; } - FXSYS_memcpy32(m_pData->m_String, pOldData->m_String, (nOldLen + 1)); + FXSYS_memcpy(m_pData->m_String, pOldData->m_String, (nOldLen + 1)); m_pData->m_nDataLength = nOldLen; pOldData->Release(); return m_pData->m_String; @@ -399,7 +399,7 @@ FX_STRSIZE CFX_ByteString::Delete(FX_STRSIZE nIndex, FX_STRSIZE nCount) } CopyBeforeWrite(); int nBytesToCopy = nOldLength - mLength + 1; - FXSYS_memmove32(m_pData->m_String + nIndex, + FXSYS_memmove(m_pData->m_String + nIndex, m_pData->m_String + mLength, nBytesToCopy); m_pData->m_nDataLength = nOldLength - nCount; } @@ -415,13 +415,13 @@ void CFX_ByteString::ConcatInPlace(FX_STRSIZE nSrcLen, const FX_CHAR* lpszSrcDat if (!m_pData) { return; } - FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen); + FXSYS_memcpy(m_pData->m_String, lpszSrcData, nSrcLen); return; } if (m_pData->m_nRefs > 1 || m_pData->m_nDataLength + nSrcLen > m_pData->m_nAllocLength) { ConcatCopy(m_pData->m_nDataLength, m_pData->m_String, nSrcLen, lpszSrcData); } else { - FXSYS_memcpy32(m_pData->m_String + m_pData->m_nDataLength, lpszSrcData, nSrcLen); + FXSYS_memcpy(m_pData->m_String + m_pData->m_nDataLength, lpszSrcData, nSrcLen); m_pData->m_nDataLength += nSrcLen; m_pData->m_String[m_pData->m_nDataLength] = 0; } @@ -480,7 +480,7 @@ void CFX_ByteString::AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STR ASSERT(dest.m_pData == NULL); dest.m_pData = StringData::Create(nCopyLen); if (dest.m_pData) { - FXSYS_memcpy32(dest.m_pData->m_String, m_pData->m_String + nCopyIndex, nCopyLen); + FXSYS_memcpy(dest.m_pData->m_String, m_pData->m_String + nCopyIndex, nCopyLen); } } #define FORCE_ANSI 0x10000 @@ -726,13 +726,13 @@ FX_STRSIZE CFX_ByteString::Insert(FX_STRSIZE nIndex, FX_CHAR ch) return 0; } if(pOldData != NULL) { - FXSYS_memmove32(m_pData->m_String, pstr, (pOldData->m_nDataLength + 1)); + FXSYS_memmove(m_pData->m_String, pstr, (pOldData->m_nDataLength + 1)); pOldData->Release(); } else { m_pData->m_String[0] = 0; } } - FXSYS_memmove32(m_pData->m_String + nIndex + 1, + FXSYS_memmove(m_pData->m_String + nIndex + 1, m_pData->m_String + nIndex, (nNewLength - nIndex)); m_pData->m_String[nIndex] = ch; m_pData->m_nDataLength = nNewLength; @@ -911,13 +911,13 @@ FX_STRSIZE CFX_ByteString::Replace(const CFX_ByteStringC& lpszOld, const CFX_Byt FX_CHAR* pDest = pNewData->m_String; for (FX_STRSIZE i = 0; i < nCount; i ++) { const FX_CHAR* pTarget = FX_strstr(pStart, (FX_STRSIZE)(pEnd - pStart), lpszOld.GetCStr(), nSourceLen); - FXSYS_memcpy32(pDest, pStart, pTarget - pStart); + FXSYS_memcpy(pDest, pStart, pTarget - pStart); pDest += pTarget - pStart; - FXSYS_memcpy32(pDest, lpszNew.GetCStr(), lpszNew.GetLength()); + FXSYS_memcpy(pDest, lpszNew.GetCStr(), lpszNew.GetLength()); pDest += lpszNew.GetLength(); pStart = pTarget + nSourceLen; } - FXSYS_memcpy32(pDest, pStart, pEnd - pStart); + FXSYS_memcpy(pDest, pStart, pEnd - pStart); m_pData->Release(); m_pData = pNewData; return nCount; @@ -1041,7 +1041,7 @@ void CFX_ByteString::TrimLeft(const CFX_ByteStringC& lpszTargets) } if (pos) { FX_STRSIZE nDataLength = len - pos; - FXSYS_memmove32(m_pData->m_String, m_pData->m_String + pos, (nDataLength + 1)*sizeof(FX_CHAR)); + FXSYS_memmove(m_pData->m_String, m_pData->m_String + pos, (nDataLength + 1)*sizeof(FX_CHAR)); m_pData->m_nDataLength = nDataLength; } } @@ -1110,7 +1110,7 @@ FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_CHAR* buf) int i = scaled / scale; FXSYS_itoa(i, buf2, 10); FX_STRSIZE len = FXSYS_strlen(buf2); - FXSYS_memcpy32(buf + buf_size, buf2, len); + FXSYS_memcpy(buf + buf_size, buf2, len); buf_size += len; int fraction = scaled % scale; if (fraction == 0) { diff --git a/core/src/fxcrt/fx_basic_buffer.cpp b/core/src/fxcrt/fx_basic_buffer.cpp index 43da8e9ebf..9fc400e183 100644 --- a/core/src/fxcrt/fx_basic_buffer.cpp +++ b/core/src/fxcrt/fx_basic_buffer.cpp @@ -31,7 +31,7 @@ void CFX_BinaryBuf::Delete(int start_index, int count) if (!m_pBuffer || start_index < 0 || start_index + count > m_DataSize) { return; } - FXSYS_memmove32(m_pBuffer + start_index, m_pBuffer + start_index + count, m_DataSize - start_index - count); + FXSYS_memmove(m_pBuffer + start_index, m_pBuffer + start_index + count, m_DataSize - start_index - count); m_DataSize -= count; } void CFX_BinaryBuf::Clear() @@ -103,14 +103,14 @@ void CFX_BinaryBuf::CopyData(const void* pStr, FX_STRSIZE size) if (!m_pBuffer) { return; } - FXSYS_memcpy32(m_pBuffer, pStr, size); + FXSYS_memcpy(m_pBuffer, pStr, size); m_DataSize = size; } void CFX_BinaryBuf::AppendBlock(const void* pBuf, FX_STRSIZE size) { ExpandBuf(size); if (pBuf && m_pBuffer) { - FXSYS_memcpy32(m_pBuffer + m_DataSize, pBuf, size); + FXSYS_memcpy(m_pBuffer + m_DataSize, pBuf, size); } m_DataSize += size; } @@ -120,9 +120,9 @@ void CFX_BinaryBuf::InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE siz if (!m_pBuffer) { return; } - FXSYS_memmove32(m_pBuffer + pos + size, m_pBuffer + pos, m_DataSize - pos); + FXSYS_memmove(m_pBuffer + pos + size, m_pBuffer + pos, m_DataSize - pos); if (pBuf) { - FXSYS_memcpy32(m_pBuffer + pos, pBuf, size); + FXSYS_memcpy(m_pBuffer + pos, pBuf, size); } m_DataSize += size; } @@ -132,7 +132,7 @@ void CFX_BinaryBuf::AppendFill(uint8_t byte, FX_STRSIZE count) if (!m_pBuffer) { return; } - FXSYS_memset8(m_pBuffer + m_DataSize, byte, count); + FXSYS_memset(m_pBuffer + m_DataSize, byte, count); m_DataSize += count; } CFX_ByteStringC CFX_BinaryBuf::GetByteString() const @@ -360,7 +360,7 @@ CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (CFX_ByteString& str) return *this; } FX_CHAR* buffer = str.GetBuffer(len); - FXSYS_memcpy32(buffer, m_pLoadingBuf + m_LoadingPos, len); + FXSYS_memcpy(buffer, m_pLoadingBuf + m_LoadingPos, len); str.ReleaseBuffer(len); m_LoadingPos += len; return *this; @@ -377,7 +377,7 @@ FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize) if (m_LoadingPos + dwSize > m_LoadingSize) { return FALSE; } - FXSYS_memcpy32(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize); + FXSYS_memcpy(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize); m_LoadingPos += dwSize; return TRUE; } @@ -459,7 +459,7 @@ int32_t IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size) FX_STRSIZE temp_size = (FX_STRSIZE)size; while (temp_size > 0) { FX_STRSIZE buf_size = FX_MIN(m_BufSize - m_Length, (FX_STRSIZE)temp_size); - FXSYS_memcpy32(m_pBuffer + m_Length, buffer, buf_size); + FXSYS_memcpy(m_pBuffer + m_Length, buffer, buf_size); m_Length += buf_size; if (m_Length == m_BufSize) { if (!Flush()) { diff --git a/core/src/fxcrt/fx_basic_maps.cpp b/core/src/fxcrt/fx_basic_maps.cpp index afc7c8219e..8a886f88ea 100644 --- a/core/src/fxcrt/fx_basic_maps.cpp +++ b/core/src/fxcrt/fx_basic_maps.cpp @@ -395,25 +395,25 @@ static FX_BOOL _CompactStringSame(_CompactString* pCompact, const uint8_t* pStr, if (pCompact->m_CompactLen != len) { return FALSE; } - return FXSYS_memcmp32(&pCompact->m_LenHigh, pStr, len) == 0; + return FXSYS_memcmp(&pCompact->m_LenHigh, pStr, len) == 0; } if (pCompact->m_CompactLen != 0xff || pCompact->m_LenHigh * 256 + pCompact->m_LenLow != len) { return FALSE; } - return FXSYS_memcmp32(pCompact->m_pBuffer, pStr, len) == 0; + return FXSYS_memcmp(pCompact->m_pBuffer, pStr, len) == 0; } static void _CompactStringStore(_CompactString* pCompact, const uint8_t* pStr, int len) { if (len < (int)sizeof(_CompactString)) { pCompact->m_CompactLen = (uint8_t)len; - FXSYS_memcpy32(&pCompact->m_LenHigh, pStr, len); + FXSYS_memcpy(&pCompact->m_LenHigh, pStr, len); return; } pCompact->m_CompactLen = 0xff; pCompact->m_LenHigh = len / 256; pCompact->m_LenLow = len % 256; pCompact->m_pBuffer = FX_Alloc(uint8_t, len); - FXSYS_memcpy32(pCompact->m_pBuffer, pStr, len); + FXSYS_memcpy(pCompact->m_pBuffer, pStr, len); } static CFX_ByteStringC _CompactStringGet(_CompactString* pCompact) { diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp index 1108a3ca52..2442daed27 100644 --- a/core/src/fxcrt/fx_basic_wstring.cpp +++ b/core/src/fxcrt/fx_basic_wstring.cpp @@ -63,7 +63,7 @@ CFX_WideString::CFX_WideString(const FX_WCHAR* lpsz, FX_STRSIZE nLen) { if (nLen) { m_pData = StringData::Create(nLen); if (m_pData) { - FXSYS_memcpy32(m_pData->m_String, lpsz, nLen * sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String, lpsz, nLen * sizeof(FX_WCHAR)); } } else { m_pData = NULL; @@ -84,7 +84,7 @@ CFX_WideString::CFX_WideString(const CFX_WideStringC& str) } m_pData = StringData::Create(str.GetLength()); if (m_pData) { - FXSYS_memcpy32(m_pData->m_String, str.GetPtr(), str.GetLength()*sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String, str.GetPtr(), str.GetLength()*sizeof(FX_WCHAR)); } } CFX_WideString::CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2) @@ -96,8 +96,8 @@ CFX_WideString::CFX_WideString(const CFX_WideStringC& str1, const CFX_WideString } m_pData = StringData::Create(nNewLen); if (m_pData) { - FXSYS_memcpy32(m_pData->m_String, str1.GetPtr(), str1.GetLength()*sizeof(FX_WCHAR)); - FXSYS_memcpy32(m_pData->m_String + str1.GetLength(), str2.GetPtr(), str2.GetLength()*sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String, str1.GetPtr(), str1.GetLength()*sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String + str1.GetLength(), str2.GetPtr(), str2.GetLength()*sizeof(FX_WCHAR)); } } void CFX_WideString::ReleaseBuffer(FX_STRSIZE nNewLength) @@ -229,14 +229,14 @@ void CFX_WideString::ConcatInPlace(FX_STRSIZE nSrcLen, const FX_WCHAR* lpszSrcDa if (m_pData == NULL) { m_pData = StringData::Create(nSrcLen); if (m_pData) { - FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(FX_WCHAR)); } return; } if (m_pData->m_nRefs > 1 || m_pData->m_nDataLength + nSrcLen > m_pData->m_nAllocLength) { ConcatCopy(m_pData->m_nDataLength, m_pData->m_String, nSrcLen, lpszSrcData); } else { - FXSYS_memcpy32(m_pData->m_String + m_pData->m_nDataLength, lpszSrcData, nSrcLen * sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String + m_pData->m_nDataLength, lpszSrcData, nSrcLen * sizeof(FX_WCHAR)); m_pData->m_nDataLength += nSrcLen; m_pData->m_String[m_pData->m_nDataLength] = 0; } @@ -267,7 +267,7 @@ void CFX_WideString::CopyBeforeWrite() FX_STRSIZE nDataLength = pData->m_nDataLength; m_pData = StringData::Create(nDataLength); if (m_pData != NULL) { - FXSYS_memcpy32(m_pData->m_String, pData->m_String, (nDataLength + 1) * sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String, pData->m_String, (nDataLength + 1) * sizeof(FX_WCHAR)); } } void CFX_WideString::AllocBeforeWrite(FX_STRSIZE nLen) @@ -281,7 +281,7 @@ void CFX_WideString::AllocBeforeWrite(FX_STRSIZE nLen) void CFX_WideString::AssignCopy(FX_STRSIZE nSrcLen, const FX_WCHAR* lpszSrcData) { AllocBeforeWrite(nSrcLen); - FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(FX_WCHAR)); m_pData->m_nDataLength = nSrcLen; m_pData->m_String[nSrcLen] = 0; } @@ -351,7 +351,7 @@ FX_WCHAR* CFX_WideString::GetBuffer(FX_STRSIZE nMinBufLength) if (!m_pData) { return NULL; } - FXSYS_memcpy32(m_pData->m_String, pOldData->m_String, (nOldLen + 1)*sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String, pOldData->m_String, (nOldLen + 1)*sizeof(FX_WCHAR)); m_pData->m_nDataLength = nOldLen; pOldData->Release(); return m_pData->m_String; @@ -410,7 +410,7 @@ void CFX_WideString::AllocCopy(CFX_WideString& dest, FX_STRSIZE nCopyLen, FX_STR ASSERT(dest.m_pData == NULL); dest.m_pData = StringData::Create(nCopyLen); if (dest.m_pData) { - FXSYS_memcpy32(dest.m_pData->m_String, m_pData->m_String + nCopyIndex, iSize.ValueOrDie()); + FXSYS_memcpy(dest.m_pData->m_String, m_pData->m_String + nCopyIndex, iSize.ValueOrDie()); } } CFX_WideString CFX_WideString::Left(FX_STRSIZE nCount) const @@ -609,7 +609,7 @@ void CFX_WideString::TrimLeft(const FX_WCHAR* lpszTargets) } if (lpsz != m_pData->m_String) { int nDataLength = m_pData->m_nDataLength - (FX_STRSIZE)(lpsz - m_pData->m_String); - FXSYS_memmove32(m_pData->m_String, lpsz, (nDataLength + 1)*sizeof(FX_WCHAR)); + FXSYS_memmove(m_pData->m_String, lpsz, (nDataLength + 1)*sizeof(FX_WCHAR)); m_pData->m_nDataLength = nDataLength; } } @@ -656,7 +656,7 @@ FX_STRSIZE CFX_WideString::Replace(const FX_WCHAR* lpszOld, const FX_WCHAR* lpsz if (!m_pData) { return 0; } - FXSYS_memcpy32(m_pData->m_String, pstr, pOldData->m_nDataLength * sizeof(FX_WCHAR)); + FXSYS_memcpy(m_pData->m_String, pstr, pOldData->m_nDataLength * sizeof(FX_WCHAR)); pOldData->Release(); } lpszStart = m_pData->m_String; @@ -664,8 +664,8 @@ FX_STRSIZE CFX_WideString::Replace(const FX_WCHAR* lpszOld, const FX_WCHAR* lpsz { while ((lpszTarget = (FX_WCHAR*)FXSYS_wcsstr(lpszStart, lpszOld)) != NULL && lpszStart < lpszEnd) { FX_STRSIZE nBalance = nOldLength - (FX_STRSIZE)(lpszTarget - m_pData->m_String + nSourceLen); - FXSYS_memmove32(lpszTarget + nReplacementLen, lpszTarget + nSourceLen, nBalance * sizeof(FX_WCHAR)); - FXSYS_memcpy32(lpszTarget, lpszNew, nReplacementLen * sizeof(FX_WCHAR)); + FXSYS_memmove(lpszTarget + nReplacementLen, lpszTarget + nSourceLen, nBalance * sizeof(FX_WCHAR)); + FXSYS_memcpy(lpszTarget, lpszNew, nReplacementLen * sizeof(FX_WCHAR)); lpszStart = lpszTarget + nReplacementLen; lpszStart[nBalance] = 0; nOldLength += (nReplacementLen - nSourceLen); @@ -695,13 +695,13 @@ FX_STRSIZE CFX_WideString::Insert(FX_STRSIZE nIndex, FX_WCHAR ch) return 0; } if(pOldData != NULL) { - FXSYS_memmove32(m_pData->m_String, pstr, (pOldData->m_nDataLength + 1)*sizeof(FX_WCHAR)); + FXSYS_memmove(m_pData->m_String, pstr, (pOldData->m_nDataLength + 1)*sizeof(FX_WCHAR)); pOldData->Release(); } else { m_pData->m_String[0] = 0; } } - FXSYS_memmove32(m_pData->m_String + nIndex + 1, + FXSYS_memmove(m_pData->m_String + nIndex + 1, m_pData->m_String + nIndex, (nNewLength - nIndex)*sizeof(FX_WCHAR)); m_pData->m_String[nIndex] = ch; m_pData->m_nDataLength = nNewLength; @@ -719,7 +719,7 @@ FX_STRSIZE CFX_WideString::Delete(FX_STRSIZE nIndex, FX_STRSIZE nCount) if (nCount > 0 && nIndex < nOldLength) { CopyBeforeWrite(); int nBytesToCopy = nOldLength - (nIndex + nCount) + 1; - FXSYS_memmove32(m_pData->m_String + nIndex, + FXSYS_memmove(m_pData->m_String + nIndex, m_pData->m_String + nIndex + nCount, nBytesToCopy * sizeof(FX_WCHAR)); m_pData->m_nDataLength = nOldLength - nCount; } diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp index 301ba53968..98f70cb2b9 100644 --- a/core/src/fxcrt/fx_extension.cpp +++ b/core/src/fxcrt/fx_extension.cpp @@ -344,7 +344,7 @@ void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount) ::GetSystemTime(&st1); do { ::GetSystemTime(&st2); - } while (FXSYS_memcmp32(&st1, &st2, sizeof(SYSTEMTIME)) == 0); + } while (FXSYS_memcmp(&st1, &st2, sizeof(SYSTEMTIME)) == 0); FX_DWORD dwHash1 = FX_HashCode_String_GetA((const FX_CHAR*)&st1, sizeof(st1), TRUE); FX_DWORD dwHash2 = FX_HashCode_String_GetA((const FX_CHAR*)&st2, sizeof(st2), TRUE); ::srand((dwHash1 << 16) | (FX_DWORD)dwHash2); diff --git a/core/src/fxcrt/fxcrt_posix.cpp b/core/src/fxcrt/fxcrt_posix.cpp index 4f58c103f0..90d77fedc1 100644 --- a/core/src/fxcrt/fxcrt_posix.cpp +++ b/core/src/fxcrt/fxcrt_posix.cpp @@ -65,7 +65,7 @@ FX_FILESIZE CFXCRT_FileAccess_Posix::GetSize() const return 0; } struct stat s; - FXSYS_memset32(&s, 0, sizeof(s)); + FXSYS_memset(&s, 0, sizeof(s)); fstat(m_nFD, &s); return s.st_size; } |