diff options
Diffstat (limited to 'xfa/fgas/crt')
-rw-r--r-- | xfa/fgas/crt/fgas_codepage.cpp | 4 | ||||
-rw-r--r-- | xfa/fgas/crt/fgas_codepage.h | 2 | ||||
-rw-r--r-- | xfa/fgas/crt/fgas_stream.cpp | 300 | ||||
-rw-r--r-- | xfa/fgas/crt/fgas_stream.h | 8 | ||||
-rw-r--r-- | xfa/fgas/crt/fgas_utils.cpp | 18 | ||||
-rw-r--r-- | xfa/fgas/crt/fgas_utils.h | 30 |
6 files changed, 170 insertions, 192 deletions
diff --git a/xfa/fgas/crt/fgas_codepage.cpp b/xfa/fgas/crt/fgas_codepage.cpp index 86aeb7b983..36f87a36f3 100644 --- a/xfa/fgas/crt/fgas_codepage.cpp +++ b/xfa/fgas/crt/fgas_codepage.cpp @@ -380,7 +380,7 @@ int32_t FX_DecodeString(uint16_t wCodePage, int32_t* pSrcLen, FX_WCHAR* pDst, int32_t* pDstLen, - FX_BOOL bErrBreak) { + bool bErrBreak) { if (wCodePage == FX_CODEPAGE_UTF8) { return FX_UTF8Decode(pSrc, pSrcLen, pDst, pDstLen); } @@ -399,7 +399,7 @@ int32_t FX_UTF8Decode(const FX_CHAR* pSrc, return 1; } int32_t iDstLen = *pDstLen; - FX_BOOL bValidDst = (pDst && iDstLen > 0); + bool bValidDst = (pDst && iDstLen > 0); uint32_t dwCode = 0; int32_t iPending = 0; int32_t iSrcNum = 0, iDstNum = 0; diff --git a/xfa/fgas/crt/fgas_codepage.h b/xfa/fgas/crt/fgas_codepage.h index 2beed27552..780c20e233 100644 --- a/xfa/fgas/crt/fgas_codepage.h +++ b/xfa/fgas/crt/fgas_codepage.h @@ -144,7 +144,7 @@ int32_t FX_DecodeString(uint16_t wCodePage, int32_t* pSrcLen, FX_WCHAR* pDst, int32_t* pDstLen, - FX_BOOL bErrBreak); + bool bErrBreak); int32_t FX_UTF8Decode(const FX_CHAR* pSrc, int32_t* pSrcLen, FX_WCHAR* pDst, diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp index 6da4e9ed8c..c3850c00bb 100644 --- a/xfa/fgas/crt/fgas_stream.cpp +++ b/xfa/fgas/crt/fgas_stream.cpp @@ -25,15 +25,15 @@ class IFX_StreamImp { virtual int32_t GetLength() const = 0; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0; virtual int32_t GetPosition() = 0; - virtual FX_BOOL IsEOF() const = 0; + virtual bool IsEOF() const = 0; virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) = 0; virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, - FX_BOOL& bEOS) = 0; + bool& bEOS) = 0; virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) = 0; virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) = 0; virtual void Flush() = 0; - virtual FX_BOOL SetLength(int32_t iLength) = 0; + virtual bool SetLength(int32_t iLength) = 0; protected: IFX_StreamImp(); @@ -50,21 +50,19 @@ class CFX_FileStreamImp : public IFX_StreamImp { CFX_FileStreamImp(); ~CFX_FileStreamImp() override; - FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess); + bool LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess); // IFX_StreamImp: int32_t GetLength() const override; int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override; int32_t GetPosition() override; - FX_BOOL IsEOF() const override; + bool IsEOF() const override; int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override; - int32_t ReadString(FX_WCHAR* pStr, - int32_t iMaxLength, - FX_BOOL& bEOS) override; + int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override; int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override; int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override; void Flush() override; - FX_BOOL SetLength(int32_t iLength) override; + bool SetLength(int32_t iLength) override; protected: FXSYS_FILE* m_hFile; @@ -76,21 +74,19 @@ class CFX_BufferStreamImp : public IFX_StreamImp { CFX_BufferStreamImp(); ~CFX_BufferStreamImp() override {} - FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess); + bool LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess); // IFX_StreamImp: int32_t GetLength() const override; int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override; int32_t GetPosition() override; - FX_BOOL IsEOF() const override; + bool IsEOF() const override; int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override; - int32_t ReadString(FX_WCHAR* pStr, - int32_t iMaxLength, - FX_BOOL& bEOS) override; + int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override; int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override; int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override; void Flush() override {} - FX_BOOL SetLength(int32_t iLength) override { return FALSE; } + bool SetLength(int32_t iLength) override { return false; } protected: uint8_t* m_pData; @@ -104,17 +100,15 @@ class CFX_FileReadStreamImp : public IFX_StreamImp { CFX_FileReadStreamImp(); ~CFX_FileReadStreamImp() override {} - FX_BOOL LoadFileRead(IFX_SeekableReadStream* pFileRead, uint32_t dwAccess); + bool LoadFileRead(IFX_SeekableReadStream* pFileRead, uint32_t dwAccess); // IFX_StreamImp: int32_t GetLength() const override; int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override; int32_t GetPosition() override { return m_iPosition; } - FX_BOOL IsEOF() const override; + bool IsEOF() const override; int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override; - int32_t ReadString(FX_WCHAR* pStr, - int32_t iMaxLength, - FX_BOOL& bEOS) override; + int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override; int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override { return 0; } @@ -122,7 +116,7 @@ class CFX_FileReadStreamImp : public IFX_StreamImp { return 0; } void Flush() override {} - FX_BOOL SetLength(int32_t iLength) override { return FALSE; } + bool SetLength(int32_t iLength) override { return false; } protected: IFX_SeekableReadStream* m_pFileRead; @@ -135,20 +129,18 @@ class CFX_BufferReadStreamImp : public IFX_StreamImp { CFX_BufferReadStreamImp(); ~CFX_BufferReadStreamImp() override; - FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead, - int32_t iFileSize, - uint32_t dwAccess, - FX_BOOL bReleaseBufferRead); + bool LoadBufferRead(IFX_BufferRead* pBufferRead, + int32_t iFileSize, + uint32_t dwAccess, + bool bReleaseBufferRead); // IFX_StreamImp: int32_t GetLength() const override; int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override; int32_t GetPosition() override { return m_iPosition; } - FX_BOOL IsEOF() const override; + bool IsEOF() const override; int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override; - int32_t ReadString(FX_WCHAR* pStr, - int32_t iMaxLength, - FX_BOOL& bEOS) override; + int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override; int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override { return 0; } @@ -156,11 +148,11 @@ class CFX_BufferReadStreamImp : public IFX_StreamImp { return 0; } void Flush() override {} - FX_BOOL SetLength(int32_t iLength) override { return FALSE; } + bool SetLength(int32_t iLength) override { return false; } private: IFX_BufferRead* m_pBufferRead; - FX_BOOL m_bReleaseBufferRead; + bool m_bReleaseBufferRead; int32_t m_iPosition; int32_t m_iBufferSize; }; @@ -170,23 +162,21 @@ class CFX_FileWriteStreamImp : public IFX_StreamImp { CFX_FileWriteStreamImp(); ~CFX_FileWriteStreamImp() override {} - FX_BOOL LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, uint32_t dwAccess); + bool LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, uint32_t dwAccess); // IFX_StreamImp: int32_t GetLength() const override; int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override; int32_t GetPosition() override { return m_iPosition; } - FX_BOOL IsEOF() const override; + bool IsEOF() const override; int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override { return 0; } - int32_t ReadString(FX_WCHAR* pStr, - int32_t iMaxLength, - FX_BOOL& bEOS) override { + int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override { return 0; } int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override; int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override; void Flush() override; - FX_BOOL SetLength(int32_t iLength) override { return FALSE; } + bool SetLength(int32_t iLength) override { return false; } protected: IFX_SeekableWriteStream* m_pFileWrite; @@ -206,14 +196,14 @@ class CFX_Stream : public IFX_Stream { CFX_Stream(); ~CFX_Stream() override; - FX_BOOL LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess); - FX_BOOL LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess); - FX_BOOL LoadFileRead(IFX_SeekableReadStream* pFileRead, uint32_t dwAccess); - FX_BOOL LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, uint32_t dwAccess); - FX_BOOL LoadBufferRead(IFX_BufferRead* pBufferRead, - int32_t iFileSize, - uint32_t dwAccess, - FX_BOOL bReleaseBufferRead); + bool LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess); + bool LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess); + bool LoadFileRead(IFX_SeekableReadStream* pFileRead, uint32_t dwAccess); + bool LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, uint32_t dwAccess); + bool LoadBufferRead(IFX_BufferRead* pBufferRead, + int32_t iFileSize, + uint32_t dwAccess, + bool bReleaseBufferRead); // IFX_Stream void Release() override; @@ -222,15 +212,13 @@ class CFX_Stream : public IFX_Stream { int32_t GetLength() const override; int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override; int32_t GetPosition() override; - FX_BOOL IsEOF() const override; + bool IsEOF() const override; int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override; - int32_t ReadString(FX_WCHAR* pStr, - int32_t iMaxLength, - FX_BOOL& bEOS) override; + int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override; int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override; int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override; void Flush() override; - FX_BOOL SetLength(int32_t iLength) override; + bool SetLength(int32_t iLength) override; int32_t GetBOM(uint8_t bom[4]) const override; uint16_t GetCodePage() const override; uint16_t SetCodePage(uint16_t wCodePage) override; @@ -251,7 +239,7 @@ class CFX_Stream : public IFX_Stream { class CFX_TextStream : public IFX_Stream { public: - CFX_TextStream(IFX_Stream* pStream, FX_BOOL bDelStream); + CFX_TextStream(IFX_Stream* pStream, bool bDelStream); ~CFX_TextStream() override; // IFX_Stream @@ -261,15 +249,13 @@ class CFX_TextStream : public IFX_Stream { int32_t GetLength() const override; int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) override; int32_t GetPosition() override; - FX_BOOL IsEOF() const override; + bool IsEOF() const override; int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) override; - int32_t ReadString(FX_WCHAR* pStr, - int32_t iMaxLength, - FX_BOOL& bEOS) override; + int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) override; int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) override; int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) override; void Flush() override; - FX_BOOL SetLength(int32_t iLength) override; + bool SetLength(int32_t iLength) override; int32_t GetBOM(uint8_t bom[4]) const override; uint16_t GetCodePage() const override; uint16_t SetCodePage(uint16_t wCodePage) override; @@ -283,7 +269,7 @@ class CFX_TextStream : public IFX_Stream { uint32_t m_dwBOM; uint8_t* m_pBuf; int32_t m_iBufSize; - FX_BOOL m_bDelStream; + bool m_bDelStream; IFX_Stream* m_pStreamImp; int32_t m_iRefCount; void InitStream(); @@ -317,7 +303,7 @@ int32_t FileLength(FXSYS_FILE* file) { #endif } -FX_BOOL FileSetSize(FXSYS_FILE* file, int32_t size) { +bool FileSetSize(FXSYS_FILE* file, int32_t size) { ASSERT(file); #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ return _chsize(_fileno(file), size) == 0; @@ -325,11 +311,11 @@ FX_BOOL FileSetSize(FXSYS_FILE* file, int32_t size) { HANDLE hFile = _fileno(file); uint32_t dwPos = ::SetFilePointer(hFile, 0, 0, FILE_CURRENT); ::SetFilePointer(hFile, size, 0, FILE_BEGIN); - FX_BOOL bRet = ::SetEndOfFile(hFile); + bool bRet = ::SetEndOfFile(hFile); ::SetFilePointer(hFile, (int32_t)dwPos, 0, FILE_BEGIN); return bRet; #else - return FALSE; + return false; #endif } @@ -344,7 +330,7 @@ IFX_Stream* IFX_Stream::CreateStream(IFX_SeekableReadStream* pFileRead, return nullptr; } if (dwAccess & FX_STREAMACCESS_Text) { - return new CFX_TextStream(pSR, TRUE); + return new CFX_TextStream(pSR, true); } return pSR; } @@ -358,7 +344,7 @@ IFX_Stream* IFX_Stream::CreateStream(IFX_SeekableWriteStream* pFileWrite, return nullptr; } if (dwAccess & FX_STREAMACCESS_Text) { - return new CFX_TextStream(pSR, TRUE); + return new CFX_TextStream(pSR, true); } return pSR; } @@ -373,7 +359,7 @@ IFX_Stream* IFX_Stream::CreateStream(uint8_t* pData, return nullptr; } if (dwAccess & FX_STREAMACCESS_Text) { - return new CFX_TextStream(pSR, TRUE); + return new CFX_TextStream(pSR, true); } return pSR; } @@ -387,8 +373,8 @@ CFX_FileStreamImp::~CFX_FileStreamImp() { FXSYS_fclose(m_hFile); } -FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName, - uint32_t dwAccess) { +bool CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName, + uint32_t dwAccess) { ASSERT(!m_hFile); ASSERT(pszSrcFileName && FXSYS_wcslen(pszSrcFileName) > 0); #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \ @@ -415,13 +401,13 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName, if (!m_hFile) { m_hFile = FXSYS_wfopen(pszSrcFileName, L"r+b"); if (!m_hFile) - return FALSE; + return false; if (dwAccess & FX_STREAMACCESS_Truncate) FileSetSize(m_hFile, 0); } } else { - return FALSE; + return false; } } #else @@ -445,14 +431,14 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName, if (!m_hFile) { m_hFile = FXSYS_fopen(szFileName.c_str(), "r+b"); if (!m_hFile) { - return FALSE; + return false; } if (dwAccess & FX_STREAMACCESS_Truncate) { FileSetSize(m_hFile, 0); } } } else { - return FALSE; + return false; } } #endif @@ -463,7 +449,7 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName, } else { m_iLength = FileLength(m_hFile); } - return TRUE; + return true; } int32_t CFX_FileStreamImp::GetLength() const { ASSERT(m_hFile); @@ -478,7 +464,7 @@ int32_t CFX_FileStreamImp::GetPosition() { ASSERT(m_hFile); return FXSYS_ftell(m_hFile); } -FX_BOOL CFX_FileStreamImp::IsEOF() const { +bool CFX_FileStreamImp::IsEOF() const { ASSERT(m_hFile); return FXSYS_ftell(m_hFile) >= m_iLength; } @@ -489,7 +475,7 @@ int32_t CFX_FileStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { } int32_t CFX_FileStreamImp::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, - FX_BOOL& bEOS) { + bool& bEOS) { ASSERT(m_hFile); ASSERT(pStr && iMaxLength > 0); if (m_iLength <= 0) { @@ -541,23 +527,23 @@ void CFX_FileStreamImp::Flush() { ASSERT(m_hFile && (GetAccessModes() & FX_STREAMACCESS_Write) != 0); FXSYS_fflush(m_hFile); } -FX_BOOL CFX_FileStreamImp::SetLength(int32_t iLength) { +bool CFX_FileStreamImp::SetLength(int32_t iLength) { ASSERT(m_hFile && (GetAccessModes() & FX_STREAMACCESS_Write) != 0); - FX_BOOL bRet = FileSetSize(m_hFile, iLength); + bool bRet = FileSetSize(m_hFile, iLength); m_iLength = FileLength(m_hFile); return bRet; } CFX_FileReadStreamImp::CFX_FileReadStreamImp() : m_pFileRead(nullptr), m_iPosition(0), m_iLength(0) {} -FX_BOOL CFX_FileReadStreamImp::LoadFileRead(IFX_SeekableReadStream* pFileRead, - uint32_t dwAccess) { +bool CFX_FileReadStreamImp::LoadFileRead(IFX_SeekableReadStream* pFileRead, + uint32_t dwAccess) { ASSERT(!m_pFileRead && pFileRead); if (dwAccess & FX_STREAMACCESS_Write) { - return FALSE; + return false; } m_pFileRead = pFileRead; m_iLength = m_pFileRead->GetSize(); - return TRUE; + return true; } int32_t CFX_FileReadStreamImp::GetLength() const { return m_iLength; @@ -581,7 +567,7 @@ int32_t CFX_FileReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { } return m_iPosition; } -FX_BOOL CFX_FileReadStreamImp::IsEOF() const { +bool CFX_FileReadStreamImp::IsEOF() const { return m_iPosition >= m_iLength; } int32_t CFX_FileReadStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { @@ -598,7 +584,7 @@ int32_t CFX_FileReadStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { } int32_t CFX_FileReadStreamImp::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, - FX_BOOL& bEOS) { + bool& bEOS) { ASSERT(m_pFileRead); ASSERT(pStr && iMaxLength > 0); iMaxLength = ReadData((uint8_t*)pStr, iMaxLength * 2) / 2; @@ -614,7 +600,7 @@ int32_t CFX_FileReadStreamImp::ReadString(FX_WCHAR* pStr, } CFX_BufferReadStreamImp::CFX_BufferReadStreamImp() : m_pBufferRead(nullptr), - m_bReleaseBufferRead(FALSE), + m_bReleaseBufferRead(false), m_iPosition(0), m_iBufferSize(0) {} CFX_BufferReadStreamImp::~CFX_BufferReadStreamImp() { @@ -622,29 +608,29 @@ CFX_BufferReadStreamImp::~CFX_BufferReadStreamImp() { m_pBufferRead->Release(); } } -FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead* pBufferRead, - int32_t iFileSize, - uint32_t dwAccess, - FX_BOOL bReleaseBufferRead) { +bool CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead* pBufferRead, + int32_t iFileSize, + uint32_t dwAccess, + bool bReleaseBufferRead) { ASSERT(!m_pBufferRead && pBufferRead); if (dwAccess & FX_STREAMACCESS_Write) { - return FALSE; + return false; } m_bReleaseBufferRead = bReleaseBufferRead; m_pBufferRead = pBufferRead; m_iBufferSize = iFileSize; if (m_iBufferSize >= 0) { - return TRUE; + return true; } - if (!m_pBufferRead->ReadNextBlock(TRUE)) { - return FALSE; + if (!m_pBufferRead->ReadNextBlock(true)) { + return false; } m_iBufferSize = m_pBufferRead->GetBlockSize(); while (!m_pBufferRead->IsEOF()) { - m_pBufferRead->ReadNextBlock(FALSE); + m_pBufferRead->ReadNextBlock(false); m_iBufferSize += m_pBufferRead->GetBlockSize(); } - return TRUE; + return true; } int32_t CFX_BufferReadStreamImp::GetLength() const { return m_iBufferSize; @@ -669,8 +655,8 @@ int32_t CFX_BufferReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { } return m_iPosition; } -FX_BOOL CFX_BufferReadStreamImp::IsEOF() const { - return m_pBufferRead ? m_pBufferRead->IsEOF() : TRUE; +bool CFX_BufferReadStreamImp::IsEOF() const { + return m_pBufferRead ? m_pBufferRead->IsEOF() : true; } int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { @@ -686,7 +672,7 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, uint32_t dwBlockOffset = m_pBufferRead->GetBlockOffset(); uint32_t dwBlockSize = m_pBufferRead->GetBlockSize(); if (m_iPosition < (int32_t)dwBlockOffset) { - if (!m_pBufferRead->ReadNextBlock(TRUE)) { + if (!m_pBufferRead->ReadNextBlock(true)) { return 0; } dwBlockOffset = m_pBufferRead->GetBlockOffset(); @@ -694,7 +680,7 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, } while (m_iPosition < (int32_t)dwBlockOffset || m_iPosition >= (int32_t)(dwBlockOffset + dwBlockSize)) { - if (m_pBufferRead->IsEOF() || !m_pBufferRead->ReadNextBlock(FALSE)) { + if (m_pBufferRead->IsEOF() || !m_pBufferRead->ReadNextBlock(false)) { break; } dwBlockOffset = m_pBufferRead->GetBlockOffset(); @@ -712,7 +698,7 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, dwOffsetTmp = dwCopySize; iBufferSize -= dwCopySize; while (iBufferSize > 0) { - if (!m_pBufferRead->ReadNextBlock(FALSE)) { + if (!m_pBufferRead->ReadNextBlock(false)) { break; } dwBlockOffset = m_pBufferRead->GetBlockOffset(); @@ -728,7 +714,7 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, } int32_t CFX_BufferReadStreamImp::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, - FX_BOOL& bEOS) { + bool& bEOS) { ASSERT(m_pBufferRead); ASSERT(pStr && iMaxLength > 0); iMaxLength = ReadData((uint8_t*)pStr, iMaxLength * 2) / 2; @@ -744,18 +730,17 @@ int32_t CFX_BufferReadStreamImp::ReadString(FX_WCHAR* pStr, } CFX_FileWriteStreamImp::CFX_FileWriteStreamImp() : m_pFileWrite(nullptr), m_iPosition(0) {} -FX_BOOL CFX_FileWriteStreamImp::LoadFileWrite( - IFX_SeekableWriteStream* pFileWrite, - uint32_t dwAccess) { +bool CFX_FileWriteStreamImp::LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, + uint32_t dwAccess) { ASSERT(!m_pFileWrite && pFileWrite); if (dwAccess & FX_STREAMACCESS_Read) { - return FALSE; + return false; } if (dwAccess & FX_STREAMACCESS_Append) { m_iPosition = pFileWrite->GetSize(); } m_pFileWrite = pFileWrite; - return TRUE; + return true; } int32_t CFX_FileWriteStreamImp::GetLength() const { if (!m_pFileWrite) { @@ -783,7 +768,7 @@ int32_t CFX_FileWriteStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { } return m_iPosition; } -FX_BOOL CFX_FileWriteStreamImp::IsEOF() const { +bool CFX_FileWriteStreamImp::IsEOF() const { return m_iPosition >= GetLength(); } int32_t CFX_FileWriteStreamImp::WriteData(const uint8_t* pBuffer, @@ -808,16 +793,16 @@ void CFX_FileWriteStreamImp::Flush() { CFX_BufferStreamImp::CFX_BufferStreamImp() : m_pData(nullptr), m_iTotalSize(0), m_iPosition(0), m_iLength(0) {} -FX_BOOL CFX_BufferStreamImp::LoadBuffer(uint8_t* pData, - int32_t iTotalSize, - uint32_t dwAccess) { +bool CFX_BufferStreamImp::LoadBuffer(uint8_t* pData, + int32_t iTotalSize, + uint32_t dwAccess) { ASSERT(!m_pData && pData && iTotalSize > 0); SetAccessModes(dwAccess); m_pData = pData; m_iTotalSize = iTotalSize; m_iPosition = 0; m_iLength = (dwAccess & FX_STREAMACCESS_Write) != 0 ? 0 : iTotalSize; - return TRUE; + return true; } int32_t CFX_BufferStreamImp::GetLength() const { ASSERT(m_pData); @@ -844,7 +829,7 @@ int32_t CFX_BufferStreamImp::GetPosition() { ASSERT(m_pData); return m_iPosition; } -FX_BOOL CFX_BufferStreamImp::IsEOF() const { +bool CFX_BufferStreamImp::IsEOF() const { ASSERT(m_pData); return m_iPosition >= m_iLength; } @@ -861,7 +846,7 @@ int32_t CFX_BufferStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { } int32_t CFX_BufferStreamImp::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, - FX_BOOL& bEOS) { + bool& bEOS) { ASSERT(m_pData); ASSERT(pStr && iMaxLength > 0); int32_t iLen = std::min((m_iLength - m_iPosition) / 2, iMaxLength); @@ -911,12 +896,12 @@ int32_t CFX_BufferStreamImp::WriteString(const FX_WCHAR* pStr, // static IFX_Stream* IFX_Stream::CreateTextStream(IFX_Stream* pBaseStream, - FX_BOOL bDeleteOnRelease) { + bool bDeleteOnRelease) { ASSERT(pBaseStream); return new CFX_TextStream(pBaseStream, bDeleteOnRelease); } -CFX_TextStream::CFX_TextStream(IFX_Stream* pStream, FX_BOOL bDelStream) +CFX_TextStream::CFX_TextStream(IFX_Stream* pStream, bool bDelStream) : m_wCodePage(FX_CODEPAGE_DefANSI), m_wBOMLength(0), m_dwBOM(0), @@ -1004,7 +989,7 @@ int32_t CFX_TextStream::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { int32_t CFX_TextStream::GetPosition() { return m_pStreamImp->GetPosition(); } -FX_BOOL CFX_TextStream::IsEOF() const { +bool CFX_TextStream::IsEOF() const { return m_pStreamImp->IsEOF(); } int32_t CFX_TextStream::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { @@ -1016,7 +1001,7 @@ int32_t CFX_TextStream::WriteData(const uint8_t* pBuffer, int32_t iBufferSize) { void CFX_TextStream::Flush() { m_pStreamImp->Flush(); } -FX_BOOL CFX_TextStream::SetLength(int32_t iLength) { +bool CFX_TextStream::SetLength(int32_t iLength) { return m_pStreamImp->SetLength(iLength); } uint16_t CFX_TextStream::GetCodePage() const { @@ -1031,7 +1016,7 @@ IFX_Stream* CFX_TextStream::CreateSharedStream(uint32_t dwAccess, return nullptr; } if (dwAccess & FX_STREAMACCESS_Text) { - return new CFX_TextStream(pSR, TRUE); + return new CFX_TextStream(pSR, true); } return pSR; } @@ -1052,7 +1037,7 @@ uint16_t CFX_TextStream::SetCodePage(uint16_t wCodePage) { } int32_t CFX_TextStream::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, - FX_BOOL& bEOS) { + bool& bEOS) { ASSERT(pStr && iMaxLength > 0); if (!m_pStreamImp) { return -1; @@ -1090,7 +1075,7 @@ int32_t CFX_TextStream::ReadString(FX_WCHAR* pStr, iLen = m_pStreamImp->ReadData(m_pBuf, iBytes); int32_t iSrc = iLen; int32_t iDecode = FX_DecodeString(m_wCodePage, (const FX_CHAR*)m_pBuf, - &iSrc, pStr, &iMaxLength, TRUE); + &iSrc, pStr, &iMaxLength, true); m_pStreamImp->Seek(FX_STREAMSEEK_Current, iSrc - iLen); if (iDecode < 1) { return -1; @@ -1134,103 +1119,102 @@ CFX_Stream::~CFX_Stream() { delete m_pStreamImp; } -FX_BOOL CFX_Stream::LoadFile(const FX_WCHAR* pszSrcFileName, - uint32_t dwAccess) { +bool CFX_Stream::LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp) - return FALSE; + return false; if (!pszSrcFileName || FXSYS_wcslen(pszSrcFileName) < 1) - return FALSE; + return false; std::unique_ptr<CFX_FileStreamImp> pImp(new CFX_FileStreamImp()); if (!pImp->LoadFile(pszSrcFileName, dwAccess)) - return FALSE; + return false; m_pStreamImp = pImp.release(); m_eStreamType = FX_STREAMTYPE_File; m_dwAccess = dwAccess; m_iLength = m_pStreamImp->GetLength(); - return TRUE; + return true; } -FX_BOOL CFX_Stream::LoadFileRead(IFX_SeekableReadStream* pFileRead, - uint32_t dwAccess) { +bool CFX_Stream::LoadFileRead(IFX_SeekableReadStream* pFileRead, + uint32_t dwAccess) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp) - return FALSE; + return false; if (!pFileRead) - return FALSE; + return false; std::unique_ptr<CFX_FileReadStreamImp> pImp(new CFX_FileReadStreamImp()); if (!pImp->LoadFileRead(pFileRead, dwAccess)) - return FALSE; + return false; m_pStreamImp = pImp.release(); m_eStreamType = FX_STREAMTYPE_File; m_dwAccess = dwAccess; m_iLength = m_pStreamImp->GetLength(); - return TRUE; + return true; } -FX_BOOL CFX_Stream::LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, - uint32_t dwAccess) { +bool CFX_Stream::LoadFileWrite(IFX_SeekableWriteStream* pFileWrite, + uint32_t dwAccess) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp) - return FALSE; + return false; if (!pFileWrite) - return FALSE; + return false; std::unique_ptr<CFX_FileWriteStreamImp> pImp(new CFX_FileWriteStreamImp()); if (!pImp->LoadFileWrite(pFileWrite, dwAccess)) - return FALSE; + return false; m_pStreamImp = pImp.release(); m_eStreamType = FX_STREAMTYPE_File; m_dwAccess = dwAccess; m_iLength = m_pStreamImp->GetLength(); - return TRUE; + return true; } -FX_BOOL CFX_Stream::LoadBuffer(uint8_t* pData, - int32_t iTotalSize, - uint32_t dwAccess) { +bool CFX_Stream::LoadBuffer(uint8_t* pData, + int32_t iTotalSize, + uint32_t dwAccess) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp) - return FALSE; + return false; if (!pData || iTotalSize < 1) - return FALSE; + return false; std::unique_ptr<CFX_BufferStreamImp> pImp(new CFX_BufferStreamImp()); if (!pImp->LoadBuffer(pData, iTotalSize, dwAccess)) - return FALSE; + return false; m_pStreamImp = pImp.release(); m_eStreamType = FX_STREAMTYPE_Buffer; m_dwAccess = dwAccess; m_iLength = m_pStreamImp->GetLength(); - return TRUE; + return true; } -FX_BOOL CFX_Stream::LoadBufferRead(IFX_BufferRead* pBufferRead, - int32_t iFileSize, - uint32_t dwAccess, - FX_BOOL bReleaseBufferRead) { +bool CFX_Stream::LoadBufferRead(IFX_BufferRead* pBufferRead, + int32_t iFileSize, + uint32_t dwAccess, + bool bReleaseBufferRead) { if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp) - return FALSE; + return false; if (!pBufferRead) - return FALSE; + return false; std::unique_ptr<CFX_BufferReadStreamImp> pImp(new CFX_BufferReadStreamImp); if (!pImp->LoadBufferRead(pBufferRead, iFileSize, dwAccess, bReleaseBufferRead)) - return FALSE; + return false; m_pStreamImp = pImp.release(); m_eStreamType = FX_STREAMTYPE_BufferRead; m_dwAccess = dwAccess; m_iLength = m_pStreamImp->GetLength(); - return TRUE; + return true; } void CFX_Stream::Release() { @@ -1292,9 +1276,9 @@ int32_t CFX_Stream::GetPosition() { } return m_iPosition - m_iStart; } -FX_BOOL CFX_Stream::IsEOF() const { +bool CFX_Stream::IsEOF() const { if (!m_pStreamImp) { - return TRUE; + return true; } if (m_eStreamType == FX_STREAMTYPE_File || m_eStreamType == FX_STREAMTYPE_Buffer) { @@ -1318,9 +1302,7 @@ int32_t CFX_Stream::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { m_iPosition = m_pStreamImp->GetPosition(); return iLen; } -int32_t CFX_Stream::ReadString(FX_WCHAR* pStr, - int32_t iMaxLength, - FX_BOOL& bEOS) { +int32_t CFX_Stream::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, bool& bEOS) { ASSERT(pStr && iMaxLength > 0); if (!m_pStreamImp) { return -1; @@ -1337,7 +1319,7 @@ int32_t CFX_Stream::ReadString(FX_WCHAR* pStr, iLen = m_pStreamImp->ReadString(pStr, iLen, bEOS); m_iPosition = m_pStreamImp->GetPosition(); if (iLen > 0 && m_iPosition >= iEnd) { - bEOS = TRUE; + bEOS = true; } return iLen; } @@ -1403,12 +1385,12 @@ void CFX_Stream::Flush() { } m_pStreamImp->Flush(); } -FX_BOOL CFX_Stream::SetLength(int32_t iLength) { +bool CFX_Stream::SetLength(int32_t iLength) { if (!m_pStreamImp) { - return FALSE; + return false; } if ((m_dwAccess & FX_STREAMACCESS_Write) == 0) { - return FALSE; + return false; } return m_pStreamImp->SetLength(iLength); } @@ -1465,7 +1447,7 @@ IFX_Stream* CFX_Stream::CreateSharedStream(uint32_t dwAccess, pShared->m_iStart = iStart; pShared->m_iLength = (dwAccess & FX_STREAMACCESS_Write) != 0 ? 0 : iLength; if (dwAccess & FX_STREAMACCESS_Text) { - return IFX_Stream::CreateTextStream(pShared, TRUE); + return IFX_Stream::CreateTextStream(pShared, true); } return pShared; } diff --git a/xfa/fgas/crt/fgas_stream.h b/xfa/fgas/crt/fgas_stream.h index 34d684f9ca..674007e935 100644 --- a/xfa/fgas/crt/fgas_stream.h +++ b/xfa/fgas/crt/fgas_stream.h @@ -36,7 +36,7 @@ class IFX_Stream { int32_t length, uint32_t dwAccess); static IFX_Stream* CreateTextStream(IFX_Stream* pBaseStream, - FX_BOOL bDeleteOnRelease); + bool bDeleteOnRelease); virtual ~IFX_Stream() {} virtual void Release() = 0; virtual IFX_Stream* Retain() = 0; @@ -49,15 +49,15 @@ class IFX_Stream { virtual int32_t GetLength() const = 0; virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0; virtual int32_t GetPosition() = 0; - virtual FX_BOOL IsEOF() const = 0; + virtual bool IsEOF() const = 0; virtual int32_t ReadData(uint8_t* pBuffer, int32_t iBufferSize) = 0; virtual int32_t ReadString(FX_WCHAR* pStr, int32_t iMaxLength, - FX_BOOL& bEOS) = 0; + bool& bEOS) = 0; virtual int32_t WriteData(const uint8_t* pBuffer, int32_t iBufferSize) = 0; virtual int32_t WriteString(const FX_WCHAR* pStr, int32_t iLength) = 0; virtual void Flush() = 0; - virtual FX_BOOL SetLength(int32_t iLength) = 0; + virtual bool SetLength(int32_t iLength) = 0; virtual int32_t GetBOM(uint8_t bom[4]) const = 0; virtual uint16_t GetCodePage() const = 0; virtual uint16_t SetCodePage(uint16_t wCodePage) = 0; diff --git a/xfa/fgas/crt/fgas_utils.cpp b/xfa/fgas/crt/fgas_utils.cpp index 150a65af19..0cdbf77d31 100644 --- a/xfa/fgas/crt/fgas_utils.cpp +++ b/xfa/fgas/crt/fgas_utils.cpp @@ -38,7 +38,7 @@ CFX_BaseArray::CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize) { m_pData = new FX_BASEARRAYDATA(iGrowSize, iBlockSize); } CFX_BaseArray::~CFX_BaseArray() { - RemoveAll(FALSE); + RemoveAll(false); delete m_pData; } int32_t CFX_BaseArray::GetSize() const { @@ -114,7 +114,7 @@ int32_t CFX_BaseArray::Copy(const CFX_BaseArray& src, if (iCount < 1) { return 0; } - RemoveAll(TRUE); + RemoveAll(true); AddSpaceTo(iCount - 1); FXSYS_memcpy(m_pData->pBuffer, src.m_pData->pBuffer + iStart * iBlockSize, iCount * iBlockSize); @@ -130,7 +130,7 @@ int32_t CFX_BaseArray::RemoveLast(int32_t iCount) { } return iCount; } -void CFX_BaseArray::RemoveAll(FX_BOOL bLeaveMemory) { +void CFX_BaseArray::RemoveAll(bool bLeaveMemory) { if (!bLeaveMemory) { uint8_t*& pBuffer = m_pData->pBuffer; if (pBuffer) { @@ -153,7 +153,7 @@ CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(int32_t iChunkSize, m_pData->SetSize(16); } CFX_BaseMassArrayImp::~CFX_BaseMassArrayImp() { - RemoveAll(FALSE); + RemoveAll(false); delete m_pData; } uint8_t* CFX_BaseMassArrayImp::AddSpaceTo(int32_t index) { @@ -163,7 +163,7 @@ uint8_t* CFX_BaseMassArrayImp::AddSpaceTo(int32_t index) { pChunk = (uint8_t*)m_pData->GetAt(index / m_iChunkSize); } else { int32_t iMemSize = m_iChunkSize * m_iBlockSize; - while (TRUE) { + while (true) { if (index < m_iChunkCount * m_iChunkSize) { pChunk = (uint8_t*)m_pData->GetAt(index / m_iChunkSize); break; @@ -218,7 +218,7 @@ int32_t CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp& src, if (iStart >= iCopied) { return 0; } - RemoveAll(TRUE); + RemoveAll(true); if (iCount < 0) { iCount = iCopied; } @@ -289,7 +289,7 @@ int32_t CFX_BaseMassArrayImp::RemoveLast(int32_t iCount) { } return m_iBlockCount; } -void CFX_BaseMassArrayImp::RemoveAll(FX_BOOL bLeaveMemory) { +void CFX_BaseMassArrayImp::RemoveAll(bool bLeaveMemory) { if (bLeaveMemory) { m_iBlockCount = 0; return; @@ -329,7 +329,7 @@ int32_t CFX_BaseMassArray::Copy(const CFX_BaseMassArray& src, int32_t CFX_BaseMassArray::RemoveLast(int32_t iCount) { return m_pData->RemoveLast(iCount); } -void CFX_BaseMassArray::RemoveAll(FX_BOOL bLeaveMemory) { +void CFX_BaseMassArray::RemoveAll(bool bLeaveMemory) { m_pData->RemoveAll(bLeaveMemory); } @@ -427,6 +427,6 @@ int32_t CFX_BaseStack::GetSize() const { uint8_t* CFX_BaseStack::GetAt(int32_t index) const { return m_pData->GetAt(index); } -void CFX_BaseStack::RemoveAll(FX_BOOL bLeaveMemory) { +void CFX_BaseStack::RemoveAll(bool bLeaveMemory) { m_pData->RemoveAll(bLeaveMemory); } diff --git a/xfa/fgas/crt/fgas_utils.h b/xfa/fgas/crt/fgas_utils.h index c45f42405f..5565733c26 100644 --- a/xfa/fgas/crt/fgas_utils.h +++ b/xfa/fgas/crt/fgas_utils.h @@ -25,7 +25,7 @@ class CFX_BaseArray : public CFX_Target { int32_t Append(const CFX_BaseArray& src, int32_t iStart, int32_t iCount); int32_t Copy(const CFX_BaseArray& src, int32_t iStart, int32_t iCount); int32_t RemoveLast(int32_t iCount); - void RemoveAll(FX_BOOL bLeaveMemory); + void RemoveAll(bool bLeaveMemory); FX_BASEARRAYDATA* m_pData; }; @@ -74,9 +74,7 @@ class CFX_BaseArrayTemplate : public CFX_BaseArray { int32_t RemoveLast(int32_t iCount) { return CFX_BaseArray::RemoveLast(iCount); } - void RemoveAll(FX_BOOL bLeaveMemory) { - CFX_BaseArray::RemoveAll(bLeaveMemory); - } + void RemoveAll(bool bLeaveMemory) { CFX_BaseArray::RemoveAll(bLeaveMemory); } }; class CFX_BaseMassArrayImp : public CFX_Target { @@ -92,7 +90,7 @@ class CFX_BaseMassArrayImp : public CFX_Target { int32_t iCount); int32_t Copy(const CFX_BaseMassArrayImp& src, int32_t iStart, int32_t iCount); int32_t RemoveLast(int32_t iCount); - void RemoveAll(FX_BOOL bLeaveMemory); + void RemoveAll(bool bLeaveMemory); int32_t m_iChunkSize; int32_t m_iBlockSize; @@ -118,7 +116,7 @@ class CFX_BaseMassArray : public CFX_Target { int32_t Append(const CFX_BaseMassArray& src, int32_t iStart, int32_t iCount); int32_t Copy(const CFX_BaseMassArray& src, int32_t iStart, int32_t iCount); int32_t RemoveLast(int32_t iCount); - void RemoveAll(FX_BOOL bLeaveMemory); + void RemoveAll(bool bLeaveMemory); CFX_BaseMassArrayImp* m_pData; }; @@ -165,7 +163,7 @@ class CFX_MassArrayTemplate : public CFX_BaseMassArray { int32_t RemoveLast(int32_t iCount) { return CFX_BaseMassArray::RemoveLast(iCount); } - void RemoveAll(FX_BOOL bLeaveMemory) { + void RemoveAll(bool bLeaveMemory) { CFX_BaseMassArray::RemoveAll(bLeaveMemory); } }; @@ -175,7 +173,7 @@ class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray { public: CFX_ObjectMassArrayTemplate(int32_t iChunkSize) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {} - ~CFX_ObjectMassArrayTemplate() { RemoveAll(FALSE); } + ~CFX_ObjectMassArrayTemplate() { RemoveAll(false); } int32_t GetSize() const { return CFX_BaseMassArray::GetSize(); } int32_t Add(const baseType& element) { @@ -225,7 +223,7 @@ class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray { if (iEnd > iSize) { iEnd = iSize; } - RemoveAll(TRUE); + RemoveAll(true); for (int32_t i = iStart; i < iEnd; i++) { Add(src.GetAt(i)); } @@ -244,7 +242,7 @@ class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray { } return CFX_BaseMassArray::RemoveLast(iCount); } - void RemoveAll(FX_BOOL bLeaveMemory) { + void RemoveAll(bool bLeaveMemory) { int32_t iSize = CFX_BaseMassArray::GetSize(); for (int32_t i = 0; i < iSize; i++) { ((baseType*)GetPtrAt(i))->~baseType(); @@ -293,7 +291,7 @@ class CFX_BaseStack : public CFX_Target { uint8_t* GetTopElement() const; int32_t GetSize() const; uint8_t* GetAt(int32_t index) const; - void RemoveAll(FX_BOOL bLeaveMemory); + void RemoveAll(bool bLeaveMemory); CFX_BaseMassArrayImp* m_pData; }; @@ -316,9 +314,7 @@ class CFX_StackTemplate : public CFX_BaseStack { baseType* GetAt(int32_t index) const { return (baseType*)CFX_BaseStack::GetAt(index); } - void RemoveAll(FX_BOOL bLeaveMemory) { - CFX_BaseStack::RemoveAll(bLeaveMemory); - } + void RemoveAll(bool bLeaveMemory) { CFX_BaseStack::RemoveAll(bLeaveMemory); } }; template <class baseType> @@ -326,7 +322,7 @@ class CFX_ObjectStackTemplate : public CFX_BaseStack { public: CFX_ObjectStackTemplate(int32_t iChunkSize) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {} - ~CFX_ObjectStackTemplate() { RemoveAll(FALSE); } + ~CFX_ObjectStackTemplate() { RemoveAll(false); } int32_t Push(const baseType& element) { int32_t index = CFX_BaseStack::GetSize(); @@ -348,7 +344,7 @@ class CFX_ObjectStackTemplate : public CFX_BaseStack { baseType* GetAt(int32_t index) const { return (baseType*)CFX_BaseStack::GetAt(index); } - void RemoveAll(FX_BOOL bLeaveMemory) { + void RemoveAll(bool bLeaveMemory) { int32_t iSize = CFX_BaseStack::GetSize(); for (int32_t i = 0; i < iSize; i++) { ((baseType*)CFX_BaseStack::GetAt(i))->~baseType(); @@ -370,7 +366,7 @@ class CFX_ObjectStackTemplate : public CFX_BaseStack { if (iEnd > iSize) { iEnd = iSize; } - RemoveAll(TRUE); + RemoveAll(true); for (int32_t i = iStart; i < iEnd; i++) { Push(*src.GetAt(i)); } |