summaryrefslogtreecommitdiff
path: root/core/src/fxcrt
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
commitd7e5cc754a937605d1f73db5e7967c58ddd80742 (patch)
treeed28e012c4d6a46b7f29f15a0c060474c27d4286 /core/src/fxcrt
parentbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (diff)
downloadpdfium-d7e5cc754a937605d1f73db5e7967c58ddd80742.tar.xz
Merge to XFA: Remove typdefs for pointer types in fx_system.h.
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
Diffstat (limited to 'core/src/fxcrt')
-rw-r--r--core/src/fxcrt/extension.h28
-rw-r--r--core/src/fxcrt/fx_arabic.cpp6
-rw-r--r--core/src/fxcrt/fx_basic_array.cpp12
-rw-r--r--core/src/fxcrt/fx_basic_bstring.cpp72
-rw-r--r--core/src/fxcrt/fx_basic_bstring_unittest.cpp2
-rw-r--r--core/src/fxcrt/fx_basic_buffer.cpp28
-rw-r--r--core/src/fxcrt/fx_basic_gcc.cpp40
-rw-r--r--core/src/fxcrt/fx_basic_maps.cpp16
-rw-r--r--core/src/fxcrt/fx_basic_memmgr.cpp2
-rw-r--r--core/src/fxcrt/fx_basic_utf.cpp2
-rw-r--r--core/src/fxcrt/fx_basic_util.cpp18
-rw-r--r--core/src/fxcrt/fx_basic_wstring.cpp76
-rw-r--r--core/src/fxcrt/fx_extension.cpp98
-rw-r--r--core/src/fxcrt/fx_xml_parser.cpp8
-rw-r--r--core/src/fxcrt/fxcrt_platforms.cpp2
-rw-r--r--core/src/fxcrt/fxcrt_posix.cpp2
-rw-r--r--core/src/fxcrt/fxcrt_windows.h2
-rw-r--r--core/src/fxcrt/xml_int.h16
18 files changed, 215 insertions, 215 deletions
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index 99a5cf3c4e..c526a2ea6e 100644
--- a/core/src/fxcrt/extension.h
+++ b/core/src/fxcrt/extension.h
@@ -184,7 +184,7 @@ public:
{
m_dwFlags = FX_MEMSTREAM_TakeOver | (bConsecutive ? FX_MEMSTREAM_Consecutive : 0);
}
- CFX_MemoryStream(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver)
+ CFX_MemoryStream(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver)
: m_dwCount(1)
, m_nTotalSize(nSize)
, m_nCurSize(nSize)
@@ -199,7 +199,7 @@ public:
{
if (m_dwFlags & FX_MEMSTREAM_TakeOver) {
for (int32_t i = 0; i < m_Blocks.GetSize(); i++) {
- FX_Free((FX_LPBYTE)m_Blocks[i]);
+ FX_Free((uint8_t*)m_Blocks[i]);
}
}
m_Blocks.RemoveAll();
@@ -278,7 +278,7 @@ public:
m_nCurPos = newPos.ValueOrDie();
if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
- FXSYS_memcpy32(buffer, (FX_LPBYTE)m_Blocks[0] + (size_t)offset, size);
+ FXSYS_memcpy32(buffer, (uint8_t*)m_Blocks[0] + (size_t)offset, size);
return TRUE;
}
size_t nStartBlock = (size_t)offset / m_nGrowSize;
@@ -288,8 +288,8 @@ public:
if (nRead > size) {
nRead = size;
}
- FXSYS_memcpy32(buffer, (FX_LPBYTE)m_Blocks[(int)nStartBlock] + (size_t)offset, nRead);
- buffer = ((FX_LPBYTE)buffer) + nRead;
+ FXSYS_memcpy32(buffer, (uint8_t*)m_Blocks[(int)nStartBlock] + (size_t)offset, nRead);
+ buffer = ((uint8_t*)buffer) + nRead;
size -= nRead;
nStartBlock ++;
offset = 0;
@@ -341,7 +341,7 @@ public:
return FALSE;
}
}
- FXSYS_memcpy32((FX_LPBYTE)m_Blocks[0] + (size_t)offset, buffer, size);
+ FXSYS_memcpy32((uint8_t*)m_Blocks[0] + (size_t)offset, buffer, size);
if (m_nCurSize < m_nCurPos) {
m_nCurSize = m_nCurPos;
}
@@ -365,8 +365,8 @@ public:
if (nWrite > size) {
nWrite = size;
}
- FXSYS_memcpy32((FX_LPBYTE)m_Blocks[(int)nStartBlock] + (size_t)offset, buffer, nWrite);
- buffer = ((FX_LPBYTE)buffer) + nWrite;
+ FXSYS_memcpy32((uint8_t*)m_Blocks[(int)nStartBlock] + (size_t)offset, buffer, nWrite);
+ buffer = ((uint8_t*)buffer) + nWrite;
size -= nWrite;
nStartBlock ++;
offset = 0;
@@ -385,7 +385,7 @@ public:
{
if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
if (m_Blocks.GetSize() < 1) {
- FX_LPBYTE pBlock = FX_Alloc(uint8_t, FX_MAX(nInitSize, 4096));
+ uint8_t* pBlock = FX_Alloc(uint8_t, FX_MAX(nInitSize, 4096));
m_Blocks.Add(pBlock);
}
m_nGrowSize = FX_MAX(nGrowSize, 4096);
@@ -393,11 +393,11 @@ public:
m_nGrowSize = FX_MAX(nGrowSize, 4096);
}
}
- virtual FX_LPBYTE GetBuffer() const override
+ virtual uint8_t* GetBuffer() const override
{
- return m_Blocks.GetSize() ? (FX_LPBYTE)m_Blocks[0] : NULL;
+ return m_Blocks.GetSize() ? (uint8_t*)m_Blocks[0] : NULL;
}
- virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) override
+ virtual void AttachBuffer(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) override
{
if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
return;
@@ -442,7 +442,7 @@ protected:
size = (size - m_nTotalSize + m_nGrowSize - 1) / m_nGrowSize;
m_Blocks.SetSize(m_Blocks.GetSize() + (int32_t)size);
while (size --) {
- FX_LPBYTE pBlock = FX_Alloc(uint8_t, m_nGrowSize);
+ uint8_t* pBlock = FX_Alloc(uint8_t, m_nGrowSize);
m_Blocks.SetAt(iCount ++, pBlock);
m_nTotalSize += m_nGrowSize;
}
@@ -469,7 +469,7 @@ typedef struct _FX_MTRANDOMCONTEXT {
} FX_MTRANDOMCONTEXT, * FX_LPMTRANDOMCONTEXT;
typedef FX_MTRANDOMCONTEXT const * FX_LPCMTRANDOMCONTEXT;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, int32_t iCount);
+FX_BOOL FX_GenerateCryptoRandom(FX_DWORD* pBuffer, int32_t iCount);
#endif
#ifdef __cplusplus
}
diff --git a/core/src/fxcrt/fx_arabic.cpp b/core/src/fxcrt/fx_arabic.cpp
index 81c86542c7..b8e8f41612 100644
--- a/core/src/fxcrt/fx_arabic.cpp
+++ b/core/src/fxcrt/fx_arabic.cpp
@@ -312,9 +312,9 @@ void FX_BidiReverseString(CFX_WideString &wsText, int32_t iStart, int32_t iCount
FXSYS_assert(iStart > -1 && iStart < wsText.GetLength());
FXSYS_assert(iCount >= 0 && iStart + iCount <= wsText.GetLength());
FX_WCHAR wch;
- FX_LPWSTR pStart = (FX_LPWSTR)(FX_LPCWSTR)wsText;
+ FX_WCHAR* pStart = (FX_WCHAR*)(const FX_WCHAR*)wsText;
pStart += iStart;
- FX_LPWSTR pEnd = pStart + iCount - 1;
+ FX_WCHAR* pEnd = pStart + iCount - 1;
while (pStart < pEnd) {
wch = *pStart;
*pStart ++ = *pEnd;
@@ -355,7 +355,7 @@ void FX_BidiClassify(const CFX_WideString &wsText, CFX_Int32Array &classes, FX_B
{
FXSYS_assert(wsText.GetLength() == classes.GetSize());
int32_t iCount = wsText.GetLength();
- FX_LPCWSTR pwsStart = (FX_LPCWSTR)wsText;
+ const FX_WCHAR* pwsStart = (const FX_WCHAR*)wsText;
FX_WCHAR wch;
int32_t iCls;
if (bWS) {
diff --git a/core/src/fxcrt/fx_basic_array.cpp b/core/src/fxcrt/fx_basic_array.cpp
index 315c83e53a..d21909f861 100644
--- a/core/src/fxcrt/fx_basic_array.cpp
+++ b/core/src/fxcrt/fx_basic_array.cpp
@@ -52,7 +52,7 @@ FX_BOOL CFX_BasicArray::SetSize(int nNewSize)
if (!totalSize.IsValid() || nNewMax < m_nSize) {
return FALSE;
}
- FX_LPBYTE pNewData = FX_Realloc(uint8_t, m_pData, totalSize.ValueOrDie());
+ uint8_t* pNewData = FX_Realloc(uint8_t, m_pData, totalSize.ValueOrDie());
if (pNewData == NULL) {
return FALSE;
}
@@ -83,7 +83,7 @@ FX_BOOL CFX_BasicArray::Copy(const CFX_BasicArray& src)
FXSYS_memcpy32(m_pData, src.m_pData, src.m_nSize * m_nUnitSize);
return TRUE;
}
-FX_LPBYTE CFX_BasicArray::InsertSpaceAt(int nIndex, int nCount)
+uint8_t* CFX_BasicArray::InsertSpaceAt(int nIndex, int nCount)
{
if (nIndex < 0 || nCount <= 0) {
return NULL;
@@ -259,7 +259,7 @@ void** CFX_BaseSegmentedArray::GetIndex(int seg_index) const
}
return pSpot;
}
-void* CFX_BaseSegmentedArray::IterateSegment(FX_LPCBYTE pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const
+void* CFX_BaseSegmentedArray::IterateSegment(const uint8_t* pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const
{
for (int i = 0; i < count; i ++) {
if (!callback(param, (void*)(pSegment + i * m_UnitSize))) {
@@ -276,7 +276,7 @@ void* CFX_BaseSegmentedArray::IterateIndex(int level, int& start, void** pIndex,
count = m_SegmentSize;
}
start += count;
- return IterateSegment((FX_LPCBYTE)pIndex, count, callback, param);
+ return IterateSegment((const uint8_t*)pIndex, count, callback, param);
}
for (int i = 0; i < m_IndexSize; i ++) {
if (pIndex[i] == NULL) {
@@ -303,10 +303,10 @@ void* CFX_BaseSegmentedArray::GetAt(int index) const
return NULL;
}
if (m_IndexDepth == 0) {
- return (FX_LPBYTE)m_pIndex + m_UnitSize * index;
+ return (uint8_t*)m_pIndex + m_UnitSize * index;
}
int seg_index = index / m_SegmentSize;
- return (FX_LPBYTE)GetIndex(seg_index)[seg_index % m_IndexSize] + (index % m_SegmentSize) * m_UnitSize;
+ return (uint8_t*)GetIndex(seg_index)[seg_index % m_IndexSize] + (index % m_SegmentSize) * m_UnitSize;
}
void CFX_BaseSegmentedArray::Delete(int index, int count)
{
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index 78698fc6d0..2baeb83b5d 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -22,7 +22,7 @@ static int _Buffer_itoa(char* buf, int i, FX_DWORD flags)
u = -i;
}
int base = 10;
- FX_LPCSTR string = "0123456789abcdef";
+ const FX_CHAR* string = "0123456789abcdef";
if (flags & FXFORMAT_HEX) {
base = 16;
if (flags & FXFORMAT_CAPITAL) {
@@ -81,7 +81,7 @@ CFX_ByteString::~CFX_ByteString()
m_pData->Release();
}
}
-CFX_ByteString::CFX_ByteString(FX_LPCSTR lpsz, FX_STRSIZE nLen)
+CFX_ByteString::CFX_ByteString(const FX_CHAR* lpsz, FX_STRSIZE nLen)
{
if (nLen < 0) {
nLen = lpsz ? FXSYS_strlen(lpsz) : 0;
@@ -95,7 +95,7 @@ CFX_ByteString::CFX_ByteString(FX_LPCSTR lpsz, FX_STRSIZE nLen)
m_pData = NULL;
}
}
-CFX_ByteString::CFX_ByteString(FX_LPCBYTE lpsz, FX_STRSIZE nLen)
+CFX_ByteString::CFX_ByteString(const uint8_t* lpsz, FX_STRSIZE nLen)
{
if (nLen > 0) {
m_pData = StringData::Create(nLen);
@@ -150,7 +150,7 @@ CFX_ByteString::CFX_ByteString(FX_BSTR str1, FX_BSTR str2)
FXSYS_memcpy32(m_pData->m_String + str1.GetLength(), str2.GetCStr(), str2.GetLength());
}
}
-const CFX_ByteString& CFX_ByteString::operator=(FX_LPCSTR lpsz)
+const CFX_ByteString& CFX_ByteString::operator=(const FX_CHAR* lpsz)
{
if (lpsz == NULL || lpsz[0] == 0) {
Empty();
@@ -192,7 +192,7 @@ const CFX_ByteString& CFX_ByteString::operator=(const CFX_BinaryBuf& buf)
Load(buf.GetBuffer(), buf.GetSize());
return *this;
}
-void CFX_ByteString::Load(FX_LPCBYTE buf, FX_STRSIZE len)
+void CFX_ByteString::Load(const uint8_t* buf, FX_STRSIZE len)
{
Empty();
if (len) {
@@ -204,7 +204,7 @@ void CFX_ByteString::Load(FX_LPCBYTE buf, FX_STRSIZE len)
m_pData = NULL;
}
}
-const CFX_ByteString& CFX_ByteString::operator+=(FX_LPCSTR lpsz)
+const CFX_ByteString& CFX_ByteString::operator+=(const FX_CHAR* lpsz)
{
if (lpsz) {
ConcatInPlace(FXSYS_strlen(lpsz), lpsz);
@@ -280,8 +280,8 @@ bool CFX_ByteString::EqualNoCase(FX_BSTR str) const
if (m_pData->m_nDataLength != len) {
return false;
}
- FX_LPCBYTE pThis = (FX_LPCBYTE)m_pData->m_String;
- FX_LPCBYTE pThat = str.GetPtr();
+ const uint8_t* pThis = (const uint8_t*)m_pData->m_String;
+ const uint8_t* pThat = str.GetPtr();
for (FX_STRSIZE i = 0; i < len; i ++) {
if ((*pThis) != (*pThat)) {
uint8_t bThis = *pThis;
@@ -301,7 +301,7 @@ bool CFX_ByteString::EqualNoCase(FX_BSTR str) const
}
return true;
}
-void CFX_ByteString::AssignCopy(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData)
+void CFX_ByteString::AssignCopy(FX_STRSIZE nSrcLen, const FX_CHAR* lpszSrcData)
{
AllocBeforeWrite(nSrcLen);
FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen);
@@ -336,7 +336,7 @@ void CFX_ByteString::ReleaseBuffer(FX_STRSIZE nNewLength)
}
CopyBeforeWrite();
if (nNewLength == -1) {
- nNewLength = FXSYS_strlen((FX_LPCSTR)m_pData->m_String);
+ nNewLength = FXSYS_strlen((const FX_CHAR*)m_pData->m_String);
}
if (nNewLength == 0) {
Empty();
@@ -351,7 +351,7 @@ void CFX_ByteString::Reserve(FX_STRSIZE len)
GetBuffer(len);
ReleaseBuffer(GetLength());
}
-FX_LPSTR CFX_ByteString::GetBuffer(FX_STRSIZE nMinBufLength)
+FX_CHAR* CFX_ByteString::GetBuffer(FX_STRSIZE nMinBufLength)
{
if (m_pData == NULL && nMinBufLength == 0) {
return NULL;
@@ -405,7 +405,7 @@ FX_STRSIZE CFX_ByteString::Delete(FX_STRSIZE nIndex, FX_STRSIZE nCount)
}
return m_pData->m_nDataLength;
}
-void CFX_ByteString::ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData)
+void CFX_ByteString::ConcatInPlace(FX_STRSIZE nSrcLen, const FX_CHAR* lpszSrcData)
{
if (nSrcLen == 0 || lpszSrcData == NULL) {
return;
@@ -426,8 +426,8 @@ void CFX_ByteString::ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData)
m_pData->m_String[m_pData->m_nDataLength] = 0;
}
}
-void CFX_ByteString::ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCSTR lpszSrc1Data,
- FX_STRSIZE nSrc2Len, FX_LPCSTR lpszSrc2Data)
+void CFX_ByteString::ConcatCopy(FX_STRSIZE nSrc1Len, const FX_CHAR* lpszSrc1Data,
+ FX_STRSIZE nSrc2Len, const FX_CHAR* lpszSrc2Data)
{
int nNewLen = nSrc1Len + nSrc2Len;
if (nNewLen <= 0) {
@@ -486,7 +486,7 @@ void CFX_ByteString::AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STR
#define FORCE_ANSI 0x10000
#define FORCE_UNICODE 0x20000
#define FORCE_INT64 0x40000
-void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
+void CFX_ByteString::FormatV(const FX_CHAR* lpszFormat, va_list argList)
{
va_list argListSave;
#if defined(__ARMCC_VERSION) || (!defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_)) || defined(__native_client__)
@@ -495,7 +495,7 @@ void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
argListSave = argList;
#endif
int nMaxLen = 0;
- for (FX_LPCSTR lpsz = lpszFormat; *lpsz != 0; lpsz ++) {
+ for (const FX_CHAR* lpsz = lpszFormat; *lpsz != 0; lpsz ++) {
if (*lpsz != '%' || *(lpsz = lpsz + 1) == '%') {
nMaxLen += FXSYS_strlen(lpsz);
continue;
@@ -579,7 +579,7 @@ void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
va_arg(argList, int);
break;
case 's': {
- FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
+ const FX_CHAR* pstrNextArg = va_arg(argList, const FX_CHAR*);
if (pstrNextArg == NULL) {
nItemLen = 6;
} else {
@@ -591,7 +591,7 @@ void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
}
break;
case 'S': {
- FX_LPWSTR pstrNextArg = va_arg(argList, FX_LPWSTR);
+ FX_WCHAR* pstrNextArg = va_arg(argList, FX_WCHAR*);
if (pstrNextArg == NULL) {
nItemLen = 6;
} else {
@@ -604,7 +604,7 @@ void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
break;
case 's'|FORCE_ANSI:
case 'S'|FORCE_ANSI: {
- FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
+ const FX_CHAR* pstrNextArg = va_arg(argList, const FX_CHAR*);
if (pstrNextArg == NULL) {
nItemLen = 6;
} else {
@@ -617,7 +617,7 @@ void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
break;
case 's'|FORCE_UNICODE:
case 'S'|FORCE_UNICODE: {
- FX_LPWSTR pstrNextArg = va_arg(argList, FX_LPWSTR);
+ FX_WCHAR* pstrNextArg = va_arg(argList, FX_WCHAR*);
if (pstrNextArg == NULL) {
nItemLen = 6;
} else {
@@ -700,7 +700,7 @@ void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
}
va_end(argListSave);
}
-void CFX_ByteString::Format(FX_LPCSTR lpszFormat, ...)
+void CFX_ByteString::Format(const FX_CHAR* lpszFormat, ...)
{
va_list argList;
va_start(argList, lpszFormat);
@@ -720,7 +720,7 @@ FX_STRSIZE CFX_ByteString::Insert(FX_STRSIZE nIndex, FX_CHAR ch)
nNewLength++;
if (m_pData == NULL || m_pData->m_nAllocLength < nNewLength) {
StringData* pOldData = m_pData;
- FX_LPCSTR pstr = m_pData->m_String;
+ const FX_CHAR* pstr = m_pData->m_String;
m_pData = StringData::Create(nNewLength);
if (!m_pData) {
return 0;
@@ -777,7 +777,7 @@ FX_STRSIZE CFX_ByteString::Find(FX_CHAR ch, FX_STRSIZE nStart) const
if (nStart >= nLength) {
return -1;
}
- FX_LPCSTR lpsz = FXSYS_strchr(m_pData->m_String + nStart, ch);
+ const FX_CHAR* lpsz = FXSYS_strchr(m_pData->m_String + nStart, ch);
return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
}
FX_STRSIZE CFX_ByteString::ReverseFind(FX_CHAR ch) const
@@ -794,12 +794,12 @@ FX_STRSIZE CFX_ByteString::ReverseFind(FX_CHAR ch) const
}
return -1;
}
-FX_LPCSTR FX_strstr(FX_LPCSTR str1, int len1, FX_LPCSTR str2, int len2)
+const FX_CHAR* FX_strstr(const FX_CHAR* str1, int len1, const FX_CHAR* str2, int len2)
{
if (len2 > len1 || len2 == 0) {
return NULL;
}
- FX_LPCSTR end_ptr = str1 + len1 - len2;
+ const FX_CHAR* end_ptr = str1 + len1 - len2;
while (str1 <= end_ptr) {
int i = 0;
while (1) {
@@ -824,7 +824,7 @@ FX_STRSIZE CFX_ByteString::Find(FX_BSTR lpszSub, FX_STRSIZE nStart) const
if (nStart > nLength) {
return -1;
}
- FX_LPCSTR lpsz = FX_strstr(m_pData->m_String + nStart, m_pData->m_nDataLength - nStart,
+ const FX_CHAR* lpsz = FX_strstr(m_pData->m_String + nStart, m_pData->m_nDataLength - nStart,
lpszSub.GetCStr(), lpszSub.GetLength());
return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
}
@@ -859,9 +859,9 @@ FX_STRSIZE CFX_ByteString::Remove(FX_CHAR chRemove)
if (GetLength() < 1) {
return 0;
}
- FX_LPSTR pstrSource = m_pData->m_String;
- FX_LPSTR pstrDest = m_pData->m_String;
- FX_LPSTR pstrEnd = m_pData->m_String + m_pData->m_nDataLength;
+ FX_CHAR* pstrSource = m_pData->m_String;
+ FX_CHAR* pstrDest = m_pData->m_String;
+ FX_CHAR* pstrEnd = m_pData->m_String + m_pData->m_nDataLength;
while (pstrSource < pstrEnd) {
if (*pstrSource != chRemove) {
*pstrDest = *pstrSource;
@@ -885,10 +885,10 @@ FX_STRSIZE CFX_ByteString::Replace(FX_BSTR lpszOld, FX_BSTR lpszNew)
FX_STRSIZE nSourceLen = lpszOld.GetLength();
FX_STRSIZE nReplacementLen = lpszNew.GetLength();
FX_STRSIZE nCount = 0;
- FX_LPCSTR pStart = m_pData->m_String;
- FX_LPSTR pEnd = m_pData->m_String + m_pData->m_nDataLength;
+ const FX_CHAR* pStart = m_pData->m_String;
+ FX_CHAR* pEnd = m_pData->m_String + m_pData->m_nDataLength;
while (1) {
- FX_LPCSTR pTarget = FX_strstr(pStart, (FX_STRSIZE)(pEnd - pStart), lpszOld.GetCStr(), nSourceLen);
+ const FX_CHAR* pTarget = FX_strstr(pStart, (FX_STRSIZE)(pEnd - pStart), lpszOld.GetCStr(), nSourceLen);
if (pTarget == NULL) {
break;
}
@@ -908,9 +908,9 @@ FX_STRSIZE CFX_ByteString::Replace(FX_BSTR lpszOld, FX_BSTR lpszNew)
return 0;
}
pStart = m_pData->m_String;
- FX_LPSTR pDest = pNewData->m_String;
+ FX_CHAR* pDest = pNewData->m_String;
for (FX_STRSIZE i = 0; i < nCount; i ++) {
- FX_LPCSTR pTarget = FX_strstr(pStart, (FX_STRSIZE)(pEnd - pStart), lpszOld.GetCStr(), nSourceLen);
+ const FX_CHAR* pTarget = FX_strstr(pStart, (FX_STRSIZE)(pEnd - pStart), lpszOld.GetCStr(), nSourceLen);
FXSYS_memcpy32(pDest, pStart, pTarget - pStart);
pDest += pTarget - pStart;
FXSYS_memcpy32(pDest, lpszNew.GetCStr(), lpszNew.GetLength());
@@ -940,7 +940,7 @@ CFX_WideString CFX_ByteString::UTF8Decode() const
}
return decoder.GetResult();
}
-CFX_ByteString CFX_ByteString::FromUnicode(FX_LPCWSTR str, FX_STRSIZE len)
+CFX_ByteString CFX_ByteString::FromUnicode(const FX_WCHAR* str, FX_STRSIZE len)
{
if (len < 0) {
len = FXSYS_wcslen(str);
@@ -1078,7 +1078,7 @@ FX_DWORD CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const
}
return strid;
}
-FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_LPSTR buf)
+FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_CHAR* buf)
{
buf[0] = '0';
buf[1] = '\0';
diff --git a/core/src/fxcrt/fx_basic_bstring_unittest.cpp b/core/src/fxcrt/fx_basic_bstring_unittest.cpp
index bcdd33b8b8..9d8f376544 100644
--- a/core/src/fxcrt/fx_basic_bstring_unittest.cpp
+++ b/core/src/fxcrt/fx_basic_bstring_unittest.cpp
@@ -278,7 +278,7 @@ TEST(fxcrt, ByteStringCNull) {
EXPECT_EQ(null_string, assigned_null_string);
CFX_ByteStringC assigned_nullptr_string("initially not NULL");
- assigned_nullptr_string = (FX_LPCSTR)nullptr;
+ assigned_nullptr_string = (const FX_CHAR*)nullptr;
EXPECT_EQ(assigned_nullptr_string.GetPtr(), nullptr);
EXPECT_EQ(assigned_nullptr_string.GetLength(), 0);
EXPECT_TRUE(assigned_nullptr_string.IsEmpty());
diff --git a/core/src/fxcrt/fx_basic_buffer.cpp b/core/src/fxcrt/fx_basic_buffer.cpp
index 7d45a43128..f56c4299cc 100644
--- a/core/src/fxcrt/fx_basic_buffer.cpp
+++ b/core/src/fxcrt/fx_basic_buffer.cpp
@@ -5,7 +5,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/fxcrt/fx_basic.h"
-FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf);
+FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf);
CFX_BinaryBuf::CFX_BinaryBuf()
: m_AllocStep(0)
, m_pBuffer(NULL)
@@ -50,7 +50,7 @@ void CFX_BinaryBuf::AttachData(void* buffer, FX_STRSIZE size)
FX_Free(m_pBuffer);
}
m_DataSize = size;
- m_pBuffer = (FX_LPBYTE)buffer;
+ m_pBuffer = (uint8_t*)buffer;
m_AllocSize = size;
}
void CFX_BinaryBuf::TakeOver(CFX_BinaryBuf& other)
@@ -82,7 +82,7 @@ void CFX_BinaryBuf::ExpandBuf(FX_STRSIZE add_size)
alloc_step = m_AllocStep;
}
new_size = (new_size + alloc_step - 1) / alloc_step * alloc_step;
- FX_LPBYTE pNewBuffer = m_pBuffer;
+ uint8_t* pNewBuffer = m_pBuffer;
if (pNewBuffer) {
pNewBuffer = FX_Realloc(uint8_t, m_pBuffer, new_size);
} else {
@@ -202,7 +202,7 @@ CFX_WideTextBuf& CFX_WideTextBuf::operator << (int i)
ExpandBuf(len * sizeof(FX_WCHAR));
}
ASSERT(m_pBuffer != NULL);
- FX_LPWSTR str = (FX_WCHAR*)(m_pBuffer + m_DataSize);
+ FX_WCHAR* str = (FX_WCHAR*)(m_pBuffer + m_DataSize);
for (FX_STRSIZE j = 0; j < len; j ++) {
*str ++ = buf[j];
}
@@ -217,14 +217,14 @@ CFX_WideTextBuf& CFX_WideTextBuf::operator << (double f)
ExpandBuf(len * sizeof(FX_WCHAR));
}
ASSERT(m_pBuffer != NULL);
- FX_LPWSTR str = (FX_WCHAR*)(m_pBuffer + m_DataSize);
+ FX_WCHAR* str = (FX_WCHAR*)(m_pBuffer + m_DataSize);
for (FX_STRSIZE i = 0; i < len; i ++) {
*str ++ = buf[i];
}
m_DataSize += len * sizeof(FX_WCHAR);
return *this;
}
-CFX_WideTextBuf& CFX_WideTextBuf::operator << (FX_LPCWSTR lpsz)
+CFX_WideTextBuf& CFX_WideTextBuf::operator << (const FX_WCHAR* lpsz)
{
AppendBlock(lpsz, FXSYS_wcslen(lpsz)*sizeof(FX_WCHAR));
return *this;
@@ -240,7 +240,7 @@ void CFX_WideTextBuf::operator =(FX_WSTR str)
}
CFX_WideStringC CFX_WideTextBuf::GetWideString() const
{
- return CFX_WideStringC((FX_LPCWSTR)m_pBuffer, m_DataSize / sizeof(FX_WCHAR));
+ return CFX_WideStringC((const FX_WCHAR*)m_pBuffer, m_DataSize / sizeof(FX_WCHAR));
}
CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (uint8_t i)
{
@@ -290,7 +290,7 @@ CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_BSTR bstr)
}
return *this;
}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_LPCWSTR wstr)
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (const FX_WCHAR* wstr)
{
FX_STRSIZE len = FXSYS_wcslen(wstr);
if (m_pStream) {
@@ -315,7 +315,7 @@ void CFX_ArchiveSaver::Write(const void* pData, FX_STRSIZE dwSize)
m_SavingBuf.AppendBlock(pData, dwSize);
}
}
-CFX_ArchiveLoader::CFX_ArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize)
+CFX_ArchiveLoader::CFX_ArchiveLoader(const uint8_t* pData, FX_DWORD dwSize)
{
m_pLoadingBuf = pData;
m_LoadingPos = 0;
@@ -359,7 +359,7 @@ CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (CFX_ByteString& str)
if (len <= 0 || m_LoadingPos + len > m_LoadingSize) {
return *this;
}
- FX_LPSTR buffer = str.GetBuffer(len);
+ FX_CHAR* buffer = str.GetBuffer(len);
FXSYS_memcpy32(buffer, m_pLoadingBuf + m_LoadingPos, len);
str.ReleaseBuffer(len);
m_LoadingPos += len;
@@ -381,7 +381,7 @@ FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize)
m_LoadingPos += dwSize;
return TRUE;
}
-void CFX_BitStream::Init(FX_LPCBYTE pData, FX_DWORD dwSize)
+void CFX_BitStream::Init(const uint8_t* pData, FX_DWORD dwSize)
{
m_pData = pData;
m_BitSize = dwSize * 8;
@@ -455,7 +455,7 @@ int32_t IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
if (!m_pBuffer) {
m_pBuffer = FX_Alloc(uint8_t, m_BufSize);
}
- FX_LPBYTE buffer = (FX_LPBYTE)pBuf;
+ uint8_t* buffer = (uint8_t*)pBuf;
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);
@@ -516,7 +516,7 @@ FX_BOOL CFX_FileBufferArchive::AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeo
m_bTakeover = bTakeover;
return TRUE;
}
-FX_BOOL CFX_FileBufferArchive::AttachFile(FX_LPCWSTR filename)
+FX_BOOL CFX_FileBufferArchive::AttachFile(const FX_WCHAR* filename)
{
if (!filename) {
return FALSE;
@@ -531,7 +531,7 @@ FX_BOOL CFX_FileBufferArchive::AttachFile(FX_LPCWSTR filename)
m_bTakeover = TRUE;
return TRUE;
}
-FX_BOOL CFX_FileBufferArchive::AttachFile(FX_LPCSTR filename)
+FX_BOOL CFX_FileBufferArchive::AttachFile(const FX_CHAR* filename)
{
if (!filename) {
return FALSE;
diff --git a/core/src/fxcrt/fx_basic_gcc.cpp b/core/src/fxcrt/fx_basic_gcc.cpp
index caa99926a6..02a336af75 100644
--- a/core/src/fxcrt/fx_basic_gcc.cpp
+++ b/core/src/fxcrt/fx_basic_gcc.cpp
@@ -58,29 +58,29 @@ STR_T FXSYS_IntToStr(T value, STR_T string, int radix)
#ifdef __cplusplus
extern "C" {
#endif
-int32_t FXSYS_atoi(FX_LPCSTR str)
+int32_t FXSYS_atoi(const FX_CHAR* str)
{
- return FXSYS_StrToInt<int32_t, FX_LPCSTR>(str);
+ return FXSYS_StrToInt<int32_t, const FX_CHAR*>(str);
}
-int32_t FXSYS_wtoi(FX_LPCWSTR str)
+int32_t FXSYS_wtoi(const FX_WCHAR* str)
{
- return FXSYS_StrToInt<int32_t, FX_LPCWSTR>(str);
+ return FXSYS_StrToInt<int32_t, const FX_WCHAR*>(str);
}
-int64_t FXSYS_atoi64(FX_LPCSTR str)
+int64_t FXSYS_atoi64(const FX_CHAR* str)
{
- return FXSYS_StrToInt<int64_t, FX_LPCSTR>(str);
+ return FXSYS_StrToInt<int64_t, const FX_CHAR*>(str);
}
-int64_t FXSYS_wtoi64(FX_LPCWSTR str)
+int64_t FXSYS_wtoi64(const FX_WCHAR* str)
{
- return FXSYS_StrToInt<int64_t, FX_LPCWSTR>(str);
+ return FXSYS_StrToInt<int64_t, const FX_WCHAR*>(str);
}
-FX_LPCSTR FXSYS_i64toa(int64_t value, FX_LPSTR str, int radix)
+const FX_CHAR* FXSYS_i64toa(int64_t value, FX_CHAR* str, int radix)
{
- return FXSYS_IntToStr<int64_t, FX_LPSTR>(value, str, radix);
+ return FXSYS_IntToStr<int64_t, FX_CHAR*>(value, str, radix);
}
-FX_LPCWSTR FXSYS_i64tow(int64_t value, FX_LPWSTR str, int radix)
+const FX_WCHAR* FXSYS_i64tow(int64_t value, FX_WCHAR* str, int radix)
{
- return FXSYS_IntToStr<int64_t, FX_LPWSTR>(value, str, radix);
+ return FXSYS_IntToStr<int64_t, FX_WCHAR*>(value, str, radix);
}
#ifdef __cplusplus
}
@@ -93,7 +93,7 @@ int FXSYS_GetACP()
{
return 0;
}
-FX_DWORD FXSYS_GetFullPathName(FX_LPCSTR filename, FX_DWORD buflen, FX_LPSTR buf, FX_LPSTR* filepart)
+FX_DWORD FXSYS_GetFullPathName(const FX_CHAR* filename, FX_DWORD buflen, FX_CHAR* buf, FX_CHAR** filepart)
{
int srclen = FXSYS_strlen(filename);
if (buf == NULL || (int)buflen < srclen + 1) {
@@ -102,7 +102,7 @@ FX_DWORD FXSYS_GetFullPathName(FX_LPCSTR filename, FX_DWORD buflen, FX_LPSTR buf
FXSYS_strcpy(buf, filename);
return srclen;
}
-FX_DWORD FXSYS_GetModuleFileName(FX_LPVOID hModule, char* buf, FX_DWORD bufsize)
+FX_DWORD FXSYS_GetModuleFileName(void* hModule, char* buf, FX_DWORD bufsize)
{
return (FX_DWORD) - 1;
}
@@ -114,7 +114,7 @@ FX_DWORD FXSYS_GetModuleFileName(FX_LPVOID hModule, char* buf, FX_DWORD bufsize)
#ifdef __cplusplus
extern "C" {
#endif
-FXSYS_FILE* FXSYS_wfopen(FX_LPCWSTR filename, FX_LPCWSTR mode)
+FXSYS_FILE* FXSYS_wfopen(const FX_WCHAR* filename, const FX_WCHAR* mode)
{
return FXSYS_fopen(CFX_ByteString::FromUnicode(filename), CFX_ByteString::FromUnicode(mode));
}
@@ -194,7 +194,7 @@ int FXSYS_wcsicmp(const FX_WCHAR *dst, const FX_WCHAR *src)
}
char* FXSYS_itoa(int value, char* string, int radix)
{
- return FXSYS_IntToStr<int32_t, FX_LPSTR>(value, string, radix);
+ return FXSYS_IntToStr<int32_t, FX_CHAR*>(value, string, radix);
}
#ifdef __cplusplus
}
@@ -204,8 +204,8 @@ char* FXSYS_itoa(int value, char* string, int radix)
#ifdef __cplusplus
extern "C" {
#endif
-int FXSYS_WideCharToMultiByte(FX_DWORD codepage, FX_DWORD dwFlags, FX_LPCWSTR wstr, int wlen,
- FX_LPSTR buf, int buflen, FX_LPCSTR default_str, FX_BOOL* pUseDefault)
+int FXSYS_WideCharToMultiByte(FX_DWORD codepage, FX_DWORD dwFlags, const FX_WCHAR* wstr, int wlen,
+ FX_CHAR* buf, int buflen, const FX_CHAR* default_str, FX_BOOL* pUseDefault)
{
int len = 0;
for (int i = 0; i < wlen; i ++) {
@@ -218,8 +218,8 @@ int FXSYS_WideCharToMultiByte(FX_DWORD codepage, FX_DWORD dwFlags, FX_LPCWSTR ws
}
return len;
}
-int FXSYS_MultiByteToWideChar(FX_DWORD codepage, FX_DWORD dwFlags, FX_LPCSTR bstr, int blen,
- FX_LPWSTR buf, int buflen)
+int FXSYS_MultiByteToWideChar(FX_DWORD codepage, FX_DWORD dwFlags, const FX_CHAR* bstr, int blen,
+ FX_WCHAR* buf, int buflen)
{
int wlen = 0;
for (int i = 0; i < blen; i ++) {
diff --git a/core/src/fxcrt/fx_basic_maps.cpp b/core/src/fxcrt/fx_basic_maps.cpp
index c0c394583e..7df4cdb8ed 100644
--- a/core/src/fxcrt/fx_basic_maps.cpp
+++ b/core/src/fxcrt/fx_basic_maps.cpp
@@ -238,7 +238,7 @@ void CFX_MapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition,
rKey = pAssocRet->key;
rValue = pAssocRet->value;
}
-FX_LPVOID CFX_MapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const
+void* CFX_MapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const
{
ASSERT(m_pHashTable != NULL);
CAssoc* pAssocRet = (CAssoc*)rNextPosition;
@@ -352,7 +352,7 @@ inline FX_DWORD CFX_MapByteStringToPtr::HashKey(FX_BSTR key) const
{
FX_DWORD nHash = 0;
int len = key.GetLength();
- FX_LPCBYTE buf = key.GetPtr();
+ const uint8_t* buf = key.GetPtr();
for (int i = 0; i < len; i ++) {
nHash = (nHash << 5) + nHash + buf[i];
}
@@ -381,7 +381,7 @@ struct _CompactString {
uint8_t m_LenHigh;
uint8_t m_LenLow;
uint8_t m_Unused;
- FX_LPBYTE m_pBuffer;
+ uint8_t* m_pBuffer;
};
static void _CompactStringRelease(_CompactString* pCompact)
{
@@ -389,7 +389,7 @@ static void _CompactStringRelease(_CompactString* pCompact)
FX_Free(pCompact->m_pBuffer);
}
}
-static FX_BOOL _CompactStringSame(_CompactString* pCompact, FX_LPCBYTE pStr, int len)
+static FX_BOOL _CompactStringSame(_CompactString* pCompact, const uint8_t* pStr, int len)
{
if (len < sizeof(_CompactString)) {
if (pCompact->m_CompactLen != len) {
@@ -402,7 +402,7 @@ static FX_BOOL _CompactStringSame(_CompactString* pCompact, FX_LPCBYTE pStr, int
}
return FXSYS_memcmp32(pCompact->m_pBuffer, pStr, len) == 0;
}
-static void _CompactStringStore(_CompactString* pCompact, FX_LPCBYTE pStr, int len)
+static void _CompactStringStore(_CompactString* pCompact, const uint8_t* pStr, int len)
{
if (len < (int)sizeof(_CompactString)) {
pCompact->m_CompactLen = (uint8_t)len;
@@ -475,14 +475,14 @@ void CFX_CMapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteS
}
rNextPosition = NULL;
}
-FX_LPVOID CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const
+void* CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const
{
if (rNextPosition == NULL) {
return NULL;
}
int index = (int)(uintptr_t)rNextPosition - 1;
_CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
- FX_LPVOID rValue = *(void**)(pKey + 1);
+ void* rValue = *(void**)(pKey + 1);
index ++;
int size = m_Buffer.GetSize();
while (index < size) {
@@ -580,7 +580,7 @@ struct _DWordPair {
};
FX_BOOL CFX_CMapDWordToDWord::Lookup(FX_DWORD key, FX_DWORD& value) const
{
- FX_LPVOID pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_DWordPair),
+ void* pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_DWordPair),
sizeof(_DWordPair), _CompareDWord);
if (pResult == NULL) {
return FALSE;
diff --git a/core/src/fxcrt/fx_basic_memmgr.cpp b/core/src/fxcrt/fx_basic_memmgr.cpp
index a381fa4ef5..2ae9075f04 100644
--- a/core/src/fxcrt/fx_basic_memmgr.cpp
+++ b/core/src/fxcrt/fx_basic_memmgr.cpp
@@ -56,7 +56,7 @@ void* CFX_GrowOnlyPool::Alloc(size_t size)
_FX_GrowOnlyTrunk* pTrunk = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
while (pTrunk) {
if (pTrunk->m_Size - pTrunk->m_Allocated >= size) {
- void* p = (FX_LPBYTE)(pTrunk + 1) + pTrunk->m_Allocated;
+ void* p = (uint8_t*)(pTrunk + 1) + pTrunk->m_Allocated;
pTrunk->m_Allocated += size;
return p;
}
diff --git a/core/src/fxcrt/fx_basic_utf.cpp b/core/src/fxcrt/fx_basic_utf.cpp
index 1422b7abd4..5413ead0d5 100644
--- a/core/src/fxcrt/fx_basic_utf.cpp
+++ b/core/src/fxcrt/fx_basic_utf.cpp
@@ -76,7 +76,7 @@ void CFX_UTF8Encoder::Input(FX_WCHAR unicode)
}
}
}
-CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len)
+CFX_ByteString FX_UTF8Encode(const FX_WCHAR* pwsStr, FX_STRSIZE len)
{
FXSYS_assert(pwsStr != NULL);
if (len < 0) {
diff --git a/core/src/fxcrt/fx_basic_util.cpp b/core/src/fxcrt/fx_basic_util.cpp
index 615b297421..5870baa020 100644
--- a/core/src/fxcrt/fx_basic_util.cpp
+++ b/core/src/fxcrt/fx_basic_util.cpp
@@ -26,7 +26,7 @@ void FX_PRIVATEDATA::FreeData()
m_pCallback(m_pData);
}
}
-void CFX_PrivateData::AddData(FX_LPVOID pModuleId, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct)
+void CFX_PrivateData::AddData(void* pModuleId, void* pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct)
{
if (pModuleId == NULL) {
return;
@@ -44,15 +44,15 @@ void CFX_PrivateData::AddData(FX_LPVOID pModuleId, FX_LPVOID pData, PD_CALLBACK_
FX_PRIVATEDATA data = {pModuleId, pData, callback, bSelfDestruct};
m_DataList.Add(data);
}
-void CFX_PrivateData::SetPrivateData(FX_LPVOID pModuleId, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback)
+void CFX_PrivateData::SetPrivateData(void* pModuleId, void* pData, PD_CALLBACK_FREEDATA callback)
{
AddData(pModuleId, pData, callback, FALSE);
}
-void CFX_PrivateData::SetPrivateObj(FX_LPVOID pModuleId, CFX_DestructObject* pObj)
+void CFX_PrivateData::SetPrivateObj(void* pModuleId, CFX_DestructObject* pObj)
{
AddData(pModuleId, pObj, NULL, TRUE);
}
-FX_BOOL CFX_PrivateData::RemovePrivateData(FX_LPVOID pModuleId)
+FX_BOOL CFX_PrivateData::RemovePrivateData(void* pModuleId)
{
if (pModuleId == NULL) {
return FALSE;
@@ -67,7 +67,7 @@ FX_BOOL CFX_PrivateData::RemovePrivateData(FX_LPVOID pModuleId)
}
return FALSE;
}
-FX_LPVOID CFX_PrivateData::GetPrivateData(FX_LPVOID pModuleId)
+void* CFX_PrivateData::GetPrivateData(void* pModuleId)
{
if (pModuleId == NULL) {
return NULL;
@@ -95,7 +95,7 @@ void FX_atonum(FX_BSTR strc, FX_BOOL& bInteger, void* pData)
if (FXSYS_memchr(strc.GetPtr(), '.', strc.GetLength()) == NULL) {
bInteger = TRUE;
int cc = 0, integer = 0;
- FX_LPCSTR str = strc.GetCStr();
+ const FX_CHAR* str = strc.GetCStr();
int len = strc.GetLength();
FX_BOOL bNegative = FALSE;
if (str[0] == '+') {
@@ -130,7 +130,7 @@ FX_FLOAT FX_atof(FX_BSTR strc)
}
int cc = 0;
FX_BOOL bNegative = FALSE;
- FX_LPCSTR str = strc.GetCStr();
+ const FX_CHAR* str = strc.GetCStr();
int len = strc.GetLength();
if (str[0] == '+') {
cc++;
@@ -314,7 +314,7 @@ public:
WIN32_FIND_DATAW m_FindData;
};
#endif
-void* FX_OpenFolder(FX_LPCSTR path)
+void* FX_OpenFolder(const FX_CHAR* path)
{
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
#ifndef _WIN32_WCE
@@ -345,7 +345,7 @@ void* FX_OpenFolder(FX_LPCSTR path)
return dir;
#endif
}
-void* FX_OpenFolder(FX_LPCWSTR path)
+void* FX_OpenFolder(const FX_WCHAR* path)
{
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
CFindFileDataW* pData = FX_NEW CFindFileDataW;
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index aeb366338e..1108a3ca52 100644
--- a/core/src/fxcrt/fx_basic_wstring.cpp
+++ b/core/src/fxcrt/fx_basic_wstring.cpp
@@ -56,7 +56,7 @@ CFX_WideString::CFX_WideString(const CFX_WideString& stringSrc)
*this = stringSrc;
}
}
-CFX_WideString::CFX_WideString(FX_LPCWSTR lpsz, FX_STRSIZE nLen) {
+CFX_WideString::CFX_WideString(const FX_WCHAR* lpsz, FX_STRSIZE nLen) {
if (nLen < 0) {
nLen = lpsz ? FXSYS_wcslen(lpsz) : 0;
}
@@ -117,7 +117,7 @@ void CFX_WideString::ReleaseBuffer(FX_STRSIZE nNewLength)
m_pData->m_nDataLength = nNewLength;
m_pData->m_String[nNewLength] = 0;
}
-const CFX_WideString& CFX_WideString::operator=(FX_LPCWSTR lpsz)
+const CFX_WideString& CFX_WideString::operator=(const FX_WCHAR* lpsz)
{
if (lpsz == NULL || lpsz[0] == 0) {
Empty();
@@ -159,7 +159,7 @@ const CFX_WideString& CFX_WideString::operator+=(FX_WCHAR ch)
ConcatInPlace(1, &ch);
return *this;
}
-const CFX_WideString& CFX_WideString::operator+=(FX_LPCWSTR lpsz)
+const CFX_WideString& CFX_WideString::operator+=(const FX_WCHAR* lpsz)
{
if (lpsz) {
ConcatInPlace(FXSYS_wcslen(lpsz), lpsz);
@@ -221,7 +221,7 @@ void CFX_WideString::Empty()
m_pData = NULL;
}
}
-void CFX_WideString::ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData)
+void CFX_WideString::ConcatInPlace(FX_STRSIZE nSrcLen, const FX_WCHAR* lpszSrcData)
{
if (nSrcLen == 0 || lpszSrcData == NULL) {
return;
@@ -241,8 +241,8 @@ void CFX_WideString::ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData)
m_pData->m_String[m_pData->m_nDataLength] = 0;
}
}
-void CFX_WideString::ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCWSTR lpszSrc1Data,
- FX_STRSIZE nSrc2Len, FX_LPCWSTR lpszSrc2Data)
+void CFX_WideString::ConcatCopy(FX_STRSIZE nSrc1Len, const FX_WCHAR* lpszSrc1Data,
+ FX_STRSIZE nSrc2Len, const FX_WCHAR* lpszSrc2Data)
{
FX_STRSIZE nNewLen = nSrc1Len + nSrc2Len;
if (nNewLen <= 0) {
@@ -278,14 +278,14 @@ void CFX_WideString::AllocBeforeWrite(FX_STRSIZE nLen)
Empty();
m_pData = StringData::Create(nLen);
}
-void CFX_WideString::AssignCopy(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData)
+void CFX_WideString::AssignCopy(FX_STRSIZE nSrcLen, const FX_WCHAR* lpszSrcData)
{
AllocBeforeWrite(nSrcLen);
FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(FX_WCHAR));
m_pData->m_nDataLength = nSrcLen;
m_pData->m_String[nSrcLen] = 0;
}
-int CFX_WideString::Compare(FX_LPCWSTR lpsz) const
+int CFX_WideString::Compare(const FX_WCHAR* lpsz) const
{
if (m_pData == NULL) {
return (lpsz == NULL || lpsz[0] == 0) ? 0 : -1;
@@ -303,7 +303,7 @@ CFX_ByteString CFX_WideString::UTF16LE_Encode() const
}
int len = m_pData->m_nDataLength;
CFX_ByteString result;
- FX_LPSTR buffer = result.GetBuffer(len * 2 + 2);
+ FX_CHAR* buffer = result.GetBuffer(len * 2 + 2);
for (int i = 0; i < len; i ++) {
buffer[i * 2] = m_pData->m_String[i] & 0xff;
buffer[i * 2 + 1] = m_pData->m_String[i] >> 8;
@@ -325,7 +325,7 @@ void CFX_WideString::Reserve(FX_STRSIZE len)
GetBuffer(len);
ReleaseBuffer(GetLength());
}
-FX_LPWSTR CFX_WideString::GetBuffer(FX_STRSIZE nMinBufLength)
+FX_WCHAR* CFX_WideString::GetBuffer(FX_STRSIZE nMinBufLength)
{
if (m_pData == NULL && nMinBufLength == 0) {
return NULL;
@@ -471,7 +471,7 @@ CFX_WideString CFX_WideString::Right(FX_STRSIZE nCount) const
AllocCopy(dest, nCount, m_pData->m_nDataLength - nCount);
return dest;
}
-int CFX_WideString::CompareNoCase(FX_LPCWSTR lpsz) const
+int CFX_WideString::CompareNoCase(const FX_WCHAR* lpsz) const
{
if (m_pData == NULL) {
return (lpsz == NULL || lpsz[0] == 0) ? 0 : -1;
@@ -537,13 +537,13 @@ void CFX_WideString::MakeUpper()
}
FXSYS_wcsupr(m_pData->m_String);
}
-FX_STRSIZE CFX_WideString::Find(FX_LPCWSTR lpszSub, FX_STRSIZE nStart) const
+FX_STRSIZE CFX_WideString::Find(const FX_WCHAR* lpszSub, FX_STRSIZE nStart) const
{
FX_STRSIZE nLength = GetLength();
if (nLength < 1 || nStart > nLength) {
return -1;
}
- FX_LPCWSTR lpsz = FXSYS_wcsstr(m_pData->m_String + nStart, lpszSub);
+ const FX_WCHAR* lpsz = FXSYS_wcsstr(m_pData->m_String + nStart, lpszSub);
return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
}
FX_STRSIZE CFX_WideString::Find(FX_WCHAR ch, FX_STRSIZE nStart) const
@@ -555,10 +555,10 @@ FX_STRSIZE CFX_WideString::Find(FX_WCHAR ch, FX_STRSIZE nStart) const
if (nStart >= nLength) {
return -1;
}
- FX_LPCWSTR lpsz = FXSYS_wcschr(m_pData->m_String + nStart, ch);
+ const FX_WCHAR* lpsz = FXSYS_wcschr(m_pData->m_String + nStart, ch);
return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
}
-void CFX_WideString::TrimRight(FX_LPCWSTR lpszTargetList)
+void CFX_WideString::TrimRight(const FX_WCHAR* lpszTargetList)
{
FXSYS_assert(lpszTargetList != NULL);
if (m_pData == NULL || *lpszTargetList == 0) {
@@ -590,7 +590,7 @@ void CFX_WideString::TrimRight()
{
TrimRight(L"\x09\x0a\x0b\x0c\x0d\x20");
}
-void CFX_WideString::TrimLeft(FX_LPCWSTR lpszTargets)
+void CFX_WideString::TrimLeft(const FX_WCHAR* lpszTargets)
{
FXSYS_assert(lpszTargets != NULL);
if (m_pData == NULL || *lpszTargets == 0) {
@@ -600,7 +600,7 @@ void CFX_WideString::TrimLeft(FX_LPCWSTR lpszTargets)
if (GetLength() < 1) {
return;
}
- FX_LPCWSTR lpsz = m_pData->m_String;
+ const FX_WCHAR* lpsz = m_pData->m_String;
while (*lpsz != 0) {
if (FXSYS_wcschr(lpszTargets, *lpsz) == NULL) {
break;
@@ -622,7 +622,7 @@ void CFX_WideString::TrimLeft()
{
TrimLeft(L"\x09\x0a\x0b\x0c\x0d\x20");
}
-FX_STRSIZE CFX_WideString::Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew)
+FX_STRSIZE CFX_WideString::Replace(const FX_WCHAR* lpszOld, const FX_WCHAR* lpszNew)
{
if (GetLength() < 1) {
return 0;
@@ -636,11 +636,11 @@ FX_STRSIZE CFX_WideString::Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew)
}
FX_STRSIZE nReplacementLen = lpszNew ? FXSYS_wcslen(lpszNew) : 0;
FX_STRSIZE nCount = 0;
- FX_LPWSTR lpszStart = m_pData->m_String;
- FX_LPWSTR lpszEnd = m_pData->m_String + m_pData->m_nDataLength;
- FX_LPWSTR lpszTarget;
+ FX_WCHAR* lpszStart = m_pData->m_String;
+ FX_WCHAR* lpszEnd = m_pData->m_String + m_pData->m_nDataLength;
+ FX_WCHAR* lpszTarget;
{
- while ((lpszTarget = (FX_LPWSTR)FXSYS_wcsstr(lpszStart, lpszOld)) != NULL && lpszStart < lpszEnd) {
+ while ((lpszTarget = (FX_WCHAR*)FXSYS_wcsstr(lpszStart, lpszOld)) != NULL && lpszStart < lpszEnd) {
nCount++;
lpszStart = lpszTarget + nSourceLen;
}
@@ -651,7 +651,7 @@ FX_STRSIZE CFX_WideString::Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew)
FX_STRSIZE nNewLength = nOldLength + (nReplacementLen - nSourceLen) * nCount;
if (m_pData->m_nAllocLength < nNewLength || m_pData->m_nRefs > 1) {
StringData* pOldData = m_pData;
- FX_LPCWSTR pstr = m_pData->m_String;
+ const FX_WCHAR* pstr = m_pData->m_String;
m_pData = StringData::Create(nNewLength);
if (!m_pData) {
return 0;
@@ -662,7 +662,7 @@ FX_STRSIZE CFX_WideString::Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew)
lpszStart = m_pData->m_String;
lpszEnd = m_pData->m_String + FX_MAX(m_pData->m_nDataLength, nNewLength);
{
- while ((lpszTarget = (FX_LPWSTR)FXSYS_wcsstr(lpszStart, lpszOld)) != NULL && lpszStart < lpszEnd) {
+ 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));
@@ -689,7 +689,7 @@ FX_STRSIZE CFX_WideString::Insert(FX_STRSIZE nIndex, FX_WCHAR ch)
nNewLength++;
if (m_pData == NULL || m_pData->m_nAllocLength < nNewLength) {
StringData* pOldData = m_pData;
- FX_LPCWSTR pstr = m_pData->m_String;
+ const FX_WCHAR* pstr = m_pData->m_String;
m_pData = StringData::Create(nNewLength);
if (!m_pData) {
return 0;
@@ -734,9 +734,9 @@ FX_STRSIZE CFX_WideString::Remove(FX_WCHAR chRemove)
if (GetLength() < 1) {
return 0;
}
- FX_LPWSTR pstrSource = m_pData->m_String;
- FX_LPWSTR pstrDest = m_pData->m_String;
- FX_LPWSTR pstrEnd = m_pData->m_String + m_pData->m_nDataLength;
+ FX_WCHAR* pstrSource = m_pData->m_String;
+ FX_WCHAR* pstrDest = m_pData->m_String;
+ FX_WCHAR* pstrEnd = m_pData->m_String + m_pData->m_nDataLength;
while (pstrSource < pstrEnd) {
if (*pstrSource != chRemove) {
*pstrDest = *pstrSource;
@@ -752,7 +752,7 @@ FX_STRSIZE CFX_WideString::Remove(FX_WCHAR chRemove)
#define FORCE_ANSI 0x10000
#define FORCE_UNICODE 0x20000
#define FORCE_INT64 0x40000
-void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
+void CFX_WideString::FormatV(const FX_WCHAR* lpszFormat, va_list argList)
{
va_list argListSave;
#if defined(__ARMCC_VERSION) || (!defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_)) || defined(__native_client__)
@@ -761,7 +761,7 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
argListSave = argList;
#endif
int nMaxLen = 0;
- for (FX_LPCWSTR lpsz = lpszFormat; *lpsz != 0; lpsz ++) {
+ for (const FX_WCHAR* lpsz = lpszFormat; *lpsz != 0; lpsz ++) {
if (*lpsz != '%' || *(lpsz = lpsz + 1) == '%') {
nMaxLen += FXSYS_wcslen(lpsz);
continue;
@@ -845,7 +845,7 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
va_arg(argList, int);
break;
case 's': {
- FX_LPCWSTR pstrNextArg = va_arg(argList, FX_LPCWSTR);
+ const FX_WCHAR* pstrNextArg = va_arg(argList, const FX_WCHAR*);
if (pstrNextArg == NULL) {
nItemLen = 6;
} else {
@@ -857,7 +857,7 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
}
break;
case 'S': {
- FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
+ const FX_CHAR* pstrNextArg = va_arg(argList, const FX_CHAR*);
if (pstrNextArg == NULL) {
nItemLen = 6;
} else {
@@ -870,7 +870,7 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
break;
case 's'|FORCE_ANSI:
case 'S'|FORCE_ANSI: {
- FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
+ const FX_CHAR* pstrNextArg = va_arg(argList, const FX_CHAR*);
if (pstrNextArg == NULL) {
nItemLen = 6;
} else {
@@ -883,7 +883,7 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
break;
case 's'|FORCE_UNICODE:
case 'S'|FORCE_UNICODE: {
- FX_LPWSTR pstrNextArg = va_arg(argList, FX_LPWSTR);
+ FX_WCHAR* pstrNextArg = va_arg(argList, FX_WCHAR*);
if (pstrNextArg == NULL) {
nItemLen = 6;
} else {
@@ -964,14 +964,14 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
}
va_end(argListSave);
}
-void CFX_WideString::Format(FX_LPCWSTR lpszFormat, ...)
+void CFX_WideString::Format(const FX_WCHAR* lpszFormat, ...)
{
va_list argList;
va_start(argList, lpszFormat);
FormatV(lpszFormat, argList);
va_end(argList);
}
-FX_FLOAT FX_wtof(FX_LPCWSTR str, int len)
+FX_FLOAT FX_wtof(const FX_WCHAR* str, int len)
{
if (len == 0) {
return 0.0;
@@ -1028,7 +1028,7 @@ static CFX_ByteString _DefMap_GetByteString(CFX_CharMap* pCharMap, const CFX_Wid
return CFX_ByteString();
}
CFX_ByteString bytestr;
- FX_LPSTR dest_buf = bytestr.GetBuffer(dest_len);
+ FX_CHAR* dest_buf = bytestr.GetBuffer(dest_len);
FXSYS_WideCharToMultiByte(codepage, 0, widestr.c_str(), src_len, dest_buf, dest_len, NULL, NULL);
bytestr.ReleaseBuffer(dest_len);
return bytestr;
@@ -1042,7 +1042,7 @@ static CFX_WideString _DefMap_GetWideString(CFX_CharMap* pCharMap, const CFX_Byt
return CFX_WideString();
}
CFX_WideString widestr;
- FX_LPWSTR dest_buf = widestr.GetBuffer(dest_len);
+ FX_WCHAR* dest_buf = widestr.GetBuffer(dest_len);
FXSYS_MultiByteToWideChar(codepage, 0, bytestr, src_len, dest_buf, dest_len);
widestr.ReleaseBuffer(dest_len);
return widestr;
diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp
index 9490f3603c..21aeffddc6 100644
--- a/core/src/fxcrt/fx_extension.cpp
+++ b/core/src/fxcrt/fx_extension.cpp
@@ -80,19 +80,19 @@ FX_BOOL FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile)
FXSYS_assert(hFile != NULL);
return ((IFXCRT_FileAccess*)hFile)->Truncate(szFile);
}
-IFX_FileAccess* FX_CreateDefaultFileAccess(FX_WSTR wsPath)
-{
- if (wsPath.GetLength() == 0)
- return NULL;
-
- CFX_CRTFileAccess* pFA = NULL;
- pFA = FX_NEW CFX_CRTFileAccess;
- if (NULL == pFA) return NULL;
-
- pFA->Init(wsPath);
- return pFA;
-}
-IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes)
+IFX_FileAccess* FX_CreateDefaultFileAccess(FX_WSTR wsPath)
+{
+ if (wsPath.GetLength() == 0)
+ return NULL;
+
+ CFX_CRTFileAccess* pFA = NULL;
+ pFA = FX_NEW CFX_CRTFileAccess;
+ if (NULL == pFA) return NULL;
+
+ pFA->Init(wsPath);
+ return pFA;
+}
+IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes)
{
IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create();
if (!pFA) {
@@ -104,7 +104,7 @@ IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes)
}
return FX_NEW CFX_CRTFileStream(pFA);
}
-IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes)
+IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes)
{
IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create();
if (!pFA) {
@@ -116,23 +116,23 @@ IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes)
}
return FX_NEW CFX_CRTFileStream(pFA);
}
-IFX_FileWrite* FX_CreateFileWrite(FX_LPCSTR filename)
+IFX_FileWrite* FX_CreateFileWrite(const FX_CHAR* filename)
{
return FX_CreateFileStream(filename, FX_FILEMODE_Truncate);
}
-IFX_FileWrite* FX_CreateFileWrite(FX_LPCWSTR filename)
+IFX_FileWrite* FX_CreateFileWrite(const FX_WCHAR* filename)
{
return FX_CreateFileStream(filename, FX_FILEMODE_Truncate);
}
-IFX_FileRead* FX_CreateFileRead(FX_LPCSTR filename)
+IFX_FileRead* FX_CreateFileRead(const FX_CHAR* filename)
{
return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly);
}
-IFX_FileRead* FX_CreateFileRead(FX_LPCWSTR filename)
+IFX_FileRead* FX_CreateFileRead(const FX_WCHAR* filename)
{
return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly);
}
-IFX_MemoryStream* FX_CreateMemoryStream(FX_LPBYTE pBuffer, size_t dwSize, FX_BOOL bTakeOver)
+IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, size_t dwSize, FX_BOOL bTakeOver)
{
return FX_NEW CFX_MemoryStream(pBuffer, dwSize, bTakeOver);
}
@@ -151,7 +151,7 @@ FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x)
{
return FXSYS_log(x) / FXSYS_log(b);
}
-FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, int32_t iLength, int32_t *pUsedLen)
+FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr, int32_t iLength, int32_t *pUsedLen)
{
FXSYS_assert(pcsStr != NULL);
if (iLength < 0) {
@@ -160,7 +160,7 @@ FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, int32_t iLength, int32_t *pUsedLen)
CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength);
return FXSYS_wcstof(ws.c_str(), iLength, pUsedLen);
}
-FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, int32_t iLength, int32_t *pUsedLen)
+FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr, int32_t iLength, int32_t *pUsedLen)
{
FXSYS_assert(pwsStr != NULL);
if (iLength < 0) {
@@ -205,7 +205,7 @@ FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, int32_t iLength, int32_t *pUsedLen)
}
return bNegtive ? -fValue : fValue;
}
-FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count)
+FX_WCHAR* FXSYS_wcsncpy(FX_WCHAR* dstStr, const FX_WCHAR* srcStr, size_t count)
{
FXSYS_assert(dstStr != NULL && srcStr != NULL && count > 0);
for (size_t i = 0; i < count; ++i)
@@ -214,7 +214,7 @@ FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count)
}
return dstStr;
}
-int32_t FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
+int32_t FXSYS_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count)
{
FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
FX_WCHAR wch1 = 0, wch2 = 0;
@@ -227,7 +227,7 @@ int32_t FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
}
return wch1 - wch2;
}
-int32_t FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
+int32_t FXSYS_strnicmp(const FX_CHAR* s1, const FX_CHAR* s2, size_t count)
{
FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
FX_CHAR ch1 = 0, ch2 = 0;
@@ -240,13 +240,13 @@ int32_t FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
}
return ch1 - ch2;
}
-FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase)
+FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
iLength = (int32_t)FXSYS_strlen(pStr);
}
- FX_LPCSTR pStrEnd = pStr + iLength;
+ const FX_CHAR* pStrEnd = pStr + iLength;
FX_DWORD dwHashCode = 0;
if (bIgnoreCase) {
while (pStr < pStrEnd) {
@@ -259,13 +259,13 @@ FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, int32_t iLength, FX_BOOL bIgnor
}
return dwHashCode;
}
-FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase)
+FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
iLength = (int32_t)FXSYS_wcslen(pStr);
}
- FX_LPCWSTR pStrEnd = pStr + iLength;
+ const FX_WCHAR* pStrEnd = pStr + iLength;
FX_DWORD dwHashCode = 0;
if (bIgnoreCase) {
while (pStr < pStrEnd) {
@@ -284,26 +284,26 @@ FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, int32_t iLength, FX_BOOL bIgno
#ifdef __cplusplus
extern "C" {
#endif
-FX_LPVOID FX_Random_MT_Start(FX_DWORD dwSeed)
+void* FX_Random_MT_Start(FX_DWORD dwSeed)
{
FX_LPMTRANDOMCONTEXT pContext = FX_Alloc(FX_MTRANDOMCONTEXT, 1);
pContext->mt[0] = dwSeed;
FX_DWORD &i = pContext->mti;
- FX_LPDWORD pBuf = pContext->mt;
+ FX_DWORD* pBuf = pContext->mt;
for (i = 1; i < MT_N; i ++) {
pBuf[i] = (1812433253UL * (pBuf[i - 1] ^ (pBuf[i - 1] >> 30)) + i);
}
pContext->bHaveSeed = TRUE;
return pContext;
}
-FX_DWORD FX_Random_MT_Generate(FX_LPVOID pContext)
+FX_DWORD FX_Random_MT_Generate(void* pContext)
{
FXSYS_assert(pContext != NULL);
FX_LPMTRANDOMCONTEXT pMTC = (FX_LPMTRANDOMCONTEXT)pContext;
FX_DWORD v;
static FX_DWORD mag[2] = {0, MT_Matrix_A};
FX_DWORD &mti = pMTC->mti;
- FX_LPDWORD pBuf = pMTC->mt;
+ FX_DWORD* pBuf = pMTC->mt;
if ((int)mti < 0 || mti >= MT_N) {
if (mti > MT_N && !pMTC->bHaveSeed) {
return 0;
@@ -328,12 +328,12 @@ FX_DWORD FX_Random_MT_Generate(FX_LPVOID pContext)
v ^= (v >> 18);
return v;
}
-void FX_Random_MT_Close(FX_LPVOID pContext)
+void FX_Random_MT_Close(void* pContext)
{
FXSYS_assert(pContext != NULL);
FX_Free(pContext);
}
-void FX_Random_GenerateMT(FX_LPDWORD pBuffer, int32_t iCount)
+void FX_Random_GenerateMT(FX_DWORD* pBuffer, int32_t iCount)
{
FX_DWORD dwSeed;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
@@ -343,13 +343,13 @@ void FX_Random_GenerateMT(FX_LPDWORD pBuffer, int32_t iCount)
#else
FX_Random_GenerateBase(&dwSeed, 1);
#endif
- FX_LPVOID pContext = FX_Random_MT_Start(dwSeed);
+ void* pContext = FX_Random_MT_Start(dwSeed);
while (iCount -- > 0) {
*pBuffer ++ = FX_Random_MT_Generate(pContext);
}
FX_Random_MT_Close(pContext);
}
-void FX_Random_GenerateBase(FX_LPDWORD pBuffer, int32_t iCount)
+void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount)
{
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
SYSTEMTIME st1, st2;
@@ -357,8 +357,8 @@ void FX_Random_GenerateBase(FX_LPDWORD pBuffer, int32_t iCount)
do {
::GetSystemTime(&st2);
} while (FXSYS_memcmp32(&st1, &st2, sizeof(SYSTEMTIME)) == 0);
- FX_DWORD dwHash1 = FX_HashCode_String_GetA((FX_LPCSTR)&st1, sizeof(st1), TRUE);
- FX_DWORD dwHash2 = FX_HashCode_String_GetA((FX_LPCSTR)&st2, sizeof(st2), TRUE);
+ 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);
#else
time_t tmLast = time(NULL), tmCur;
@@ -370,18 +370,18 @@ void FX_Random_GenerateBase(FX_LPDWORD pBuffer, int32_t iCount)
}
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, int32_t iCount)
+FX_BOOL FX_GenerateCryptoRandom(FX_DWORD* pBuffer, int32_t iCount)
{
HCRYPTPROV hCP = NULL;
if (!::CryptAcquireContext(&hCP, NULL, NULL, PROV_RSA_FULL, 0) || hCP == NULL) {
return FALSE;
}
- ::CryptGenRandom(hCP, iCount * sizeof(FX_DWORD), (FX_LPBYTE)pBuffer);
+ ::CryptGenRandom(hCP, iCount * sizeof(FX_DWORD), (uint8_t*)pBuffer);
::CryptReleaseContext(hCP, 0);
return TRUE;
}
#endif
-void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, int32_t iCount)
+void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount)
{
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
FX_GenerateCryptoRandom(pBuffer, iCount);
@@ -399,25 +399,25 @@ void FX_GUID_CreateV4(FX_LPGUID pGUID)
{
#if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_)
#ifdef _FX_WINAPI_PARTITION_DESKTOP_
- if (!FX_GenerateCryptoRandom((FX_LPDWORD)pGUID, 4)) {
- FX_Random_GenerateMT((FX_LPDWORD)pGUID, 4);
+ if (!FX_GenerateCryptoRandom((FX_DWORD*)pGUID, 4)) {
+ FX_Random_GenerateMT((FX_DWORD*)pGUID, 4);
}
#else
- FX_Random_GenerateMT((FX_LPDWORD)pGUID, 4);
+ FX_Random_GenerateMT((FX_DWORD*)pGUID, 4);
#endif
#else
- FX_Random_GenerateMT((FX_LPDWORD)pGUID, 4);
+ FX_Random_GenerateMT((FX_DWORD*)pGUID, 4);
#endif
- uint8_t &b = ((FX_LPBYTE)pGUID)[6];
+ uint8_t &b = ((uint8_t*)pGUID)[6];
b = (b & 0x0F) | 0x40;
}
-FX_LPCSTR gs_FX_pHexChars = "0123456789ABCDEF";
+const FX_CHAR* gs_FX_pHexChars = "0123456789ABCDEF";
void FX_GUID_ToString(FX_LPCGUID pGUID, CFX_ByteString &bsStr, FX_BOOL bSeparator)
{
- FX_LPSTR pBuf = bsStr.GetBuffer(40);
+ FX_CHAR* pBuf = bsStr.GetBuffer(40);
uint8_t b;
for (int32_t i = 0; i < 16; i ++) {
- b = ((FX_LPCBYTE)pGUID)[i];
+ b = ((const uint8_t*)pGUID)[i];
*pBuf ++ = gs_FX_pHexChars[b >> 4];
*pBuf ++ = gs_FX_pHexChars[b & 0x0F];
if (bSeparator && (i == 3 || i == 5 || i == 7 || i == 9)) {
diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp
index 040fefab63..1eec20c371 100644
--- a/core/src/fxcrt/fx_xml_parser.cpp
+++ b/core/src/fxcrt/fx_xml_parser.cpp
@@ -12,7 +12,7 @@ CXML_Parser::~CXML_Parser()
m_pDataAcc->Release();
}
}
-FX_BOOL CXML_Parser::Init(FX_LPBYTE pBuffer, size_t size)
+FX_BOOL CXML_Parser::Init(uint8_t* pBuffer, size_t size)
{
m_pDataAcc = FX_NEW CXML_DataBufAcc(pBuffer, size);
if (!m_pDataAcc) {
@@ -485,7 +485,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag
break;
}
pSubElement->m_pParent = pElement;
- pElement->m_Children.Add((FX_LPVOID)CXML_Element::Element);
+ pElement->m_Children.Add((void*)CXML_Element::Element);
pElement->m_Children.Add(pSubElement);
SkipWhiteSpaces();
}
@@ -535,7 +535,7 @@ void CXML_Parser::InsertContentSegment(FX_BOOL bCDATA, FX_WSTR content, CXML_Ele
return;
}
pContent->Set(bCDATA, content);
- pElement->m_Children.Add((FX_LPVOID)CXML_Element::Content);
+ pElement->m_Children.Add((void*)CXML_Element::Content);
pElement->m_Children.Add(pContent);
}
static CXML_Element* XML_ContinueParse(CXML_Parser &parser, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize)
@@ -550,7 +550,7 @@ static CXML_Element* XML_ContinueParse(CXML_Parser &parser, FX_BOOL bSaveSpaceCh
CXML_Element* CXML_Element::Parse(const void* pBuffer, size_t size, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize)
{
CXML_Parser parser;
- if (!parser.Init((FX_LPBYTE)pBuffer, size)) {
+ if (!parser.Init((uint8_t*)pBuffer, size)) {
return NULL;
}
return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
diff --git a/core/src/fxcrt/fxcrt_platforms.cpp b/core/src/fxcrt/fxcrt_platforms.cpp
index 74affbe4b9..e5259c2b54 100644
--- a/core/src/fxcrt/fxcrt_platforms.cpp
+++ b/core/src/fxcrt/fxcrt_platforms.cpp
@@ -168,7 +168,7 @@ FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
return FALSE;
}
FX_FILESIZE num = 0;
- FX_LPBYTE pBuffer = FX_Alloc(uint8_t, 32768);
+ uint8_t* pBuffer = FX_Alloc(uint8_t, 32768);
while (num = src.Read(pBuffer, 32768)) {
if (dst.Write(pBuffer, num) != num) {
break;
diff --git a/core/src/fxcrt/fxcrt_posix.cpp b/core/src/fxcrt/fxcrt_posix.cpp
index 701c910551..dd2aaf27d0 100644
--- a/core/src/fxcrt/fxcrt_posix.cpp
+++ b/core/src/fxcrt/fxcrt_posix.cpp
@@ -164,7 +164,7 @@ FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
return FALSE;
}
size_t num = 0;
- FX_LPBYTE pBuffer = FX_Alloc(uint8_t, 32768);
+ uint8_t* pBuffer = FX_Alloc(uint8_t, 32768);
num = src.Read(pBuffer, 32768);
while (num) {
if (dst.Write(pBuffer, num) != num) {
diff --git a/core/src/fxcrt/fxcrt_windows.h b/core/src/fxcrt/fxcrt_windows.h
index 1919f3e4d7..32531d568f 100644
--- a/core/src/fxcrt/fxcrt_windows.h
+++ b/core/src/fxcrt/fxcrt_windows.h
@@ -29,7 +29,7 @@ public:
virtual FX_BOOL Flush();
virtual FX_BOOL Truncate(FX_FILESIZE szFile);
protected:
- FX_LPVOID m_hFile;
+ void* m_hFile;
};
#endif
diff --git a/core/src/fxcrt/xml_int.h b/core/src/fxcrt/xml_int.h
index 4155a39ffa..0220301d17 100644
--- a/core/src/fxcrt/xml_int.h
+++ b/core/src/fxcrt/xml_int.h
@@ -10,7 +10,7 @@
class CXML_DataBufAcc : public IFX_BufferRead
{
public:
- CXML_DataBufAcc(FX_LPCBYTE pBuffer, size_t size)
+ CXML_DataBufAcc(const uint8_t* pBuffer, size_t size)
: m_pBuffer(pBuffer)
, m_dwSize(size)
, m_dwCurPos(0)
@@ -44,7 +44,7 @@ public:
}
return FALSE;
}
- virtual FX_LPCBYTE GetBlockBuffer()
+ virtual const uint8_t* GetBlockBuffer()
{
return m_pBuffer;
}
@@ -57,7 +57,7 @@ public:
return 0;
}
protected:
- FX_LPCBYTE m_pBuffer;
+ const uint8_t* m_pBuffer;
size_t m_dwSize;
size_t m_dwCurPos;
};
@@ -111,9 +111,9 @@ public:
}
return m_pFileRead->ReadBlock(m_pBuffer, m_nStart, m_dwSize);
}
- virtual FX_LPCBYTE GetBlockBuffer()
+ virtual const uint8_t* GetBlockBuffer()
{
- return (FX_LPCBYTE)m_pBuffer;
+ return (const uint8_t*)m_pBuffer;
}
virtual size_t GetBlockSize()
{
@@ -125,7 +125,7 @@ public:
}
protected:
IFX_FileRead *m_pFileRead;
- FX_LPBYTE m_pBuffer;
+ uint8_t* m_pBuffer;
FX_FILESIZE m_nStart;
size_t m_dwSize;
};
@@ -137,11 +137,11 @@ public:
FX_BOOL m_bOwnedStream;
FX_FILESIZE m_nOffset;
FX_BOOL m_bSaveSpaceChars;
- FX_LPCBYTE m_pBuffer;
+ const uint8_t* m_pBuffer;
size_t m_dwBufferSize;
FX_FILESIZE m_nBufferOffset;
size_t m_dwIndex;
- FX_BOOL Init(FX_LPBYTE pBuffer, size_t size);
+ FX_BOOL Init(uint8_t* pBuffer, size_t size);
FX_BOOL Init(IFX_FileRead *pFileRead);
FX_BOOL Init(IFX_BufferRead *pBuffer);
FX_BOOL Init(FX_BOOL bOwndedStream);