| Index: xfa/fgas/crt/fgas_utils.cpp
|
| diff --git a/xfa/fgas/crt/fgas_utils.cpp b/xfa/fgas/crt/fgas_utils.cpp
|
| index 4f15fc48452f15cd9f4bc9ec15eddfcde0a3c703..8519e5b46174eb2e6b4ee025474606085e5c04bf 100644
|
| --- a/xfa/fgas/crt/fgas_utils.cpp
|
| +++ b/xfa/fgas/crt/fgas_utils.cpp
|
| @@ -127,9 +127,9 @@ int32_t CFX_BaseArray::RemoveLast(int32_t iCount) {
|
| void CFX_BaseArray::RemoveAll(FX_BOOL bLeaveMemory) {
|
| if (!bLeaveMemory) {
|
| uint8_t*& pBuffer = m_pData->pBuffer;
|
| - if (pBuffer != NULL) {
|
| + if (pBuffer) {
|
| FX_Free(pBuffer);
|
| - pBuffer = NULL;
|
| + pBuffer = nullptr;
|
| }
|
| m_pData->iTotalCount = 0;
|
| }
|
| @@ -172,14 +172,14 @@ uint8_t* CFX_BaseMassArrayImp::AddSpaceTo(int32_t index) {
|
| }
|
| }
|
| }
|
| - ASSERT(pChunk != NULL);
|
| + ASSERT(pChunk);
|
| m_iBlockCount = index + 1;
|
| return pChunk + (index % m_iChunkSize) * m_iBlockSize;
|
| }
|
| uint8_t* CFX_BaseMassArrayImp::GetAt(int32_t index) const {
|
| ASSERT(index > -1 && index < m_iBlockCount);
|
| uint8_t* pChunk = (uint8_t*)m_pData->GetAt(index / m_iChunkSize);
|
| - ASSERT(pChunk != NULL);
|
| + ASSERT(pChunk);
|
| return pChunk + (index % m_iChunkSize) * m_iBlockSize;
|
| }
|
| int32_t CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp& src,
|
| @@ -252,7 +252,7 @@ void CFX_BaseMassArrayImp::Append(int32_t iDstStart,
|
| std::min(iSrcCount, std::min(iSrcChunkSize, iDstChunkSize));
|
| int32_t iCopyBytes = iCopySize * m_iBlockSize;
|
| while (iSrcCount > 0) {
|
| - ASSERT(pDstChunk != NULL && pSrcChunk != NULL);
|
| + ASSERT(pDstChunk && pSrcChunk);
|
| FXSYS_memcpy(pDstChunk, pSrcChunk, iCopyBytes);
|
| iSrcCount -= iCopySize;
|
| iSrcChunkSize -= iCopySize;
|
| @@ -288,13 +288,8 @@ void CFX_BaseMassArrayImp::RemoveAll(FX_BOOL bLeaveMemory) {
|
| m_iBlockCount = 0;
|
| return;
|
| }
|
| - for (int32_t i = 0; i < m_iChunkCount; i++) {
|
| - void* p = m_pData->GetAt(i);
|
| - if (p == NULL) {
|
| - continue;
|
| - }
|
| - FX_Free(p);
|
| - }
|
| + for (int32_t i = 0; i < m_iChunkCount; i++)
|
| + FX_Free(m_pData->GetAt(i));
|
| m_pData->RemoveAll();
|
| m_iChunkCount = 0;
|
| m_iBlockCount = 0;
|
| @@ -357,7 +352,7 @@ uint8_t* CFX_BaseDiscreteArray::AddSpaceTo(int32_t index) {
|
| FX_BASEDISCRETEARRAYDATA* pData = (FX_BASEDISCRETEARRAYDATA*)m_pData;
|
| int32_t& iChunkCount = pData->iChunkCount;
|
| int32_t iChunkSize = pData->iChunkSize;
|
| - uint8_t* pChunk = NULL;
|
| + uint8_t* pChunk = nullptr;
|
| int32_t iChunk = index / iChunkSize;
|
| if (iChunk < iChunkCount) {
|
| pChunk = pData->ChunkBuffer.GetAt(iChunk);
|
| @@ -415,7 +410,7 @@ void CFX_BaseStack::Pop() {
|
| uint8_t* CFX_BaseStack::GetTopElement() const {
|
| int32_t iSize = m_pData->m_iBlockCount;
|
| if (iSize < 1) {
|
| - return NULL;
|
| + return nullptr;
|
| }
|
| return m_pData->GetAt(iSize - 1);
|
| }
|
|
|