summaryrefslogtreecommitdiff
path: root/core/src/fxcrt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxcrt')
-rw-r--r--core/src/fxcrt/extension.h18
-rw-r--r--core/src/fxcrt/fx_arabic.cpp210
-rw-r--r--core/src/fxcrt/fx_arabic.h36
-rw-r--r--core/src/fxcrt/fx_basic_array.cpp10
-rw-r--r--core/src/fxcrt/fx_basic_bstring.cpp14
-rw-r--r--core/src/fxcrt/fx_basic_buffer.cpp24
-rw-r--r--core/src/fxcrt/fx_basic_coords.cpp16
-rw-r--r--core/src/fxcrt/fx_basic_gcc.cpp26
-rw-r--r--core/src/fxcrt/fx_basic_maps.cpp28
-rw-r--r--core/src/fxcrt/fx_basic_memmgr.cpp2
-rw-r--r--core/src/fxcrt/fx_basic_plex.cpp4
-rw-r--r--core/src/fxcrt/fx_basic_utf.cpp4
-rw-r--r--core/src/fxcrt/fx_basic_util.cpp12
-rw-r--r--core/src/fxcrt/fx_basic_wstring.cpp6
-rw-r--r--core/src/fxcrt/fx_extension.cpp36
-rw-r--r--core/src/fxcrt/fx_unicode.cpp2
-rw-r--r--core/src/fxcrt/fx_xml_composer.cpp2
-rw-r--r--core/src/fxcrt/fx_xml_parser.cpp48
-rw-r--r--core/src/fxcrt/fxcrt_platforms.cpp2
-rw-r--r--core/src/fxcrt/fxcrt_posix.cpp6
-rw-r--r--core/src/fxcrt/fxcrt_posix.h2
-rw-r--r--core/src/fxcrt/xml_int.h2
22 files changed, 255 insertions, 255 deletions
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index 86e46eb5a0..99a5cf3c4e 100644
--- a/core/src/fxcrt/extension.h
+++ b/core/src/fxcrt/extension.h
@@ -198,7 +198,7 @@ public:
~CFX_MemoryStream()
{
if (m_dwFlags & FX_MEMSTREAM_TakeOver) {
- for (FX_INT32 i = 0; i < m_Blocks.GetSize(); i++) {
+ for (int32_t i = 0; i < m_Blocks.GetSize(); i++) {
FX_Free((FX_LPBYTE)m_Blocks[i]);
}
}
@@ -308,7 +308,7 @@ public:
}
}
size_t nRead = FX_MIN(size, m_nCurSize - m_nCurPos);
- if (!ReadBlock(buffer, (FX_INT32)m_nCurPos, nRead)) {
+ if (!ReadBlock(buffer, (int32_t)m_nCurPos, nRead)) {
return 0;
}
return nRead;
@@ -331,10 +331,10 @@ public:
if (m_nCurPos > m_nTotalSize) {
m_nTotalSize = (m_nCurPos + m_nGrowSize - 1) / m_nGrowSize * m_nGrowSize;
if (m_Blocks.GetSize() < 1) {
- void* block = FX_Alloc(FX_BYTE, m_nTotalSize);
+ void* block = FX_Alloc(uint8_t, m_nTotalSize);
m_Blocks.Add(block);
} else {
- m_Blocks[0] = FX_Realloc(FX_BYTE, m_Blocks[0], m_nTotalSize);
+ m_Blocks[0] = FX_Realloc(uint8_t, m_Blocks[0], m_nTotalSize);
}
if (!m_Blocks[0]) {
m_Blocks.RemoveAll();
@@ -385,7 +385,7 @@ public:
{
if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
if (m_Blocks.GetSize() < 1) {
- FX_LPBYTE pBlock = FX_Alloc(FX_BYTE, FX_MAX(nInitSize, 4096));
+ FX_LPBYTE pBlock = FX_Alloc(uint8_t, FX_MAX(nInitSize, 4096));
m_Blocks.Add(pBlock);
}
m_nGrowSize = FX_MAX(nGrowSize, 4096);
@@ -438,11 +438,11 @@ protected:
if (size <= m_nTotalSize) {
return TRUE;
}
- FX_INT32 iCount = m_Blocks.GetSize();
+ int32_t iCount = m_Blocks.GetSize();
size = (size - m_nTotalSize + m_nGrowSize - 1) / m_nGrowSize;
- m_Blocks.SetSize(m_Blocks.GetSize() + (FX_INT32)size);
+ m_Blocks.SetSize(m_Blocks.GetSize() + (int32_t)size);
while (size --) {
- FX_LPBYTE pBlock = FX_Alloc(FX_BYTE, m_nGrowSize);
+ FX_LPBYTE 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, FX_INT32 iCount);
+FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, int32_t iCount);
#endif
#ifdef __cplusplus
}
diff --git a/core/src/fxcrt/fx_arabic.cpp b/core/src/fxcrt/fx_arabic.cpp
index dd5d1d81bd..81c86542c7 100644
--- a/core/src/fxcrt/fx_arabic.cpp
+++ b/core/src/fxcrt/fx_arabic.cpp
@@ -214,8 +214,8 @@ FX_LPCARBFORMTABLE FX_GetArabicFormTable(FX_WCHAR unicode)
}
FX_WCHAR FX_GetArabicFromAlefTable(FX_WCHAR alef)
{
- static const FX_INT32 s_iAlefCount = sizeof(gs_FX_AlefTable) / sizeof(FX_ARAALEF);
- for (FX_INT32 iStart = 0; iStart < s_iAlefCount; iStart ++) {
+ static const int32_t s_iAlefCount = sizeof(gs_FX_AlefTable) / sizeof(FX_ARAALEF);
+ for (int32_t iStart = 0; iStart < s_iAlefCount; iStart ++) {
const FX_ARAALEF &v = gs_FX_AlefTable[iStart];
if (v.wAlef == alef) {
return v.wIsolated;
@@ -225,8 +225,8 @@ FX_WCHAR FX_GetArabicFromAlefTable(FX_WCHAR alef)
}
FX_WCHAR FX_GetArabicFromShaddaTable(FX_WCHAR shadda)
{
- static const FX_INT32 s_iShaddaCount = sizeof(gs_FX_ShaddaTable) / sizeof(FX_ARASHADDA);
- for (FX_INT32 iStart = 0; iStart < s_iShaddaCount; iStart ++) {
+ static const int32_t s_iShaddaCount = sizeof(gs_FX_ShaddaTable) / sizeof(FX_ARASHADDA);
+ for (int32_t iStart = 0; iStart < s_iShaddaCount; iStart ++) {
const FX_ARASHADDA &v = gs_FX_ShaddaTable[iStart];
if (v.wShadda == shadda) {
return v.wIsolated;
@@ -307,7 +307,7 @@ FX_LPCARBFORMTABLE CFX_ArabicChar::ParseChar(const CFX_Char *pTC, FX_WCHAR &wCha
}
return pFT;
}
-void FX_BidiReverseString(CFX_WideString &wsText, FX_INT32 iStart, FX_INT32 iCount)
+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());
@@ -321,15 +321,15 @@ void FX_BidiReverseString(CFX_WideString &wsText, FX_INT32 iStart, FX_INT32 iCou
*pEnd -- = wch;
}
}
-void FX_BidiSetDeferredRun(CFX_Int32Array &values, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iValue)
+void FX_BidiSetDeferredRun(CFX_Int32Array &values, int32_t iStart, int32_t iCount, int32_t iValue)
{
FXSYS_assert(iStart > -1 && iStart <= values.GetSize());
FXSYS_assert(iStart - iCount > -1);
- for (FX_INT32 i = iStart - 1; i >= iStart - iCount; i --) {
+ for (int32_t i = iStart - 1; i >= iStart - iCount; i --) {
values.SetAt(i, iValue);
}
}
-const FX_INT32 gc_FX_BidiNTypes[] = {
+const int32_t gc_FX_BidiNTypes[] = {
FX_BIDICLASS_N,
FX_BIDICLASS_L,
FX_BIDICLASS_R,
@@ -354,25 +354,25 @@ const FX_INT32 gc_FX_BidiNTypes[] = {
void FX_BidiClassify(const CFX_WideString &wsText, CFX_Int32Array &classes, FX_BOOL bWS)
{
FXSYS_assert(wsText.GetLength() == classes.GetSize());
- FX_INT32 iCount = wsText.GetLength();
+ int32_t iCount = wsText.GetLength();
FX_LPCWSTR pwsStart = (FX_LPCWSTR)wsText;
FX_WCHAR wch;
- FX_INT32 iCls;
+ int32_t iCls;
if (bWS) {
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
wch = *pwsStart ++;
iCls = ((gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS);
classes.SetAt(i, iCls);
}
} else {
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
wch = *pwsStart ++;
iCls = ((gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS);
classes.SetAt(i, gc_FX_BidiNTypes[iCls]);
}
}
}
-FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_Int32Array &classes, CFX_Int32Array &levels, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iNest)
+int32_t FX_BidiResolveExplicit(int32_t iBaseLevel, int32_t iDirection, CFX_Int32Array &classes, CFX_Int32Array &levels, int32_t iStart, int32_t iCount, int32_t iNest)
{
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL && iNest >= 0);
FXSYS_assert(classes.GetSize() == levels.GetSize());
@@ -382,10 +382,10 @@ FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_In
return 0;
}
#if 0
- FX_INT32 iLastNest = iNest;
+ int32_t iLastNest = iNest;
#endif
- FX_INT32 iSize = classes.GetSize();
- FX_INT32 i = iStart, iCur, iCls;
+ int32_t iSize = classes.GetSize();
+ int32_t i = iStart, iCur, iCls;
for (; i < iSize && iCount > 0; i ++, iCount --) {
iCur = iCls = classes.GetAt(i);
#if 0
@@ -396,7 +396,7 @@ FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_In
iCls = FX_BIDICLASS_BN;
iNest ++;
if (FX_BidiGreaterEven(iBaseLevel) <= MAX_LEVEL) {
- FX_INT32 iLevel = FX_BidiGreaterEven(iBaseLevel);
+ int32_t iLevel = FX_BidiGreaterEven(iBaseLevel);
levels.SetAt(i, iLevel);
i += FX_BidiResolveExplicit(iLevel,
(iCls == FX_BIDICLASS_LRE ? FX_BIDICLASS_N : FX_BIDICLASS_L),
@@ -415,7 +415,7 @@ FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_In
iCls = FX_BIDICLASS_BN;
iNest ++;
if (FX_BidiGreaterOdd(iBaseLevel) <= MAX_LEVEL) {
- FX_INT32 iLevel = FX_BidiGreaterOdd(iBaseLevel);
+ int32_t iLevel = FX_BidiGreaterOdd(iBaseLevel);
levels.SetAt(i, iLevel);
i += FX_BidiResolveExplicit(iLevel,
(iCls == FX_BIDICLASS_RLE ? FX_BIDICLASS_N : FX_BIDICLASS_R),
@@ -452,7 +452,7 @@ FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_In
}
return i - iStart;
}
-const FX_INT32 gc_FX_BidiWeakStates[][10] = {
+const int32_t gc_FX_BidiWeakStates[][10] = {
{FX_BWSao, FX_BWSxl, FX_BWSxr, FX_BWScn, FX_BWScn, FX_BWSxa, FX_BWSxa, FX_BWSao, FX_BWSao, FX_BWSao},
{FX_BWSro, FX_BWSxl, FX_BWSxr, FX_BWSra, FX_BWSre, FX_BWSxa, FX_BWSxr, FX_BWSro, FX_BWSro, FX_BWSrt},
{FX_BWSlo, FX_BWSxl, FX_BWSxr, FX_BWSla, FX_BWSle, FX_BWSxa, FX_BWSxl, FX_BWSlo, FX_BWSlo, FX_BWSlt},
@@ -474,7 +474,7 @@ const FX_INT32 gc_FX_BidiWeakStates[][10] = {
{FX_BWSro, FX_BWSxl, FX_BWSxr, FX_BWSra, FX_BWSre, FX_BWSxa, FX_BWSret, FX_BWSro, FX_BWSro, FX_BWSret},
{FX_BWSlo, FX_BWSxl, FX_BWSxr, FX_BWSla, FX_BWSle, FX_BWSxa, FX_BWSlet, FX_BWSlo, FX_BWSlo, FX_BWSlet},
};
-const FX_INT32 gc_FX_BidiWeakActions[][10] = {
+const int32_t gc_FX_BidiWeakActions[][10] = {
{FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxA, FX_BWAxxR, FX_BWAxxR, FX_BWAxxN, FX_BWAxxN, FX_BWAxxN},
{FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxE, FX_BWAxxR, FX_BWAxxR, FX_BWAxxN, FX_BWAxxN, FX_BWAxIx},
{FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxL, FX_BWAxxR, FX_BWAxxL, FX_BWAxxN, FX_BWAxxN, FX_BWAxIx},
@@ -496,18 +496,18 @@ const FX_INT32 gc_FX_BidiWeakActions[][10] = {
{FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxE, FX_BWAxxR, FX_BWAxxE, FX_BWAxxN, FX_BWAxxN, FX_BWAxxE},
{FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxx, FX_BWAxxL, FX_BWAxxR, FX_BWAxxL, FX_BWAxxN, FX_BWAxxN, FX_BWAxxL},
};
-void FX_BidiResolveWeak(FX_INT32 iBaseLevel, CFX_Int32Array &classes, CFX_Int32Array &levels)
+void FX_BidiResolveWeak(int32_t iBaseLevel, CFX_Int32Array &classes, CFX_Int32Array &levels)
{
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
FXSYS_assert(classes.GetSize() == levels.GetSize());
- FX_INT32 iSize = classes.GetSize();
+ int32_t iSize = classes.GetSize();
if (iSize < 1) {
return;
}
iSize --;
- FX_INT32 iLevelCur = iBaseLevel;
- FX_INT32 iState = FX_IsOdd(iBaseLevel) ? FX_BWSxr : FX_BWSxl;
- FX_INT32 i = 0, iCount = 0, iClsCur, iClsRun, iClsNew, iAction;
+ int32_t iLevelCur = iBaseLevel;
+ int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BWSxr : FX_BWSxl;
+ int32_t i = 0, iCount = 0, iClsCur, iClsRun, iClsNew, iAction;
for (; i <= iSize; i ++) {
iClsCur = classes.GetAt(i);
#if 0
@@ -517,7 +517,7 @@ void FX_BidiResolveWeak(FX_INT32 iBaseLevel, CFX_Int32Array &classes, CFX_Int32A
iClsCur = FX_BidiDirection(iLevelCur);
classes.SetAt(i, iClsCur);
} else if (i < iSize) {
- FX_INT32 iLevelNext, iLevelNew;
+ int32_t iLevelNext, iLevelNew;
iClsNew = classes.GetAt(i + 1);
iLevelNext = levels.GetAt(i + 1);
if (iClsNew != FX_BIDICLASS_BN && iLevelCur != iLevelNext) {
@@ -565,7 +565,7 @@ void FX_BidiResolveWeak(FX_INT32 iBaseLevel, CFX_Int32Array &classes, CFX_Int32A
FX_BidiSetDeferredRun(classes, i, iCount, iClsRun);
}
}
-const FX_INT32 gc_FX_BidiNeutralStates[][5] = {
+const int32_t gc_FX_BidiNeutralStates[][5] = {
{FX_BNSrn, FX_BNSl, FX_BNSr, FX_BNSr, FX_BNSr},
{FX_BNSln, FX_BNSl, FX_BNSr, FX_BNSa, FX_BNSl},
{FX_BNSrn, FX_BNSl, FX_BNSr, FX_BNSr, FX_BNSr},
@@ -573,7 +573,7 @@ const FX_INT32 gc_FX_BidiNeutralStates[][5] = {
{FX_BNSna, FX_BNSl, FX_BNSr, FX_BNSa, FX_BNSl},
{FX_BNSna, FX_BNSl, FX_BNSr, FX_BNSa, FX_BNSl},
};
-const FX_INT32 gc_FX_BidiNeutralActions[][5] = {
+const int32_t gc_FX_BidiNeutralActions[][5] = {
{FX_BNAIn, 0, 0, 0, 0 },
{FX_BNAIn, 0, 0, 0, FX_BCL },
{FX_BNAIn, FX_BNAEn, FX_BNARn, FX_BNARn, FX_BNARn },
@@ -581,7 +581,7 @@ const FX_INT32 gc_FX_BidiNeutralActions[][5] = {
{FX_BNAIn, 0, 0, 0, FX_BCL },
{FX_BNAIn, FX_BNAEn, FX_BNARn, FX_BNARn, FX_BNAEn },
};
-FX_INT32 FX_BidiGetDeferredNeutrals(FX_INT32 iAction, FX_INT32 iLevel)
+int32_t FX_BidiGetDeferredNeutrals(int32_t iAction, int32_t iLevel)
{
iAction = (iAction >> 4) & 0xF;
if (iAction == (FX_BIDINEUTRALACTION_En >> 4)) {
@@ -590,7 +590,7 @@ FX_INT32 FX_BidiGetDeferredNeutrals(FX_INT32 iAction, FX_INT32 iLevel)
return iAction;
}
}
-FX_INT32 FX_BidiGetResolvedNeutrals(FX_INT32 iAction)
+int32_t FX_BidiGetResolvedNeutrals(int32_t iAction)
{
iAction = (iAction & 0xF);
if (iAction == FX_BIDINEUTRALACTION_In) {
@@ -599,18 +599,18 @@ FX_INT32 FX_BidiGetResolvedNeutrals(FX_INT32 iAction)
return iAction;
}
}
-void FX_BidiResolveNeutrals(FX_INT32 iBaseLevel, CFX_Int32Array &classes, const CFX_Int32Array &levels)
+void FX_BidiResolveNeutrals(int32_t iBaseLevel, CFX_Int32Array &classes, const CFX_Int32Array &levels)
{
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
FXSYS_assert(classes.GetSize() == levels.GetSize());
- FX_INT32 iSize = classes.GetSize();
+ int32_t iSize = classes.GetSize();
if (iSize < 1) {
return;
}
iSize --;
- FX_INT32 iLevel = iBaseLevel;
- FX_INT32 iState = FX_IsOdd(iBaseLevel) ? FX_BNSr : FX_BNSl;
- FX_INT32 i = 0, iCount = 0, iClsCur, iClsRun, iClsNew, iAction;
+ int32_t iLevel = iBaseLevel;
+ int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BNSr : FX_BNSl;
+ int32_t i = 0, iCount = 0, iClsCur, iClsRun, iClsNew, iAction;
for (; i <= iSize; i ++) {
iClsCur = classes.GetAt(i);
if (iClsCur == FX_BIDICLASS_BN) {
@@ -642,20 +642,20 @@ void FX_BidiResolveNeutrals(FX_INT32 iBaseLevel, CFX_Int32Array &classes, const
FX_BidiSetDeferredRun(classes, i, iCount, iClsRun);
}
}
-const FX_INT32 gc_FX_BidiAddLevel[][4] = {
+const int32_t gc_FX_BidiAddLevel[][4] = {
{0, 1, 2, 2},
{1, 0, 1, 1},
};
void FX_BidiResolveImplicit(const CFX_Int32Array &classes, CFX_Int32Array &levels)
{
FXSYS_assert(classes.GetSize() == levels.GetSize());
- FX_INT32 iSize = classes.GetSize();
+ int32_t iSize = classes.GetSize();
if (iSize < 1) {
return;
}
iSize --;
- FX_INT32 iCls, iLevel;
- for (FX_INT32 i = 0; i <= iSize; i ++) {
+ int32_t iCls, iLevel;
+ for (int32_t i = 0; i <= iSize; i ++) {
iCls = classes.GetAt(i);
if (iCls == FX_BIDICLASS_BN) {
continue;
@@ -666,17 +666,17 @@ void FX_BidiResolveImplicit(const CFX_Int32Array &classes, CFX_Int32Array &level
levels.SetAt(i, iLevel);
}
}
-void FX_BidiResolveWhitespace(FX_INT32 iBaseLevel, const CFX_Int32Array &classes, CFX_Int32Array &levels)
+void FX_BidiResolveWhitespace(int32_t iBaseLevel, const CFX_Int32Array &classes, CFX_Int32Array &levels)
{
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
FXSYS_assert(classes.GetSize() == levels.GetSize());
- FX_INT32 iSize = classes.GetSize();
+ int32_t iSize = classes.GetSize();
if (iSize < 1) {
return;
}
iSize --;
- FX_INT32 iLevel = iBaseLevel;
- FX_INT32 i = 0, iCount = 0;
+ int32_t iLevel = iBaseLevel;
+ int32_t i = 0, iCount = 0;
for (; i <= iSize; i ++) {
switch(classes.GetAt(i)) {
case FX_BIDICLASS_WS:
@@ -709,17 +709,17 @@ void FX_BidiResolveWhitespace(FX_INT32 iBaseLevel, const CFX_Int32Array &classes
FX_BidiSetDeferredRun(levels, i, iCount, iBaseLevel);
}
}
-FX_INT32 FX_BidiReorderLevel(FX_INT32 iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels, FX_INT32 iStart, FX_BOOL bReverse)
+int32_t FX_BidiReorderLevel(int32_t iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels, int32_t iStart, FX_BOOL bReverse)
{
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
FXSYS_assert(wsText.GetLength() == levels.GetSize());
FXSYS_assert(iStart >= 0 && iStart < wsText.GetLength());
- FX_INT32 iSize = wsText.GetLength();
+ int32_t iSize = wsText.GetLength();
if (iSize < 1) {
return 0;
}
bReverse = bReverse || FX_IsOdd(iBaseLevel);
- FX_INT32 i = iStart, iLevel;
+ int32_t i = iStart, iLevel;
for (; i < iSize; i ++) {
if ((iLevel = levels.GetAt(i)) == iBaseLevel) {
continue;
@@ -729,28 +729,28 @@ FX_INT32 FX_BidiReorderLevel(FX_INT32 iBaseLevel, CFX_WideString &wsText, const
}
i += FX_BidiReorderLevel(iBaseLevel + 1, wsText, levels, i, bReverse) - 1;
}
- FX_INT32 iCount = i - iStart;
+ int32_t iCount = i - iStart;
if (bReverse && iCount > 1) {
FX_BidiReverseString(wsText, iStart, iCount);
}
return iCount;
}
-void FX_BidiReorder(FX_INT32 iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels)
+void FX_BidiReorder(int32_t iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels)
{
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
FXSYS_assert(wsText.GetLength() == levels.GetSize());
- FX_INT32 iSize = wsText.GetLength();
+ int32_t iSize = wsText.GetLength();
if (iSize < 1) {
return;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iSize) {
i += FX_BidiReorderLevel(iBaseLevel, wsText, levels, i, FALSE);
}
}
-void FX_BidiLine(CFX_WideString &wsText, FX_INT32 iBaseLevel)
+void FX_BidiLine(CFX_WideString &wsText, int32_t iBaseLevel)
{
- FX_INT32 iLength = wsText.GetLength();
+ int32_t iLength = wsText.GetLength();
if (iLength < 2) {
return;
}
@@ -772,12 +772,12 @@ template<class baseType>
class CFX_BidiLineTemplate
{
public:
- void FX_BidiReverseString(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iStart, FX_INT32 iCount)
+ void FX_BidiReverseString(CFX_ArrayTemplate<baseType> &chars, int32_t iStart, int32_t iCount)
{
FXSYS_assert(iStart > -1 && iStart < chars.GetSize());
FXSYS_assert(iCount >= 0 && iStart + iCount <= chars.GetSize());
baseType *pStart, *pEnd;
- FX_INT32 iEnd = iStart + iCount - 1, iTemp;
+ int32_t iEnd = iStart + iCount - 1, iTemp;
while (iStart < iEnd) {
pStart = chars.GetDataPtr(iStart ++);
pEnd = chars.GetDataPtr(iEnd --);
@@ -786,41 +786,41 @@ public:
pEnd->m_iBidiPos = iTemp;
}
}
- void FX_BidiSetDeferredRun(CFX_ArrayTemplate<baseType> &chars, FX_BOOL bClass, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iValue)
+ void FX_BidiSetDeferredRun(CFX_ArrayTemplate<baseType> &chars, FX_BOOL bClass, int32_t iStart, int32_t iCount, int32_t iValue)
{
FXSYS_assert(iStart > -1 && iStart <= chars.GetSize());
FXSYS_assert(iStart - iCount > -1);
baseType *pTC;
- FX_INT32 iLast = iStart - iCount;
+ int32_t iLast = iStart - iCount;
if (bClass) {
- for (FX_INT32 i = iStart - 1; i >= iLast; i --) {
+ for (int32_t i = iStart - 1; i >= iLast; i --) {
pTC = chars.GetDataPtr(i);
- pTC->m_iBidiClass = (FX_INT16)iValue;
+ pTC->m_iBidiClass = (int16_t)iValue;
}
} else {
- for (FX_INT32 i = iStart - 1; i >= iLast; i --) {
+ for (int32_t i = iStart - 1; i >= iLast; i --) {
pTC = chars.GetDataPtr(i);
- pTC->m_iBidiLevel = (FX_INT16)iValue;
+ pTC->m_iBidiLevel = (int16_t)iValue;
}
}
}
- void FX_BidiClassify(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_BOOL bWS)
+ void FX_BidiClassify(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, FX_BOOL bWS)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
baseType *pTC;
if (bWS) {
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
pTC = chars.GetDataPtr(i);
- pTC->m_iBidiClass = (FX_INT16)(pTC->m_dwCharProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
+ pTC->m_iBidiClass = (int16_t)(pTC->m_dwCharProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
}
} else {
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
pTC = chars.GetDataPtr(i);
- pTC->m_iBidiClass = (FX_INT16)gc_FX_BidiNTypes[(pTC->m_dwCharProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS];
+ pTC->m_iBidiClass = (int16_t)gc_FX_BidiNTypes[(pTC->m_dwCharProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS];
}
}
}
- void FX_BidiResolveExplicit(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel)
+ void FX_BidiResolveExplicit(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
@@ -828,12 +828,12 @@ public:
return;
}
baseType *pTC;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
pTC = chars.GetDataPtr(i);
- pTC->m_iBidiLevel = (FX_INT16)iBaseLevel;
+ pTC->m_iBidiLevel = (int16_t)iBaseLevel;
}
}
- void FX_BidiResolveWeak(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel)
+ void FX_BidiResolveWeak(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
iCount --;
@@ -841,20 +841,20 @@ public:
return;
}
baseType *pTC, *pTCNext;
- FX_INT32 iLevelCur = iBaseLevel;
- FX_INT32 iState = FX_IsOdd(iBaseLevel) ? FX_BWSxr : FX_BWSxl;
- FX_INT32 i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction;
+ int32_t iLevelCur = iBaseLevel;
+ int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BWSxr : FX_BWSxl;
+ int32_t i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction;
for (; i <= iCount; i ++) {
pTC = chars.GetDataPtr(i);
iClsCur = pTC->m_iBidiClass;
if (iClsCur == FX_BIDICLASS_BN) {
- pTC->m_iBidiLevel = (FX_INT16)iLevelCur;
+ pTC->m_iBidiLevel = (int16_t)iLevelCur;
if (i == iCount && iLevelCur != iBaseLevel) {
iClsCur = FX_BidiDirection(iLevelCur);
- pTC->m_iBidiClass = (FX_INT16)iClsCur;
+ pTC->m_iBidiClass = (int16_t)iClsCur;
} else if (i < iCount) {
pTCNext = chars.GetDataPtr(i + 1);
- FX_INT32 iLevelNext, iLevelNew;
+ int32_t iLevelNext, iLevelNew;
iClsNew = pTCNext->m_iBidiClass;
iLevelNext = pTCNext->m_iBidiLevel;
if (iClsNew != FX_BIDICLASS_BN && iLevelCur != iLevelNext) {
@@ -862,9 +862,9 @@ public:
if (iLevelCur > iLevelNew) {
iLevelNew = iLevelCur;
}
- pTC->m_iBidiLevel = (FX_INT16)iLevelNew;
+ pTC->m_iBidiLevel = (int16_t)iLevelNew;
iClsCur = FX_BidiDirection(iLevelNew);
- pTC->m_iBidiClass = (FX_INT16)iClsCur;
+ pTC->m_iBidiClass = (int16_t)iClsCur;
iLevelCur = iLevelNext;
} else {
if (iNum > 0) {
@@ -888,7 +888,7 @@ public:
}
iClsNew = FX_BidiGetResolvedType(iAction);
if (iClsNew != FX_BIDIWEAKACTION_XX) {
- pTC->m_iBidiClass = (FX_INT16)iClsNew;
+ pTC->m_iBidiClass = (int16_t)iClsNew;
}
if (FX_BIDIWEAKACTION_IX & iAction) {
iNum ++;
@@ -903,7 +903,7 @@ public:
}
}
}
- void FX_BidiResolveNeutrals(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel)
+ void FX_BidiResolveNeutrals(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
@@ -912,9 +912,9 @@ public:
return;
}
baseType *pTC;
- FX_INT32 iLevel = iBaseLevel;
- FX_INT32 iState = FX_IsOdd(iBaseLevel) ? FX_BNSr : FX_BNSl;
- FX_INT32 i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction;
+ int32_t iLevel = iBaseLevel;
+ int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BNSr : FX_BNSl;
+ int32_t i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction;
for (; i <= iCount; i ++) {
pTC = chars.GetDataPtr(i);
iClsCur = pTC->m_iBidiClass;
@@ -933,7 +933,7 @@ public:
}
iClsNew = FX_BidiGetResolvedNeutrals(iAction);
if (iClsNew != FX_BIDICLASS_N) {
- pTC->m_iBidiClass = (FX_INT16)iClsNew;
+ pTC->m_iBidiClass = (int16_t)iClsNew;
}
if (FX_BIDINEUTRALACTION_In & iAction) {
iNum ++;
@@ -949,12 +949,12 @@ public:
}
}
}
- void FX_BidiResolveImplicit(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount)
+ void FX_BidiResolveImplicit(CFX_ArrayTemplate<baseType> &chars, int32_t iCount)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
baseType *pTC;
- FX_INT32 iCls, iLevel;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCls, iLevel;
+ for (int32_t i = 0; i < iCount; i ++) {
pTC = chars.GetDataPtr(i);
iCls = pTC->m_iBidiClass;
if (iCls == FX_BIDICLASS_BN) {
@@ -963,10 +963,10 @@ public:
FXSYS_assert(iCls > FX_BIDICLASS_ON && iCls < FX_BIDICLASS_AL);
iLevel = pTC->m_iBidiLevel;
iLevel += gc_FX_BidiAddLevel[FX_IsOdd(iLevel)][iCls - 1];
- pTC->m_iBidiLevel = (FX_INT16)iLevel;
+ pTC->m_iBidiLevel = (int16_t)iLevel;
}
}
- void FX_BidiResolveWhitespace(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel)
+ void FX_BidiResolveWhitespace(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
@@ -974,8 +974,8 @@ public:
return;
}
iCount --;
- FX_INT32 iLevel = iBaseLevel;
- FX_INT32 i = 0, iNum = 0;
+ int32_t iLevel = iBaseLevel;
+ int32_t i = 0, iNum = 0;
baseType *pTC;
for (; i <= iCount; i ++) {
pTC = chars.GetDataPtr(i);
@@ -989,7 +989,7 @@ public:
case FX_BIDICLASS_RLO:
case FX_BIDICLASS_PDF:
case FX_BIDICLASS_BN:
- pTC->m_iBidiLevel = (FX_INT16)iLevel;
+ pTC->m_iBidiLevel = (int16_t)iLevel;
iNum ++;
break;
case FX_BIDICLASS_S:
@@ -997,7 +997,7 @@ public:
if (iNum > 0) {
FX_BidiSetDeferredRun(chars, FALSE, i, iNum, iBaseLevel);
}
- pTC->m_iBidiLevel = (FX_INT16)iBaseLevel;
+ pTC->m_iBidiLevel = (int16_t)iBaseLevel;
iNum = 0;
break;
default:
@@ -1010,7 +1010,7 @@ public:
FX_BidiSetDeferredRun(chars, FALSE, i, iNum, iBaseLevel);
}
}
- FX_INT32 FX_BidiReorderLevel(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel, FX_INT32 iStart, FX_BOOL bReverse)
+ int32_t FX_BidiReorderLevel(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel, int32_t iStart, FX_BOOL bReverse)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
@@ -1020,7 +1020,7 @@ public:
}
baseType *pTC;
bReverse = bReverse || FX_IsOdd(iBaseLevel);
- FX_INT32 i = iStart, iLevel;
+ int32_t i = iStart, iLevel;
for (; i < iCount; i ++) {
pTC = chars.GetDataPtr(i);
if ((iLevel = pTC->m_iBidiLevel) == iBaseLevel) {
@@ -1031,26 +1031,26 @@ public:
}
i += FX_BidiReorderLevel(chars, iCount, iBaseLevel + 1, i, bReverse) - 1;
}
- FX_INT32 iNum = i - iStart;
+ int32_t iNum = i - iStart;
if (bReverse && iNum > 1) {
FX_BidiReverseString(chars, iStart, iNum);
}
return iNum;
}
- void FX_BidiReorder(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel)
+ void FX_BidiReorder(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL);
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iCount) {
i += FX_BidiReorderLevel(chars, iCount, iBaseLevel, i, FALSE);
}
}
- void FX_BidiPosition(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount)
+ void FX_BidiPosition(CFX_ArrayTemplate<baseType> &chars, int32_t iCount)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
baseType *pTC;
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iCount) {
pTC = chars.GetDataPtr(i);
pTC = chars.GetDataPtr(pTC->m_iBidiPos);
@@ -1058,7 +1058,7 @@ public:
}
}
- void FX_BidiLine(CFX_ArrayTemplate<baseType> &chars, FX_INT32 iCount, FX_INT32 iBaseLevel)
+ void FX_BidiLine(CFX_ArrayTemplate<baseType> &chars, int32_t iCount, int32_t iBaseLevel)
{
FXSYS_assert(iCount > -1 && iCount <= chars.GetSize());
if (iCount < 2) {
@@ -1075,12 +1075,12 @@ public:
FX_BidiPosition(chars, iCount);
}
};
-void FX_BidiLine(CFX_TxtCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel)
+void FX_BidiLine(CFX_TxtCharArray &chars, int32_t iCount, int32_t iBaseLevel)
{
CFX_BidiLineTemplate<CFX_TxtChar> blt;
blt.FX_BidiLine(chars, iCount, iBaseLevel);
}
-void FX_BidiLine(CFX_RTFCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel)
+void FX_BidiLine(CFX_RTFCharArray &chars, int32_t iCount, int32_t iBaseLevel)
{
CFX_BidiLineTemplate<CFX_RTFChar> blt;
blt.FX_BidiLine(chars, iCount, iBaseLevel);
@@ -1102,8 +1102,8 @@ CFX_BidiChar::CFX_BidiChar()
FX_BOOL CFX_BidiChar::AppendChar(FX_WCHAR wch)
{
FX_DWORD dwProps = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch];
- FX_INT32 iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
- FX_INT32 iContext = 0;
+ int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
+ int32_t iContext = 0;
switch (iBidiCls) {
case FX_BIDICLASS_L:
case FX_BIDICLASS_AN:
@@ -1147,7 +1147,7 @@ FX_BOOL CFX_BidiChar::EndChar()
m_iLastCount = m_iCurCount - m_iLastStart;
return m_iLastCount > 0;
}
-FX_INT32 CFX_BidiChar::GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount)
+int32_t CFX_BidiChar::GetBidiInfo(int32_t &iStart, int32_t &iCount)
{
iStart = m_iLastStart;
iCount = m_iLastCount;
diff --git a/core/src/fxcrt/fx_arabic.h b/core/src/fxcrt/fx_arabic.h
index 66e8bc8000..27e519367a 100644
--- a/core/src/fxcrt/fx_arabic.h
+++ b/core/src/fxcrt/fx_arabic.h
@@ -26,8 +26,8 @@ public:
protected:
FX_LPCARBFORMTABLE ParseChar(const CFX_Char *pTC, FX_WCHAR &wChar, FX_CHARTYPE &eType) const;
};
-void FX_BidiReverseString(CFX_WideString &wsText, FX_INT32 iStart, FX_INT32 iCount);
-void FX_BidiSetDeferredRun(CFX_Int32Array &values, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iValue);
+void FX_BidiReverseString(CFX_WideString &wsText, int32_t iStart, int32_t iCount);
+void FX_BidiSetDeferredRun(CFX_Int32Array &values, int32_t iStart, int32_t iCount, int32_t iValue);
#define FX_BCON FX_BIDICLASS_ON
#define FX_BCL FX_BIDICLASS_L
#define FX_BCR FX_BIDICLASS_R
@@ -52,7 +52,7 @@ void FX_BidiClassify(const CFX_WideString &wsText, CFX_Int32Array &classes, FX_B
#define FX_BIDIMAXLEVEL 61
#define FX_BidiGreaterEven(a) (FX_IsOdd(a) ? ((a) + 1) : ((a) + 2))
#define FX_BidiGreaterOdd(a) (FX_IsOdd(a) ? ((a) + 2) : ((a) + 1))
-FX_INT32 FX_BidiResolveExplicit(FX_INT32 iBaseLevel, FX_INT32 iDirection, CFX_Int32Array &classes, CFX_Int32Array &levels, FX_INT32 iStart, FX_INT32 iCount, FX_INT32 iNest = 0);
+int32_t FX_BidiResolveExplicit(int32_t iBaseLevel, int32_t iDirection, CFX_Int32Array &classes, CFX_Int32Array &levels, int32_t iStart, int32_t iCount, int32_t iNest = 0);
#define FX_BidiDirection(a) (FX_IsOdd(a) ? FX_BIDICLASS_R : FX_BIDICLASS_L)
enum FX_BIDIWEAKSTATE {
FX_BIDIWEAKSTATE_xa = 0,
@@ -144,7 +144,7 @@ enum FX_BIDIWEAKACTION {
#define FX_BWALxx FX_BIDIWEAKACTION_Lxx
#define FX_BidiGetDeferredType(a) (((a) >> 4) & 0x0F)
#define FX_BidiGetResolvedType(a) ((a) & 0x0F)
-void FX_BidiResolveWeak(FX_INT32 iBaseLevel, CFX_Int32Array &classes, CFX_Int32Array &levels);
+void FX_BidiResolveWeak(int32_t iBaseLevel, CFX_Int32Array &classes, CFX_Int32Array &levels);
enum FX_BIDINEUTRALSTATE {
FX_BIDINEUTRALSTATE_r = 0,
FX_BIDINEUTRALSTATE_l,
@@ -173,13 +173,13 @@ enum FX_BIDINEUTRALACTION {
#define FX_BNALn FX_BIDINEUTRALACTION_Ln
#define FX_BNAIn FX_BIDINEUTRALACTION_In
#define FX_BNALnL FX_BIDINEUTRALACTION_LnL
-FX_INT32 FX_BidiGetDeferredNeutrals(FX_INT32 iAction, FX_INT32 iLevel);
-FX_INT32 FX_BidiGetResolvedNeutrals(FX_INT32 iAction);
-void FX_BidiResolveNeutrals(FX_INT32 iBaseLevel, CFX_Int32Array &classes, const CFX_Int32Array &levels);
+int32_t FX_BidiGetDeferredNeutrals(int32_t iAction, int32_t iLevel);
+int32_t FX_BidiGetResolvedNeutrals(int32_t iAction);
+void FX_BidiResolveNeutrals(int32_t iBaseLevel, CFX_Int32Array &classes, const CFX_Int32Array &levels);
void FX_BidiResolveImplicit(const CFX_Int32Array &classes, CFX_Int32Array &levels);
-void FX_BidiResolveWhitespace(FX_INT32 iBaseLevel, const CFX_Int32Array &classes, CFX_Int32Array &levels);
-FX_INT32 FX_BidiReorderLevel(FX_INT32 iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels, FX_INT32 iStart, FX_BOOL bReverse = FALSE);
-void FX_BidiReorder(FX_INT32 iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels);
+void FX_BidiResolveWhitespace(int32_t iBaseLevel, const CFX_Int32Array &classes, CFX_Int32Array &levels);
+int32_t FX_BidiReorderLevel(int32_t iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels, int32_t iStart, FX_BOOL bReverse = FALSE);
+void FX_BidiReorder(int32_t iBaseLevel, CFX_WideString &wsText, const CFX_Int32Array &levels);
class CFX_BidiChar final : public IFX_BidiChar
{
public:
@@ -194,18 +194,18 @@ public:
}
virtual FX_BOOL AppendChar(FX_WCHAR wch) override;
virtual FX_BOOL EndChar() override;
- virtual FX_INT32 GetBidiInfo(FX_INT32 &iStart, FX_INT32 &iCount) override;
+ virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) override;
virtual void Reset() override;
private:
~CFX_BidiChar() { }
- FX_BOOL m_bSeparateNeutral;
- FX_INT32 m_iCurStart;
- FX_INT32 m_iCurCount;
- FX_INT32 m_iCurBidi;
- FX_INT32 m_iLastBidi;
- FX_INT32 m_iLastStart;
- FX_INT32 m_iLastCount;
+ FX_BOOL m_bSeparateNeutral;
+ int32_t m_iCurStart;
+ int32_t m_iCurCount;
+ int32_t m_iCurBidi;
+ int32_t m_iLastBidi;
+ int32_t m_iLastStart;
+ int32_t m_iLastCount;
};
#endif // CORE_SRC_FXCRT_FX_ARABIC_H_
diff --git a/core/src/fxcrt/fx_basic_array.cpp b/core/src/fxcrt/fx_basic_array.cpp
index 43a5417c00..315c83e53a 100644
--- a/core/src/fxcrt/fx_basic_array.cpp
+++ b/core/src/fxcrt/fx_basic_array.cpp
@@ -38,7 +38,7 @@ FX_BOOL CFX_BasicArray::SetSize(int nNewSize)
m_nSize = m_nMaxSize = 0;
return FALSE;
}
- m_pData = FX_Alloc(FX_BYTE, totalSize.ValueOrDie());
+ m_pData = FX_Alloc(uint8_t, totalSize.ValueOrDie());
m_nSize = m_nMaxSize = nNewSize;
} else if (nNewSize <= m_nMaxSize) {
if (nNewSize > m_nSize) {
@@ -52,7 +52,7 @@ FX_BOOL CFX_BasicArray::SetSize(int nNewSize)
if (!totalSize.IsValid() || nNewMax < m_nSize) {
return FALSE;
}
- FX_LPBYTE pNewData = FX_Realloc(FX_BYTE, m_pData, totalSize.ValueOrDie());
+ FX_LPBYTE pNewData = FX_Realloc(uint8_t, m_pData, totalSize.ValueOrDie());
if (pNewData == NULL) {
return FALSE;
}
@@ -185,7 +185,7 @@ void* CFX_BaseSegmentedArray::Add()
if (m_DataSize % m_SegmentSize) {
return GetAt(m_DataSize ++);
}
- void* pSegment = FX_Alloc2D(FX_BYTE, m_UnitSize, m_SegmentSize);
+ void* pSegment = FX_Alloc2D(uint8_t, m_UnitSize, m_SegmentSize);
if (m_pIndex == NULL) {
m_pIndex = pSegment;
m_DataSize ++;
@@ -315,8 +315,8 @@ void CFX_BaseSegmentedArray::Delete(int index, int count)
}
int i;
for (i = index; i < m_DataSize - count; i ++) {
- FX_BYTE* pSrc = (FX_BYTE*)GetAt(i + count);
- FX_BYTE* pDest = (FX_BYTE*)GetAt(i);
+ uint8_t* pSrc = (uint8_t*)GetAt(i + count);
+ uint8_t* pDest = (uint8_t*)GetAt(i);
for (int j = 0; j < m_UnitSize; j ++) {
pDest[j] = pSrc[j];
}
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index 2377a6d624..78698fc6d0 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -72,7 +72,7 @@ CFX_ByteString::StringData* CFX_ByteString::StringData::Create(int nLen)
int usableSize = totalSize - overhead;
FXSYS_assert(usableSize >= nLen);
- void* pData = FX_Alloc(FX_BYTE, totalSize);
+ void* pData = FX_Alloc(uint8_t, totalSize);
return new (pData) StringData(nLen, usableSize);
}
CFX_ByteString::~CFX_ByteString()
@@ -284,11 +284,11 @@ bool CFX_ByteString::EqualNoCase(FX_BSTR str) const
FX_LPCBYTE pThat = str.GetPtr();
for (FX_STRSIZE i = 0; i < len; i ++) {
if ((*pThis) != (*pThat)) {
- FX_BYTE bThis = *pThis;
+ uint8_t bThis = *pThis;
if (bThis >= 'A' && bThis <= 'Z') {
bThis += 'a' - 'A';
}
- FX_BYTE bThat = *pThat;
+ uint8_t bThat = *pThat;
if (bThat >= 'A' && bThat <= 'Z') {
bThat += 'a' - 'A';
}
@@ -645,7 +645,7 @@ void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
case 'X':
case 'o':
if (nModifier & FORCE_INT64) {
- va_arg(argList, FX_INT64);
+ va_arg(argList, int64_t);
} else {
va_arg(argList, int);
}
@@ -936,7 +936,7 @@ CFX_WideString CFX_ByteString::UTF8Decode() const
{
CFX_UTF8Decoder decoder;
for (FX_STRSIZE i = 0; i < GetLength(); i ++) {
- decoder.Input((FX_BYTE)m_pData->m_String[i]);
+ decoder.Input((uint8_t)m_pData->m_String[i]);
}
return decoder.GetResult();
}
@@ -969,9 +969,9 @@ int CFX_ByteString::Compare(FX_BSTR str) const
int that_len = str.GetLength();
int min_len = this_len < that_len ? this_len : that_len;
for (int i = 0; i < min_len; i ++) {
- if ((FX_BYTE)m_pData->m_String[i] < str.GetAt(i)) {
+ if ((uint8_t)m_pData->m_String[i] < str.GetAt(i)) {
return -1;
- } else if ((FX_BYTE)m_pData->m_String[i] > str.GetAt(i)) {
+ } else if ((uint8_t)m_pData->m_String[i] > str.GetAt(i)) {
return 1;
}
}
diff --git a/core/src/fxcrt/fx_basic_buffer.cpp b/core/src/fxcrt/fx_basic_buffer.cpp
index 06ba9413a5..7d45a43128 100644
--- a/core/src/fxcrt/fx_basic_buffer.cpp
+++ b/core/src/fxcrt/fx_basic_buffer.cpp
@@ -18,7 +18,7 @@ CFX_BinaryBuf::CFX_BinaryBuf(FX_STRSIZE size)
, m_DataSize(size)
, m_AllocSize(size)
{
- m_pBuffer = FX_Alloc(FX_BYTE, size);
+ m_pBuffer = FX_Alloc(uint8_t, size);
}
CFX_BinaryBuf::~CFX_BinaryBuf()
{
@@ -84,9 +84,9 @@ void CFX_BinaryBuf::ExpandBuf(FX_STRSIZE add_size)
new_size = (new_size + alloc_step - 1) / alloc_step * alloc_step;
FX_LPBYTE pNewBuffer = m_pBuffer;
if (pNewBuffer) {
- pNewBuffer = FX_Realloc(FX_BYTE, m_pBuffer, new_size);
+ pNewBuffer = FX_Realloc(uint8_t, m_pBuffer, new_size);
} else {
- pNewBuffer = FX_Alloc(FX_BYTE, new_size);
+ pNewBuffer = FX_Alloc(uint8_t, new_size);
}
m_pBuffer = pNewBuffer;
m_AllocSize = new_size;
@@ -126,7 +126,7 @@ void CFX_BinaryBuf::InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE siz
}
m_DataSize += size;
}
-void CFX_BinaryBuf::AppendFill(FX_BYTE byte, FX_STRSIZE count)
+void CFX_BinaryBuf::AppendFill(uint8_t byte, FX_STRSIZE count)
{
ExpandBuf(count);
if (!m_pBuffer) {
@@ -242,7 +242,7 @@ CFX_WideStringC CFX_WideTextBuf::GetWideString() const
{
return CFX_WideStringC((FX_LPCWSTR)m_pBuffer, m_DataSize / sizeof(FX_WCHAR));
}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_BYTE i)
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (uint8_t i)
{
if (m_pStream) {
m_pStream->WriteBlock(&i, 1);
@@ -325,7 +325,7 @@ FX_BOOL CFX_ArchiveLoader::IsEOF()
{
return m_LoadingPos >= m_LoadingSize;
}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (FX_BYTE& i)
+CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (uint8_t& i)
{
if (m_LoadingPos >= m_LoadingSize) {
return *this;
@@ -447,13 +447,13 @@ FX_BOOL IFX_BufferArchive::Flush()
m_Length = 0;
return bRet;
}
-FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
+int32_t IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
{
if (!pBuf || size < 1) {
return 0;
}
if (!m_pBuffer) {
- m_pBuffer = FX_Alloc(FX_BYTE, m_BufSize);
+ m_pBuffer = FX_Alloc(uint8_t, m_BufSize);
}
FX_LPBYTE buffer = (FX_LPBYTE)pBuf;
FX_STRSIZE temp_size = (FX_STRSIZE)size;
@@ -469,19 +469,19 @@ FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
temp_size -= buf_size;
buffer += buf_size;
}
- return (FX_INT32)size;
+ return (int32_t)size;
}
-FX_INT32 IFX_BufferArchive::AppendByte(FX_BYTE byte)
+int32_t IFX_BufferArchive::AppendByte(uint8_t byte)
{
return AppendBlock(&byte, 1);
}
-FX_INT32 IFX_BufferArchive::AppendDWord(FX_DWORD i)
+int32_t IFX_BufferArchive::AppendDWord(FX_DWORD i)
{
char buf[32];
FXSYS_itoa(i, buf, 10);
return AppendBlock(buf, (size_t)FXSYS_strlen(buf));
}
-FX_INT32 IFX_BufferArchive::AppendString(FX_BSTR lpsz)
+int32_t IFX_BufferArchive::AppendString(FX_BSTR lpsz)
{
return AppendBlock(lpsz.GetPtr(), lpsz.GetLength());
}
diff --git a/core/src/fxcrt/fx_basic_coords.cpp b/core/src/fxcrt/fx_basic_coords.cpp
index 8e7bb3e751..496b1443d1 100644
--- a/core/src/fxcrt/fx_basic_coords.cpp
+++ b/core/src/fxcrt/fx_basic_coords.cpp
@@ -430,7 +430,7 @@ FX_FLOAT CFX_Matrix::TransformXDistance(FX_FLOAT dx) const
FX_FLOAT fx = a * dx, fy = b * dx;
return FXSYS_sqrt(fx * fx + fy * fy);
}
-FX_INT32 CFX_Matrix::TransformXDistance(FX_INT32 dx) const
+int32_t CFX_Matrix::TransformXDistance(int32_t dx) const
{
FX_FLOAT fx = a * dx, fy = b * dx;
return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy));
@@ -440,7 +440,7 @@ FX_FLOAT CFX_Matrix::TransformYDistance(FX_FLOAT dy) const
FX_FLOAT fx = c * dy, fy = d * dy;
return FXSYS_sqrt(fx * fx + fy * fy);
}
-FX_INT32 CFX_Matrix::TransformYDistance(FX_INT32 dy) const
+int32_t CFX_Matrix::TransformYDistance(int32_t dy) const
{
FX_FLOAT fx = c * dy, fy = d * dy;
return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy));
@@ -450,7 +450,7 @@ FX_FLOAT CFX_Matrix::TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const
FX_FLOAT fx = a * dx + c * dy, fy = b * dx + d * dy;
return FXSYS_sqrt(fx * fx + fy * fy);
}
-FX_INT32 CFX_Matrix::TransformDistance(FX_INT32 dx, FX_INT32 dy) const
+int32_t CFX_Matrix::TransformDistance(int32_t dx, int32_t dy) const
{
FX_FLOAT fx = a * dx + c * dy, fy = b * dx + d * dy;
return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy));
@@ -472,11 +472,11 @@ void CFX_Matrix::TransformVector(CFX_Vector &v) const
v.x = FXSYS_round(fx);
v.y = FXSYS_round(fy);
}
-void CFX_Matrix::TransformPoints(CFX_Point *points, FX_INT32 iCount) const
+void CFX_Matrix::TransformPoints(CFX_Point *points, int32_t iCount) const
{
FXSYS_assert(iCount > 0);
FX_FLOAT fx, fy;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
fx = a * points->x + c * points->y + e;
fy = b * points->x + d * points->y + f;
points->x = FXSYS_round(fx);
@@ -484,11 +484,11 @@ void CFX_Matrix::TransformPoints(CFX_Point *points, FX_INT32 iCount) const
points ++;
}
}
-void CFX_Matrix::TransformPoints(CFX_PointF *points, FX_INT32 iCount) const
+void CFX_Matrix::TransformPoints(CFX_PointF *points, int32_t iCount) const
{
FXSYS_assert(iCount > 0);
FX_FLOAT fx, fy;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
fx = a * points->x + c * points->y + e;
fy = b * points->x + d * points->y + f;
points->x = fx, points->y = fy;
@@ -501,7 +501,7 @@ void CFX_Matrix::TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const
FX_FLOAT fy = b * x + d * y + f;
x = fx, y = fy;
}
-void CFX_Matrix::TransformPoint(FX_INT32 &x, FX_INT32 &y) const
+void CFX_Matrix::TransformPoint(int32_t &x, int32_t &y) const
{
FX_FLOAT fx = a * x + c * y + e;
FX_FLOAT fy = b * x + d * y + f;
diff --git a/core/src/fxcrt/fx_basic_gcc.cpp b/core/src/fxcrt/fx_basic_gcc.cpp
index 93c71ce660..caa99926a6 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
-FX_INT32 FXSYS_atoi(FX_LPCSTR str)
+int32_t FXSYS_atoi(FX_LPCSTR str)
{
- return FXSYS_StrToInt<FX_INT32, FX_LPCSTR>(str);
+ return FXSYS_StrToInt<int32_t, FX_LPCSTR>(str);
}
-FX_INT32 FXSYS_wtoi(FX_LPCWSTR str)
+int32_t FXSYS_wtoi(FX_LPCWSTR str)
{
- return FXSYS_StrToInt<FX_INT32, FX_LPCWSTR>(str);
+ return FXSYS_StrToInt<int32_t, FX_LPCWSTR>(str);
}
-FX_INT64 FXSYS_atoi64(FX_LPCSTR str)
+int64_t FXSYS_atoi64(FX_LPCSTR str)
{
- return FXSYS_StrToInt<FX_INT64, FX_LPCSTR>(str);
+ return FXSYS_StrToInt<int64_t, FX_LPCSTR>(str);
}
-FX_INT64 FXSYS_wtoi64(FX_LPCWSTR str)
+int64_t FXSYS_wtoi64(FX_LPCWSTR str)
{
- return FXSYS_StrToInt<FX_INT64, FX_LPCWSTR>(str);
+ return FXSYS_StrToInt<int64_t, FX_LPCWSTR>(str);
}
-FX_LPCSTR FXSYS_i64toa(FX_INT64 value, FX_LPSTR str, int radix)
+FX_LPCSTR FXSYS_i64toa(int64_t value, FX_LPSTR str, int radix)
{
- return FXSYS_IntToStr<FX_INT64, FX_LPSTR>(value, str, radix);
+ return FXSYS_IntToStr<int64_t, FX_LPSTR>(value, str, radix);
}
-FX_LPCWSTR FXSYS_i64tow(FX_INT64 value, FX_LPWSTR str, int radix)
+FX_LPCWSTR FXSYS_i64tow(int64_t value, FX_LPWSTR str, int radix)
{
- return FXSYS_IntToStr<FX_INT64, FX_LPWSTR>(value, str, radix);
+ return FXSYS_IntToStr<int64_t, FX_LPWSTR>(value, str, radix);
}
#ifdef __cplusplus
}
@@ -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<FX_INT32, FX_LPSTR>(value, string, radix);
+ return FXSYS_IntToStr<int32_t, FX_LPSTR>(value, string, radix);
}
#ifdef __cplusplus
}
diff --git a/core/src/fxcrt/fx_basic_maps.cpp b/core/src/fxcrt/fx_basic_maps.cpp
index 7fca42acde..c0c394583e 100644
--- a/core/src/fxcrt/fx_basic_maps.cpp
+++ b/core/src/fxcrt/fx_basic_maps.cpp
@@ -42,7 +42,7 @@ CFX_MapPtrToPtr::~CFX_MapPtrToPtr()
}
FX_DWORD CFX_MapPtrToPtr::HashKey(void* key) const
{
- return ((FX_DWORD)(FX_UINTPTR)key) >> 4;
+ return ((FX_DWORD)(uintptr_t)key) >> 4;
}
void CFX_MapPtrToPtr::GetNextAssoc(FX_POSITION& rNextPosition, void*& rKey, void*& rValue) const
{
@@ -377,10 +377,10 @@ FX_BOOL CFX_MapByteStringToPtr::RemoveKey(FX_BSTR key)
return FALSE;
}
struct _CompactString {
- FX_BYTE m_CompactLen;
- FX_BYTE m_LenHigh;
- FX_BYTE m_LenLow;
- FX_BYTE m_Unused;
+ uint8_t m_CompactLen;
+ uint8_t m_LenHigh;
+ uint8_t m_LenLow;
+ uint8_t m_Unused;
FX_LPBYTE m_pBuffer;
};
static void _CompactStringRelease(_CompactString* pCompact)
@@ -405,14 +405,14 @@ static FX_BOOL _CompactStringSame(_CompactString* pCompact, FX_LPCBYTE pStr, int
static void _CompactStringStore(_CompactString* pCompact, FX_LPCBYTE pStr, int len)
{
if (len < (int)sizeof(_CompactString)) {
- pCompact->m_CompactLen = (FX_BYTE)len;
+ pCompact->m_CompactLen = (uint8_t)len;
FXSYS_memcpy32(&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(FX_BYTE, len);
+ pCompact->m_pBuffer = FX_Alloc(uint8_t, len);
FXSYS_memcpy32(pCompact->m_pBuffer, pStr, len);
}
static CFX_ByteStringC _CompactStringGet(_CompactString* pCompact)
@@ -449,7 +449,7 @@ FX_POSITION CFX_CMapByteStringToPtr::GetStartPosition() const
for (int i = 0; i < size; i ++) {
_CompactString* pKey = (_CompactString*)m_Buffer.GetAt(i);
if (pKey->m_CompactLen != 0xfe) {
- return (FX_POSITION)(FX_UINTPTR)(i + 1);
+ return (FX_POSITION)(uintptr_t)(i + 1);
}
}
return NULL;
@@ -459,7 +459,7 @@ void CFX_CMapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteS
if (rNextPosition == NULL) {
return;
}
- int index = (int)(FX_UINTPTR)rNextPosition - 1;
+ int index = (int)(uintptr_t)rNextPosition - 1;
_CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
rKey = _CompactStringGet(pKey);
rValue = *(void**)(pKey + 1);
@@ -468,7 +468,7 @@ void CFX_CMapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteS
while (index < size) {
pKey = (_CompactString*)m_Buffer.GetAt(index);
if (pKey->m_CompactLen != 0xfe) {
- rNextPosition = (FX_POSITION)(FX_UINTPTR)(index + 1);
+ rNextPosition = (FX_POSITION)(uintptr_t)(index + 1);
return;
}
index ++;
@@ -480,7 +480,7 @@ FX_LPVOID CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) cons
if (rNextPosition == NULL) {
return NULL;
}
- int index = (int)(FX_UINTPTR)rNextPosition - 1;
+ int index = (int)(uintptr_t)rNextPosition - 1;
_CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
FX_LPVOID rValue = *(void**)(pKey + 1);
index ++;
@@ -488,7 +488,7 @@ FX_LPVOID CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) cons
while (index < size) {
pKey = (_CompactString*)m_Buffer.GetAt(index);
if (pKey->m_CompactLen != 0xfe) {
- rNextPosition = (FX_POSITION)(FX_UINTPTR)(index + 1);
+ rNextPosition = (FX_POSITION)(uintptr_t)(index + 1);
return rValue;
}
index ++;
@@ -601,7 +601,7 @@ void CFX_CMapDWordToDWord::GetNextAssoc(FX_POSITION& pos, FX_DWORD& key, FX_DWOR
if (pos == 0) {
return;
}
- FX_DWORD index = ((FX_DWORD)(FX_UINTPTR)pos) - 1;
+ FX_DWORD index = ((FX_DWORD)(uintptr_t)pos) - 1;
FX_DWORD count = m_Buffer.GetSize() / sizeof(_DWordPair);
_DWordPair* buf = (_DWordPair*)m_Buffer.GetBuffer();
key = buf[index].key;
@@ -609,7 +609,7 @@ void CFX_CMapDWordToDWord::GetNextAssoc(FX_POSITION& pos, FX_DWORD& key, FX_DWOR
if (index == count - 1) {
pos = 0;
} else {
- pos = (FX_POSITION)((FX_UINTPTR)pos + 1);
+ pos = (FX_POSITION)((uintptr_t)pos + 1);
}
}
void CFX_CMapDWordToDWord::SetAt(FX_DWORD key, FX_DWORD value)
diff --git a/core/src/fxcrt/fx_basic_memmgr.cpp b/core/src/fxcrt/fx_basic_memmgr.cpp
index 63c609daec..a381fa4ef5 100644
--- a/core/src/fxcrt/fx_basic_memmgr.cpp
+++ b/core/src/fxcrt/fx_basic_memmgr.cpp
@@ -63,7 +63,7 @@ void* CFX_GrowOnlyPool::Alloc(size_t size)
pTrunk = pTrunk->m_pNext;
}
size_t alloc_size = size > m_TrunkSize ? size : m_TrunkSize;
- pTrunk = (_FX_GrowOnlyTrunk*)FX_Alloc(FX_BYTE, sizeof(_FX_GrowOnlyTrunk) + alloc_size);
+ pTrunk = (_FX_GrowOnlyTrunk*)FX_Alloc(uint8_t, sizeof(_FX_GrowOnlyTrunk) + alloc_size);
pTrunk->m_Size = alloc_size;
pTrunk->m_Allocated = size;
pTrunk->m_pNext = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
diff --git a/core/src/fxcrt/fx_basic_plex.cpp b/core/src/fxcrt/fx_basic_plex.cpp
index 78319bd5da..802429600a 100644
--- a/core/src/fxcrt/fx_basic_plex.cpp
+++ b/core/src/fxcrt/fx_basic_plex.cpp
@@ -8,7 +8,7 @@
#include "plex.h"
CFX_Plex* CFX_Plex::Create(CFX_Plex*& pHead, FX_DWORD nMax, FX_DWORD cbElement)
{
- CFX_Plex* p = (CFX_Plex*)FX_Alloc(FX_BYTE, sizeof(CFX_Plex) + nMax * cbElement);
+ CFX_Plex* p = (CFX_Plex*)FX_Alloc(uint8_t, sizeof(CFX_Plex) + nMax * cbElement);
p->pNext = pHead;
pHead = p;
return p;
@@ -17,7 +17,7 @@ void CFX_Plex::FreeDataChain()
{
CFX_Plex* p = this;
while (p != NULL) {
- FX_BYTE* bytes = (FX_BYTE*)p;
+ uint8_t* bytes = (uint8_t*)p;
CFX_Plex* pNext = p->pNext;
FX_Free(bytes);
p = pNext;
diff --git a/core/src/fxcrt/fx_basic_utf.cpp b/core/src/fxcrt/fx_basic_utf.cpp
index f52b83efda..1422b7abd4 100644
--- a/core/src/fxcrt/fx_basic_utf.cpp
+++ b/core/src/fxcrt/fx_basic_utf.cpp
@@ -14,7 +14,7 @@ void CFX_UTF8Decoder::AppendChar(FX_DWORD ch)
{
m_Buffer.AppendChar((FX_WCHAR)ch);
}
-void CFX_UTF8Decoder::Input(FX_BYTE byte)
+void CFX_UTF8Decoder::Input(uint8_t byte)
{
if (byte < 0x80) {
m_PendingBytes = 0;
@@ -65,7 +65,7 @@ void CFX_UTF8Encoder::Input(FX_WCHAR unicode)
} else {
nbytes = 6;
}
- static FX_BYTE prefix[] = {0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
+ static uint8_t prefix[] = {0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
int order = 1 << ((nbytes - 1) * 6);
int code = unicode;
m_Buffer.AppendChar(prefix[nbytes - 2] | (code / order));
diff --git a/core/src/fxcrt/fx_basic_util.cpp b/core/src/fxcrt/fx_basic_util.cpp
index be736f1b21..615b297421 100644
--- a/core/src/fxcrt/fx_basic_util.cpp
+++ b/core/src/fxcrt/fx_basic_util.cpp
@@ -187,22 +187,22 @@ void FXSYS_vsnprintf(char *str, size_t size, const char* fmt, va_list ap)
}
#endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
-static FX_BOOL FX_IsDigit(FX_BYTE ch)
+static FX_BOOL FX_IsDigit(uint8_t ch)
{
return (ch >= '0' && ch <= '9') ? TRUE : FALSE;
}
-static FX_BOOL FX_IsXDigit(FX_BYTE ch)
+static FX_BOOL FX_IsXDigit(uint8_t ch)
{
return (FX_IsDigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) ? TRUE : FALSE;
}
-static FX_BYTE FX_MakeUpper(FX_BYTE ch)
+static uint8_t FX_MakeUpper(uint8_t ch)
{
if (ch < 'a' || ch > 'z') {
return ch;
}
return ch - 32;
}
-static int FX_HexToI(FX_BYTE ch)
+static int FX_HexToI(uint8_t ch)
{
ch = FX_MakeUpper(ch);
return FX_IsDigit(ch) ? (ch - '0') : (ch - 55);
@@ -237,7 +237,7 @@ CFX_ByteString FX_UrlEncode(const CFX_WideString& wsUrl)
int nByte = bsUri.GetLength();
for (int j = 0; j < nByte; j++) {
rUrl += '%';
- FX_BYTE code = bsUri.GetAt(j);
+ uint8_t code = bsUri.GetAt(j);
rUrl += arDigits[code >> 4];
rUrl += arDigits[code & 0x0F];
}
@@ -268,7 +268,7 @@ CFX_ByteString FX_EncodeURI(const CFX_WideString& wsURI)
CFX_ByteString bsUri = wsURI.UTF8Encode();
int nLength = bsUri.GetLength();
for (int i = 0; i < nLength; i++) {
- FX_BYTE code = bsUri.GetAt(i);
+ uint8_t code = bsUri.GetAt(i);
if (code > 0x7F || url_encodeTable[code] == 1) {
rURI += '%';
rURI += arDigits[code >> 4];
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index 09e64e0c72..aeb366338e 100644
--- a/core/src/fxcrt/fx_basic_wstring.cpp
+++ b/core/src/fxcrt/fx_basic_wstring.cpp
@@ -33,7 +33,7 @@ CFX_WideString::StringData* CFX_WideString::StringData::Create(int nLen)
int usableLen = (totalSize - overhead) / sizeof(FX_WCHAR);
FXSYS_assert(usableLen >= nLen);
- void* pData = FX_Alloc(FX_BYTE, iSize.ValueOrDie());
+ void* pData = FX_Alloc(uint8_t, iSize.ValueOrDie());
return new (pData) StringData(nLen, usableLen);
}
CFX_WideString::~CFX_WideString()
@@ -911,7 +911,7 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
case 'X':
case 'o':
if (nModifier & FORCE_INT64) {
- va_arg(argList, FX_INT64);
+ va_arg(argList, int64_t);
} else {
va_arg(argList, int);
}
@@ -1068,7 +1068,7 @@ static const CFX_CharMap g_DefaultGBKMapper = {&_DefMap_GetWideString, &_DefMap_
static const CFX_CharMap g_DefaultJISMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetJISCodePage};
static const CFX_CharMap g_DefaultUHCMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetUHCCodePage};
static const CFX_CharMap g_DefaultBig5Mapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetBig5CodePage};
-CFX_CharMap* CFX_CharMap::GetDefaultMapper(FX_INT32 codepage)
+CFX_CharMap* CFX_CharMap::GetDefaultMapper(int32_t codepage)
{
switch (codepage) {
case 0:
diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp
index 876cf47548..9490f3603c 100644
--- a/core/src/fxcrt/fx_extension.cpp
+++ b/core/src/fxcrt/fx_extension.cpp
@@ -151,25 +151,25 @@ FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x)
{
return FXSYS_log(x) / FXSYS_log(b);
}
-FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength, FX_INT32 *pUsedLen)
+FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, int32_t iLength, int32_t *pUsedLen)
{
FXSYS_assert(pcsStr != NULL);
if (iLength < 0) {
- iLength = (FX_INT32)FXSYS_strlen(pcsStr);
+ iLength = (int32_t)FXSYS_strlen(pcsStr);
}
CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength);
return FXSYS_wcstof(ws.c_str(), iLength, pUsedLen);
}
-FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 *pUsedLen)
+FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, int32_t iLength, int32_t *pUsedLen)
{
FXSYS_assert(pwsStr != NULL);
if (iLength < 0) {
- iLength = (FX_INT32)FXSYS_wcslen(pwsStr);
+ iLength = (int32_t)FXSYS_wcslen(pwsStr);
}
if (iLength == 0) {
return 0.0f;
}
- FX_INT32 iUsedLen = 0;
+ int32_t iUsedLen = 0;
FX_BOOL bNegtive = FALSE;
switch (pwsStr[iUsedLen]) {
case '-':
@@ -214,7 +214,7 @@ FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count)
}
return dstStr;
}
-FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
+int32_t FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
{
FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
FX_WCHAR wch1 = 0, wch2 = 0;
@@ -227,7 +227,7 @@ FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
}
return wch1 - wch2;
}
-FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
+int32_t FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
{
FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
FX_CHAR ch1 = 0, ch2 = 0;
@@ -240,11 +240,11 @@ FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
}
return ch1 - ch2;
}
-FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase)
+FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
- iLength = (FX_INT32)FXSYS_strlen(pStr);
+ iLength = (int32_t)FXSYS_strlen(pStr);
}
FX_LPCSTR pStrEnd = pStr + iLength;
FX_DWORD dwHashCode = 0;
@@ -259,11 +259,11 @@ FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgno
}
return dwHashCode;
}
-FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase)
+FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
- iLength = (FX_INT32)FXSYS_wcslen(pStr);
+ iLength = (int32_t)FXSYS_wcslen(pStr);
}
FX_LPCWSTR pStrEnd = pStr + iLength;
FX_DWORD dwHashCode = 0;
@@ -333,7 +333,7 @@ void FX_Random_MT_Close(FX_LPVOID pContext)
FXSYS_assert(pContext != NULL);
FX_Free(pContext);
}
-void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount)
+void FX_Random_GenerateMT(FX_LPDWORD pBuffer, int32_t iCount)
{
FX_DWORD dwSeed;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
@@ -349,7 +349,7 @@ void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount)
}
FX_Random_MT_Close(pContext);
}
-void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount)
+void FX_Random_GenerateBase(FX_LPDWORD pBuffer, int32_t iCount)
{
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
SYSTEMTIME st1, st2;
@@ -370,7 +370,7 @@ void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount)
}
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, FX_INT32 iCount)
+FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, int32_t iCount)
{
HCRYPTPROV hCP = NULL;
if (!::CryptAcquireContext(&hCP, NULL, NULL, PROV_RSA_FULL, 0) || hCP == NULL) {
@@ -381,7 +381,7 @@ FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, FX_INT32 iCount)
return TRUE;
}
#endif
-void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, FX_INT32 iCount)
+void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, int32_t iCount)
{
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
FX_GenerateCryptoRandom(pBuffer, iCount);
@@ -408,15 +408,15 @@ void FX_GUID_CreateV4(FX_LPGUID pGUID)
#else
FX_Random_GenerateMT((FX_LPDWORD)pGUID, 4);
#endif
- FX_BYTE &b = ((FX_LPBYTE)pGUID)[6];
+ uint8_t &b = ((FX_LPBYTE)pGUID)[6];
b = (b & 0x0F) | 0x40;
}
FX_LPCSTR gs_FX_pHexChars = "0123456789ABCDEF";
void FX_GUID_ToString(FX_LPCGUID pGUID, CFX_ByteString &bsStr, FX_BOOL bSeparator)
{
FX_LPSTR pBuf = bsStr.GetBuffer(40);
- FX_BYTE b;
- for (FX_INT32 i = 0; i < 16; i ++) {
+ uint8_t b;
+ for (int32_t i = 0; i < 16; i ++) {
b = ((FX_LPCBYTE)pGUID)[i];
*pBuf ++ = gs_FX_pHexChars[b >> 4];
*pBuf ++ = gs_FX_pHexChars[b & 0x0F];
diff --git a/core/src/fxcrt/fx_unicode.cpp b/core/src/fxcrt/fx_unicode.cpp
index aac6142ce4..0117c1ffc5 100644
--- a/core/src/fxcrt/fx_unicode.cpp
+++ b/core/src/fxcrt/fx_unicode.cpp
@@ -29,7 +29,7 @@ FX_BOOL FX_IsCombinationChar(FX_WCHAR wch)
FX_BOOL FX_IsBidiChar(FX_WCHAR wch)
{
FX_DWORD dwProps = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch];
- FX_INT32 iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
+ int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
return (FX_BIDICLASS_R == iBidiCls || FX_BIDICLASS_AL == iBidiCls);
}
FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical)
diff --git a/core/src/fxcrt/fx_xml_composer.cpp b/core/src/fxcrt/fx_xml_composer.cpp
index 97c5dfd130..7858290f9a 100644
--- a/core/src/fxcrt/fx_xml_composer.cpp
+++ b/core/src/fxcrt/fx_xml_composer.cpp
@@ -11,7 +11,7 @@ void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX
if (bsFullName.IsEmpty()) {
return;
}
- FX_INT32 iStart = 0;
+ int32_t iStart = 0;
for (; iStart < bsFullName.GetLength(); iStart ++) {
if (bsFullName.GetAt(iStart) == ':') {
break;
diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp
index 8049a5587e..040fefab63 100644
--- a/core/src/fxcrt/fx_xml_parser.cpp
+++ b/core/src/fxcrt/fx_xml_parser.cpp
@@ -70,7 +70,7 @@ FX_BOOL CXML_Parser::IsEOF()
#define FXCRTM_XML_CHARTYPE_HexLowerLetter 0x40
#define FXCRTM_XML_CHARTYPE_HexUpperLetter 0x60
#define FXCRTM_XML_CHARTYPE_HexChar 0x60
-FX_BYTE g_FXCRT_XML_ByteTypes[256] = {
+uint8_t g_FXCRT_XML_ByteTypes[256] = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,
@@ -88,27 +88,27 @@ FX_BYTE g_FXCRT_XML_ByteTypes[256] = {
0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x01, 0x01,
};
-FX_BOOL g_FXCRT_XML_IsWhiteSpace(FX_BYTE ch)
+FX_BOOL g_FXCRT_XML_IsWhiteSpace(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_SpaceChar) != 0;
}
-FX_BOOL g_FXCRT_XML_IsLetter(FX_BYTE ch)
+FX_BOOL g_FXCRT_XML_IsLetter(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Letter) != 0;
}
-FX_BOOL g_FXCRT_XML_IsDigital(FX_BYTE ch)
+FX_BOOL g_FXCRT_XML_IsDigital(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Digital) != 0;
}
-FX_BOOL g_FXCRT_XML_IsNameIntro(FX_BYTE ch)
+FX_BOOL g_FXCRT_XML_IsNameIntro(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameIntro) != 0;
}
-FX_BOOL g_FXCRT_XML_IsNameChar(FX_BYTE ch)
+FX_BOOL g_FXCRT_XML_IsNameChar(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameChar) != 0;
}
-FX_BOOL g_FXCRT_XML_IsHexChar(FX_BYTE ch)
+FX_BOOL g_FXCRT_XML_IsHexChar(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar) != 0;
}
@@ -135,7 +135,7 @@ void CXML_Parser::GetName(CFX_ByteString &space, CFX_ByteString &name)
return;
}
CFX_ByteTextBuf buf;
- FX_BYTE ch;
+ uint8_t ch;
do {
while (m_dwIndex < m_dwBufferSize) {
ch = m_pBuffer[m_dwIndex];
@@ -162,7 +162,7 @@ void CXML_Parser::SkipLiterals(FX_BSTR str)
if (IsEOF()) {
return;
}
- FX_INT32 i = 0, iLen = str.GetLength();
+ int32_t i = 0, iLen = str.GetLength();
do {
while (m_dwIndex < m_dwBufferSize) {
if (str.GetAt(i) != m_pBuffer[m_dwIndex ++]) {
@@ -194,8 +194,8 @@ FX_DWORD CXML_Parser::GetCharRef()
if (IsEOF()) {
return 0;
}
- FX_BYTE ch;
- FX_INT32 iState = 0;
+ uint8_t ch;
+ int32_t iState = 0;
CFX_ByteTextBuf buf;
FX_DWORD code = 0;
do {
@@ -252,7 +252,7 @@ FX_DWORD CXML_Parser::GetCharRef()
iState = 10;
break;
}
- FX_BYTE nHex = g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar;
+ uint8_t nHex = g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar;
if (nHex) {
if (nHex == FXCRTM_XML_CHARTYPE_HexDigital) {
code = (code << 4) + ch - '0';
@@ -282,7 +282,7 @@ void CXML_Parser::GetAttrValue(CFX_WideString &value)
return;
}
CFX_UTF8Decoder decoder;
- FX_BYTE mark = 0, ch = 0;
+ uint8_t mark = 0, ch = 0;
do {
while (m_dwIndex < m_dwBufferSize) {
ch = m_pBuffer[m_dwIndex];
@@ -323,8 +323,8 @@ void CXML_Parser::GetTagName(CFX_ByteString &space, CFX_ByteString &name, FX_BOO
return;
}
bEndTag = FALSE;
- FX_BYTE ch;
- FX_INT32 iState = bStartTag ? 1 : 0;
+ uint8_t ch;
+ int32_t iState = bStartTag ? 1 : 0;
do {
while (m_dwIndex < m_dwBufferSize) {
ch = m_pBuffer[m_dwIndex];
@@ -422,7 +422,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag
if (IsEOF()) {
return pElement;
}
- FX_BYTE ch = m_pBuffer[m_dwIndex ++];
+ uint8_t ch = m_pBuffer[m_dwIndex ++];
if (ch == '/') {
m_dwIndex ++;
m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
@@ -440,7 +440,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag
CFX_UTF8Decoder decoder;
CFX_WideTextBuf content;
FX_BOOL bCDATA = FALSE;
- FX_INT32 iState = 0;
+ int32_t iState = 0;
do {
while (m_dwIndex < m_dwBufferSize) {
ch = m_pBuffer[m_dwIndex ++];
@@ -604,7 +604,7 @@ void CXML_Element::Empty()
void CXML_Element::RemoveChildren()
{
for (int i = 0; i < m_Children.GetSize(); i += 2) {
- ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
+ ChildType type = (ChildType)(uintptr_t)m_Children.GetAt(i);
if (type == Content) {
CXML_Content* content = (CXML_Content*)m_Children.GetAt(i + 1);
delete content;
@@ -726,13 +726,13 @@ CXML_Element::ChildType CXML_Element::GetChildType(FX_DWORD index) const
if (index >= (FX_DWORD)m_Children.GetSize()) {
return Invalid;
}
- return (ChildType)(FX_UINTPTR)m_Children.GetAt(index);
+ return (ChildType)(uintptr_t)m_Children.GetAt(index);
}
CFX_WideString CXML_Element::GetContent(FX_DWORD index) const
{
index <<= 1;
if (index >= (FX_DWORD)m_Children.GetSize() ||
- (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Content) {
+ (ChildType)(uintptr_t)m_Children.GetAt(index) != Content) {
return CFX_WideString();
}
CXML_Content* pContent = (CXML_Content*)m_Children.GetAt(index + 1);
@@ -745,7 +745,7 @@ CXML_Element* CXML_Element::GetElement(FX_DWORD index) const
{
index <<= 1;
if (index >= (FX_DWORD)m_Children.GetSize() ||
- (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Element) {
+ (ChildType)(uintptr_t)m_Children.GetAt(index) != Element) {
return NULL;
}
return (CXML_Element*)m_Children.GetAt(index + 1);
@@ -754,7 +754,7 @@ FX_DWORD CXML_Element::CountElements(FX_BSTR space, FX_BSTR tag) const
{
int count = 0;
for (int i = 0; i < m_Children.GetSize(); i += 2) {
- ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
+ ChildType type = (ChildType)(uintptr_t)m_Children.GetAt(i);
if (type != Element) {
continue;
}
@@ -771,7 +771,7 @@ CXML_Element* CXML_Element::GetElement(FX_BSTR space, FX_BSTR tag, int index) co
return NULL;
}
for (int i = 0; i < m_Children.GetSize(); i += 2) {
- ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
+ ChildType type = (ChildType)(uintptr_t)m_Children.GetAt(i);
if (type != Element) {
continue;
}
@@ -788,7 +788,7 @@ CXML_Element* CXML_Element::GetElement(FX_BSTR space, FX_BSTR tag, int index) co
FX_DWORD CXML_Element::FindElement(CXML_Element *pChild) const
{
for (int i = 0; i < m_Children.GetSize(); i += 2) {
- if ((ChildType)(FX_UINTPTR)m_Children.GetAt(i) == Element &&
+ if ((ChildType)(uintptr_t)m_Children.GetAt(i) == Element &&
(CXML_Element*)m_Children.GetAt(i + 1) == pChild) {
return (FX_DWORD)(i >> 1);
}
diff --git a/core/src/fxcrt/fxcrt_platforms.cpp b/core/src/fxcrt/fxcrt_platforms.cpp
index 0781ba436c..74affbe4b9 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(FX_BYTE, 32768);
+ FX_LPBYTE 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 5bc2dd44d2..701c910551 100644
--- a/core/src/fxcrt/fxcrt_posix.cpp
+++ b/core/src/fxcrt/fxcrt_posix.cpp
@@ -11,7 +11,7 @@ IFXCRT_FileAccess* FXCRT_FileAccess_Create()
{
return FX_NEW CFXCRT_FileAccess_Posix;
}
-void FXCRT_Posix_GetFileMode(FX_DWORD dwModes, FX_INT32 &nFlags, FX_INT32 &nMasks)
+void FXCRT_Posix_GetFileMode(FX_DWORD dwModes, int32_t &nFlags, int32_t &nMasks)
{
nFlags = O_BINARY | O_LARGEFILE;
if (dwModes & FX_FILEMODE_ReadOnly) {
@@ -38,7 +38,7 @@ FX_BOOL CFXCRT_FileAccess_Posix::Open(FX_BSTR fileName, FX_DWORD dwMode)
if (m_nFD > -1) {
return FALSE;
}
- FX_INT32 nFlags, nMasks;
+ int32_t nFlags, nMasks;
FXCRT_Posix_GetFileMode(dwMode, nFlags, nMasks);
m_nFD = open(fileName.GetCStr(), nFlags, nMasks);
return m_nFD > -1;
@@ -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(FX_BYTE, 32768);
+ FX_LPBYTE 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_posix.h b/core/src/fxcrt/fxcrt_posix.h
index 8c716cd6d6..0b4509ec73 100644
--- a/core/src/fxcrt/fxcrt_posix.h
+++ b/core/src/fxcrt/fxcrt_posix.h
@@ -29,7 +29,7 @@ public:
virtual FX_BOOL Flush();
virtual FX_BOOL Truncate(FX_FILESIZE szFile);
protected:
- FX_INT32 m_nFD;
+ int32_t m_nFD;
};
#endif
diff --git a/core/src/fxcrt/xml_int.h b/core/src/fxcrt/xml_int.h
index 7cfeec95f7..4155a39ffa 100644
--- a/core/src/fxcrt/xml_int.h
+++ b/core/src/fxcrt/xml_int.h
@@ -107,7 +107,7 @@ public:
}
m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart);
if (!m_pBuffer) {
- m_pBuffer = FX_Alloc(FX_BYTE, m_dwSize);
+ m_pBuffer = FX_Alloc(uint8_t, m_dwSize);
}
return m_pFileRead->ReadBlock(m_pBuffer, m_nStart, m_dwSize);
}