summaryrefslogtreecommitdiff
path: root/xfa/src/fgas/src/xml
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fgas/src/xml')
-rw-r--r--xfa/src/fgas/src/xml/fx_sax_imp.cpp42
-rw-r--r--xfa/src/fgas/src/xml/fx_sax_imp.h34
2 files changed, 38 insertions, 38 deletions
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.cpp b/xfa/src/fgas/src/xml/fx_sax_imp.cpp
index b41ee3fef4..fedf89f9f9 100644
--- a/xfa/src/fgas/src/xml/fx_sax_imp.cpp
+++ b/xfa/src/fgas/src/xml/fx_sax_imp.cpp
@@ -34,7 +34,7 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead *pFile, FX_DWORD dwStart, FX_DWORD d
return FALSE;
}
m_dwBufSize = FX_MIN(dwLen, FX_SAXFILE_BUFSIZE);
- m_pBuf = FX_Alloc(FX_BYTE, m_dwBufSize);
+ m_pBuf = FX_Alloc(uint8_t, m_dwBufSize);
if (!m_pBuf) {
return FALSE;
}
@@ -72,7 +72,7 @@ void CFX_SAXFile::Reset()
}
#define FX_SAXCHARTYPE_Normal 0
#define FX_SAXCHARTYPE_Space 1
-static FX_BYTE g_SAX_CharType[256] = {
+static uint8_t g_SAX_CharType[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -102,8 +102,8 @@ CFX_SAXReader::CFX_SAXReader()
, m_pCommentContext(NULL)
, m_dwParseMode(0)
{
- m_pszData = (FX_LPBYTE)FX_Alloc(FX_BYTE, m_iDataSize);
- m_pszName = (FX_LPBYTE)FX_Alloc(FX_BYTE, m_iNameSize);
+ m_pszData = (FX_LPBYTE)FX_Alloc(uint8_t, m_iDataSize);
+ m_pszName = (FX_LPBYTE)FX_Alloc(uint8_t, m_iNameSize);
}
CFX_SAXReader::~CFX_SAXReader()
{
@@ -159,12 +159,12 @@ inline void CFX_SAXReader::Pop()
delete m_pCurItem;
m_pCurItem = pPrev;
}
-inline void CFX_SAXReader::AppendData(FX_BYTE ch)
+inline void CFX_SAXReader::AppendData(uint8_t ch)
{
ReallocDataBuffer();
m_pszData[m_iDataPos++] = ch;
}
-inline void CFX_SAXReader::AppendName(FX_BYTE ch)
+inline void CFX_SAXReader::AppendName(uint8_t ch)
{
ReallocNameBuffer();
m_pszName[m_iDataPos++] = ch;
@@ -179,7 +179,7 @@ void CFX_SAXReader::ReallocDataBuffer()
} else {
m_iDataSize += 1024 * 1024;
}
- m_pszData = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pszData, m_iDataSize);
+ m_pszData = (FX_LPBYTE)FX_Realloc(uint8_t, m_pszData, m_iDataSize);
}
void CFX_SAXReader::ReallocNameBuffer()
{
@@ -191,13 +191,13 @@ void CFX_SAXReader::ReallocNameBuffer()
} else {
m_iNameSize += 1024 * 1024;
}
- m_pszName = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pszName, m_iNameSize);
+ m_pszName = (FX_LPBYTE)FX_Realloc(uint8_t, m_pszName, m_iNameSize);
}
-inline FX_BOOL CFX_SAXReader::SkipSpace(FX_BYTE ch)
+inline FX_BOOL CFX_SAXReader::SkipSpace(uint8_t ch)
{
return (m_dwParseMode & FX_SAXPARSEMODE_NotSkipSpace) == 0 && ch < 0x21;
}
-FX_INT32 CFX_SAXReader::StartParse(IFX_FileRead *pFile, FX_DWORD dwStart , FX_DWORD dwLen , FX_DWORD dwParseMode )
+int32_t CFX_SAXReader::StartParse(IFX_FileRead *pFile, FX_DWORD dwStart , FX_DWORD dwLen , FX_DWORD dwParseMode )
{
m_iState = -1;
Reset();
@@ -231,7 +231,7 @@ static const FX_SAXReader_LPFParse g_FX_SAXReader_LPFParse[FX_SAXMODE_MAX] = {
&CFX_SAXReader::ParseTagEnd,
&CFX_SAXReader::ParseTargetData,
};
-FX_INT32 CFX_SAXReader::ContinueParse(IFX_Pause *pPause )
+int32_t CFX_SAXReader::ContinueParse(IFX_Pause *pPause )
{
if (m_iState < 0 || m_iState > 99) {
return m_iState;
@@ -261,21 +261,21 @@ FX_INT32 CFX_SAXReader::ContinueParse(IFX_Pause *pPause )
}
return m_iState;
}
-void CFX_SAXReader::ParseChar(FX_BYTE ch)
+void CFX_SAXReader::ParseChar(uint8_t ch)
{
ReallocDataBuffer();
m_pszData[m_iDataPos] = ch;
if (m_iEntityStart > -1 && ch == ';') {
- FX_INT32 iSaveEntityStart = m_iEntityStart;
+ int32_t iSaveEntityStart = m_iEntityStart;
CFX_ByteString csEntity(m_pszData + m_iEntityStart + 1, m_iDataPos - m_iEntityStart - 1);
- FX_INT32 iLen = csEntity.GetLength();
+ int32_t iLen = csEntity.GetLength();
if (iLen > 0) {
if (csEntity[0] == '#') {
if ((m_dwParseMode & FX_SAXPARSEMODE_NotConvert_sharp) == 0) {
ch = 0;
- FX_BYTE w;
+ uint8_t w;
if (iLen > 1 && csEntity[1] == 'x') {
- for (FX_INT32 i = 2; i < iLen; i ++) {
+ for (int32_t i = 2; i < iLen; i ++) {
w = csEntity[i];
if (w >= '0' && w <= '9') {
ch = (ch << 4) + w - '0';
@@ -288,7 +288,7 @@ void CFX_SAXReader::ParseChar(FX_BYTE ch)
}
}
} else {
- for (FX_INT32 i = 1; i < iLen; i ++) {
+ for (int32_t i = 1; i < iLen; i ++) {
w = csEntity[i];
if (w < '0' || w > '9') {
break;
@@ -592,7 +592,7 @@ void CFX_SAXReader::ParseTargetData()
}
void CFX_SAXReader::SkipNode()
{
- FX_INT32 iLen = m_SkipStack.GetSize();
+ int32_t iLen = m_SkipStack.GetSize();
if (m_SkipChar == '\'' || m_SkipChar == '\"') {
if (m_CurByte != m_SkipChar) {
return;
@@ -633,12 +633,12 @@ void CFX_SAXReader::SkipNode()
m_iDataLength = m_iDataPos;
m_iDataPos = 0;
if (m_iDataLength >= 9
- && FXSYS_memcmp(m_pszData, "[CDATA[", 7 * sizeof(FX_BYTE)) == 0
- && FXSYS_memcmp(m_pszData + m_iDataLength - 2, "]]", 2 * sizeof(FX_BYTE)) == 0) {
+ && FXSYS_memcmp(m_pszData, "[CDATA[", 7 * sizeof(uint8_t)) == 0
+ && FXSYS_memcmp(m_pszData + m_iDataLength - 2, "]]", 2 * sizeof(uint8_t)) == 0) {
Pop();
m_iDataLength -= 9;
m_dwDataOffset += 7;
- FXSYS_memmove(m_pszData , m_pszData + 7, m_iDataLength * sizeof(FX_BYTE));
+ FXSYS_memmove(m_pszData , m_pszData + 7, m_iDataLength * sizeof(uint8_t));
m_bCharData = TRUE;
if (m_pHandler) {
NotifyData();
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.h b/xfa/src/fgas/src/xml/fx_sax_imp.h
index 444bcbdf8e..a2f7259235 100644
--- a/xfa/src/fgas/src/xml/fx_sax_imp.h
+++ b/xfa/src/fgas/src/xml/fx_sax_imp.h
@@ -63,8 +63,8 @@ public:
, m_iTailCount(0)
{
}
- FX_INT32 m_iHeaderCount;
- FX_INT32 m_iTailCount;
+ int32_t m_iHeaderCount;
+ int32_t m_iTailCount;
};
class CFX_SAXReader : public IFX_SAXReader
{
@@ -75,12 +75,12 @@ public:
{
delete this;
}
- virtual FX_INT32 StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0);
- virtual FX_INT32 ContinueParse(IFX_Pause *pPause = NULL);
+ virtual int32_t StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0);
+ virtual int32_t ContinueParse(IFX_Pause *pPause = NULL);
virtual void SkipCurrentNode();
virtual void SetHandler(IFX_SAXReaderHandler *pHandler);
- void AppendData(FX_BYTE ch);
- void AppendName(FX_BYTE ch);
+ void AppendData(uint8_t ch);
+ void AppendName(uint8_t ch);
void ParseText();
void ParseNodeStart();
void ParseInstruction();
@@ -99,32 +99,32 @@ public:
protected:
CFX_SAXFile m_File;
IFX_SAXReaderHandler* m_pHandler;
- FX_INT32 m_iState;
+ int32_t m_iState;
CFX_SAXItem* m_pRoot;
CFX_SAXItem* m_pCurItem;
FX_DWORD m_dwItemID;
FX_SAXMODE m_eMode;
FX_SAXMODE m_ePrevMode;
FX_BOOL m_bCharData;
- FX_BYTE m_CurByte;
+ uint8_t m_CurByte;
FX_DWORD m_dwDataOffset;
CFX_ByteArray m_SkipStack;
- FX_BYTE m_SkipChar;
+ uint8_t m_SkipChar;
FX_DWORD m_dwNodePos;
FX_LPBYTE m_pszData;
- FX_INT32 m_iDataSize;
- FX_INT32 m_iDataLength;
- FX_INT32 m_iEntityStart;
- FX_INT32 m_iDataPos;
+ int32_t m_iDataSize;
+ int32_t m_iDataLength;
+ int32_t m_iEntityStart;
+ int32_t m_iDataPos;
FX_LPBYTE m_pszName;
- FX_INT32 m_iNameSize;
- FX_INT32 m_iNameLength;
+ int32_t m_iNameSize;
+ int32_t m_iNameLength;
FX_DWORD m_dwParseMode;
CFX_SAXCommentContext *m_pCommentContext;
void Reset();
void Push();
void Pop();
- FX_BOOL SkipSpace(FX_BYTE ch);
+ FX_BOOL SkipSpace(uint8_t ch);
void SkipNode();
void NotifyData();
void NotifyEnter();
@@ -135,6 +135,6 @@ protected:
void NotifyTargetData();
void ReallocDataBuffer();
void ReallocNameBuffer();
- void ParseChar(FX_BYTE ch);
+ void ParseChar(uint8_t ch);
};
#endif