summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt')
-rw-r--r--core/fxcrt/fx_arabic.cpp2
-rw-r--r--core/fxcrt/fx_basic_array.cpp12
-rw-r--r--core/fxcrt/fx_basic_bstring_unittest.cpp14
-rw-r--r--core/fxcrt/fx_basic_gcc.cpp8
-rw-r--r--core/fxcrt/fx_basic_list.cpp16
-rw-r--r--core/fxcrt/fx_basic_maps.cpp13
-rw-r--r--core/fxcrt/fx_extension.cpp17
-rw-r--r--core/fxcrt/fxcrt_windows.cpp31
-rw-r--r--core/fxcrt/include/fx_basic.h23
-rw-r--r--core/fxcrt/include/fx_ext.h4
-rw-r--r--core/fxcrt/include/fx_system.h4
-rw-r--r--core/fxcrt/include/fx_ucd.h4
-rw-r--r--core/fxcrt/include/fx_xml.h6
-rw-r--r--core/fxcrt/xml_int.h2
14 files changed, 74 insertions, 82 deletions
diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp
index 434c203120..2c0a1bbad7 100644
--- a/core/fxcrt/fx_arabic.cpp
+++ b/core/fxcrt/fx_arabic.cpp
@@ -251,7 +251,7 @@ const FX_ARBFORMTABLE* ParseChar(const CFX_Char* pTC,
const FX_ARBFORMTABLE* FX_GetArabicFormTable(FX_WCHAR unicode) {
if (unicode < 0x622 || unicode > 0x6d5) {
- return NULL;
+ return nullptr;
}
return g_FX_ArabicFormTables + unicode - 0x622;
}
diff --git a/core/fxcrt/fx_basic_array.cpp b/core/fxcrt/fx_basic_array.cpp
index eb6570d950..0a2dc43fc5 100644
--- a/core/fxcrt/fx_basic_array.cpp
+++ b/core/fxcrt/fx_basic_array.cpp
@@ -8,7 +8,7 @@
#include "third_party/base/numerics/safe_math.h"
CFX_BasicArray::CFX_BasicArray(int unit_size)
- : m_pData(NULL), m_nSize(0), m_nMaxSize(0) {
+ : m_pData(nullptr), m_nSize(0), m_nMaxSize(0) {
if (unit_size < 0 || unit_size > (1 << 28)) {
m_nUnitSize = 4;
} else {
@@ -21,7 +21,7 @@ CFX_BasicArray::~CFX_BasicArray() {
FX_BOOL CFX_BasicArray::SetSize(int nNewSize) {
if (nNewSize <= 0) {
FX_Free(m_pData);
- m_pData = NULL;
+ m_pData = nullptr;
m_nSize = m_nMaxSize = 0;
return 0 == nNewSize;
}
@@ -82,16 +82,16 @@ FX_BOOL CFX_BasicArray::Copy(const CFX_BasicArray& src) {
}
uint8_t* CFX_BasicArray::InsertSpaceAt(int nIndex, int nCount) {
if (nIndex < 0 || nCount <= 0) {
- return NULL;
+ return nullptr;
}
if (nIndex >= m_nSize) {
if (!SetSize(nIndex + nCount)) {
- return NULL;
+ return nullptr;
}
} else {
int nOldSize = m_nSize;
if (!SetSize(m_nSize + nCount)) {
- return NULL;
+ return nullptr;
}
FXSYS_memmove(m_pData + (nIndex + nCount) * m_nUnitSize,
m_pData + nIndex * m_nUnitSize,
@@ -130,7 +130,7 @@ FX_BOOL CFX_BasicArray::InsertAt(int nStartIndex,
}
const void* CFX_BasicArray::GetDataPtr(int index) const {
if (index < 0 || index >= m_nSize || !m_pData) {
- return NULL;
+ return nullptr;
}
return m_pData + index * m_nUnitSize;
}
diff --git a/core/fxcrt/fx_basic_bstring_unittest.cpp b/core/fxcrt/fx_basic_bstring_unittest.cpp
index fe98b53b45..220105aa95 100644
--- a/core/fxcrt/fx_basic_bstring_unittest.cpp
+++ b/core/fxcrt/fx_basic_bstring_unittest.cpp
@@ -251,7 +251,7 @@ TEST(fxcrt, ByteStringOperatorNE) {
TEST(fxcrt, ByteStringCNull) {
CFX_ByteStringC null_string;
- EXPECT_EQ(null_string.raw_str(), nullptr);
+ EXPECT_FALSE(null_string.raw_str());
EXPECT_EQ(null_string.GetLength(), 0);
EXPECT_TRUE(null_string.IsEmpty());
@@ -259,27 +259,27 @@ TEST(fxcrt, ByteStringCNull) {
EXPECT_EQ(null_string, another_null_string);
CFX_ByteStringC copied_null_string(null_string);
- EXPECT_EQ(copied_null_string.raw_str(), nullptr);
+ EXPECT_FALSE(copied_null_string.raw_str());
EXPECT_EQ(copied_null_string.GetLength(), 0);
EXPECT_TRUE(copied_null_string.IsEmpty());
EXPECT_EQ(null_string, copied_null_string);
CFX_ByteStringC empty_string(""); // Pointer to NUL, not NULL pointer.
- EXPECT_NE(empty_string.raw_str(), nullptr);
+ EXPECT_TRUE(empty_string.raw_str());
EXPECT_EQ(empty_string.GetLength(), 0);
EXPECT_TRUE(empty_string.IsEmpty());
EXPECT_EQ(null_string, empty_string);
- CFX_ByteStringC assigned_null_string("initially not NULL");
+ CFX_ByteStringC assigned_null_string("initially not nullptr");
assigned_null_string = null_string;
- EXPECT_EQ(assigned_null_string.raw_str(), nullptr);
+ EXPECT_FALSE(assigned_null_string.raw_str());
EXPECT_EQ(assigned_null_string.GetLength(), 0);
EXPECT_TRUE(assigned_null_string.IsEmpty());
EXPECT_EQ(null_string, assigned_null_string);
- CFX_ByteStringC assigned_nullptr_string("initially not NULL");
+ CFX_ByteStringC assigned_nullptr_string("initially not nullptr");
assigned_nullptr_string = (const FX_CHAR*)nullptr;
- EXPECT_EQ(assigned_nullptr_string.raw_str(), nullptr);
+ EXPECT_FALSE(assigned_nullptr_string.raw_str());
EXPECT_EQ(assigned_nullptr_string.GetLength(), 0);
EXPECT_TRUE(assigned_nullptr_string.IsEmpty());
EXPECT_EQ(null_string, assigned_nullptr_string);
diff --git a/core/fxcrt/fx_basic_gcc.cpp b/core/fxcrt/fx_basic_gcc.cpp
index a55a486293..3547e5fbf0 100644
--- a/core/fxcrt/fx_basic_gcc.cpp
+++ b/core/fxcrt/fx_basic_gcc.cpp
@@ -138,7 +138,7 @@ FXSYS_FILE* FXSYS_wfopen(const FX_WCHAR* filename, const FX_WCHAR* mode) {
}
char* FXSYS_strlwr(char* str) {
if (!str) {
- return NULL;
+ return nullptr;
}
char* s = str;
while (*str) {
@@ -149,7 +149,7 @@ char* FXSYS_strlwr(char* str) {
}
char* FXSYS_strupr(char* str) {
if (!str) {
- return NULL;
+ return nullptr;
}
char* s = str;
while (*str) {
@@ -160,7 +160,7 @@ char* FXSYS_strupr(char* str) {
}
FX_WCHAR* FXSYS_wcslwr(FX_WCHAR* str) {
if (!str) {
- return NULL;
+ return nullptr;
}
FX_WCHAR* s = str;
while (*str) {
@@ -171,7 +171,7 @@ FX_WCHAR* FXSYS_wcslwr(FX_WCHAR* str) {
}
FX_WCHAR* FXSYS_wcsupr(FX_WCHAR* str) {
if (!str) {
- return NULL;
+ return nullptr;
}
FX_WCHAR* s = str;
while (*str) {
diff --git a/core/fxcrt/fx_basic_list.cpp b/core/fxcrt/fx_basic_list.cpp
index f128176d00..53e0621a6e 100644
--- a/core/fxcrt/fx_basic_list.cpp
+++ b/core/fxcrt/fx_basic_list.cpp
@@ -8,14 +8,14 @@
#include "core/fxcrt/plex.h"
CFX_PtrList::CFX_PtrList(int nBlockSize)
- : m_pNodeHead(NULL),
- m_pNodeTail(NULL),
+ : m_pNodeHead(nullptr),
+ m_pNodeTail(nullptr),
m_nCount(0),
- m_pNodeFree(NULL),
- m_pBlocks(NULL),
+ m_pNodeFree(nullptr),
+ m_pBlocks(nullptr),
m_nBlockSize(nBlockSize) {}
FX_POSITION CFX_PtrList::AddTail(void* newElement) {
- CNode* pNewNode = NewNode(m_pNodeTail, NULL);
+ CNode* pNewNode = NewNode(m_pNodeTail, nullptr);
pNewNode->data = newElement;
if (m_pNodeTail) {
m_pNodeTail->pNext = pNewNode;
@@ -26,7 +26,7 @@ FX_POSITION CFX_PtrList::AddTail(void* newElement) {
return (FX_POSITION)pNewNode;
}
FX_POSITION CFX_PtrList::AddHead(void* newElement) {
- CNode* pNewNode = NewNode(NULL, m_pNodeHead);
+ CNode* pNewNode = NewNode(nullptr, m_pNodeHead);
pNewNode->data = newElement;
if (m_pNodeHead) {
m_pNodeHead->pPrev = pNewNode;
@@ -112,7 +112,7 @@ CFX_PtrList::~CFX_PtrList() {
}
FX_POSITION CFX_PtrList::FindIndex(int nIndex) const {
if (nIndex >= m_nCount || nIndex < 0) {
- return NULL;
+ return nullptr;
}
CNode* pNode = m_pNodeHead;
while (nIndex--) {
@@ -127,5 +127,5 @@ FX_POSITION CFX_PtrList::Find(void* searchValue, FX_POSITION startAfter) const {
if (pNode->data == searchValue)
return (FX_POSITION)pNode;
}
- return NULL;
+ return nullptr;
}
diff --git a/core/fxcrt/fx_basic_maps.cpp b/core/fxcrt/fx_basic_maps.cpp
index dda8167bdb..2424b82714 100644
--- a/core/fxcrt/fx_basic_maps.cpp
+++ b/core/fxcrt/fx_basic_maps.cpp
@@ -76,11 +76,10 @@ void* CFX_MapPtrToPtr::GetValueAt(void* key) const {
void*& CFX_MapPtrToPtr::operator[](void* key) {
uint32_t nHash;
- CAssoc* pAssoc;
- if ((pAssoc = GetAssocAt(key, nHash)) == NULL) {
- if (!m_pHashTable) {
+ CAssoc* pAssoc = GetAssocAt(key, nHash);
+ if (!pAssoc) {
+ if (!m_pHashTable)
InitHashTable(m_nHashTableSize);
- }
pAssoc = NewAssoc();
pAssoc->key = key;
pAssoc->pNext = m_pHashTable[nHash];
@@ -92,14 +91,14 @@ CFX_MapPtrToPtr::CAssoc* CFX_MapPtrToPtr::GetAssocAt(void* key,
uint32_t& nHash) const {
nHash = HashKey(key) % m_nHashTableSize;
if (!m_pHashTable) {
- return NULL;
+ return nullptr;
}
CAssoc* pAssoc;
for (pAssoc = m_pHashTable[nHash]; pAssoc; pAssoc = pAssoc->pNext) {
if (pAssoc->key == key)
return pAssoc;
}
- return NULL;
+ return nullptr;
}
CFX_MapPtrToPtr::CAssoc* CFX_MapPtrToPtr::NewAssoc() {
if (!m_pFreeList) {
@@ -125,7 +124,7 @@ void CFX_MapPtrToPtr::InitHashTable(uint32_t nHashSize, FX_BOOL bAllocNow) {
ASSERT(m_nCount == 0);
ASSERT(nHashSize > 0);
FX_Free(m_pHashTable);
- m_pHashTable = NULL;
+ m_pHashTable = nullptr;
if (bAllocNow) {
m_pHashTable = FX_Alloc(CAssoc*, nHashSize);
}
diff --git a/core/fxcrt/fx_extension.cpp b/core/fxcrt/fx_extension.cpp
index 197022362f..1a95e8c318 100644
--- a/core/fxcrt/fx_extension.cpp
+++ b/core/fxcrt/fx_extension.cpp
@@ -68,13 +68,9 @@ FX_BOOL CFX_CRTFileStream::Flush() {
#ifdef PDF_ENABLE_XFA
IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath) {
if (wsPath.GetLength() == 0)
- return NULL;
-
- CFX_CRTFileAccess* pFA = NULL;
- pFA = new CFX_CRTFileAccess;
- if (NULL == pFA)
- return NULL;
+ return nullptr;
+ CFX_CRTFileAccess* pFA = new CFX_CRTFileAccess;
pFA->Init(wsPath);
return pFA;
}
@@ -305,9 +301,9 @@ void FX_Random_GenerateBase(uint32_t* pBuffer, int32_t iCount) {
FX_HashCode_GetA(CFX_ByteStringC((uint8_t*)&st2, sizeof(st2)), true);
::srand((dwHash1 << 16) | (uint32_t)dwHash2);
#else
- time_t tmLast = time(NULL);
+ time_t tmLast = time(nullptr);
time_t tmCur;
- while ((tmCur = time(NULL)) == tmLast) {
+ while ((tmCur = time(nullptr)) == tmLast) {
continue;
}
@@ -319,8 +315,9 @@ void FX_Random_GenerateBase(uint32_t* pBuffer, int32_t iCount) {
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
FX_BOOL FX_GenerateCryptoRandom(uint32_t* pBuffer, int32_t iCount) {
- HCRYPTPROV hCP = NULL;
- if (!::CryptAcquireContext(&hCP, NULL, NULL, PROV_RSA_FULL, 0) || !hCP) {
+ HCRYPTPROV hCP = 0;
+ if (!::CryptAcquireContext(&hCP, nullptr, nullptr, PROV_RSA_FULL, 0) ||
+ !hCP) {
return FALSE;
}
::CryptGenRandom(hCP, iCount * sizeof(uint32_t), (uint8_t*)pBuffer);
diff --git a/core/fxcrt/fxcrt_windows.cpp b/core/fxcrt/fxcrt_windows.cpp
index d4b4e50c2c..271cc8fda8 100644
--- a/core/fxcrt/fxcrt_windows.cpp
+++ b/core/fxcrt/fxcrt_windows.cpp
@@ -39,7 +39,7 @@ WINBASEAPI BOOL WINAPI SetFilePointerEx(HANDLE hFile,
#ifdef __cplusplus
}
#endif
-CFXCRT_FileAccess_Win64::CFXCRT_FileAccess_Win64() : m_hFile(NULL) {}
+CFXCRT_FileAccess_Win64::CFXCRT_FileAccess_Win64() : m_hFile(nullptr) {}
CFXCRT_FileAccess_Win64::~CFXCRT_FileAccess_Win64() {
Close();
}
@@ -50,12 +50,11 @@ FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_ByteStringC& fileName,
}
uint32_t dwAccess, dwShare, dwCreation;
FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
- m_hFile = ::CreateFileA(fileName.c_str(), dwAccess, dwShare, NULL, dwCreation,
- FILE_ATTRIBUTE_NORMAL, NULL);
- if (m_hFile == INVALID_HANDLE_VALUE) {
- m_hFile = NULL;
- }
- return m_hFile != NULL;
+ m_hFile = ::CreateFileA(fileName.c_str(), dwAccess, dwShare, nullptr,
+ dwCreation, FILE_ATTRIBUTE_NORMAL, nullptr);
+ if (m_hFile == INVALID_HANDLE_VALUE)
+ m_hFile = nullptr;
+ return !!m_hFile;
}
FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_WideStringC& fileName,
uint32_t dwMode) {
@@ -64,19 +63,18 @@ FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_WideStringC& fileName,
}
uint32_t dwAccess, dwShare, dwCreation;
FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
- m_hFile = ::CreateFileW((LPCWSTR)fileName.c_str(), dwAccess, dwShare, NULL,
- dwCreation, FILE_ATTRIBUTE_NORMAL, NULL);
- if (m_hFile == INVALID_HANDLE_VALUE) {
- m_hFile = NULL;
- }
- return m_hFile != NULL;
+ m_hFile = ::CreateFileW((LPCWSTR)fileName.c_str(), dwAccess, dwShare, nullptr,
+ dwCreation, FILE_ATTRIBUTE_NORMAL, nullptr);
+ if (m_hFile == INVALID_HANDLE_VALUE)
+ m_hFile = nullptr;
+ return !!m_hFile;
}
void CFXCRT_FileAccess_Win64::Close() {
if (!m_hFile) {
return;
}
::CloseHandle(m_hFile);
- m_hFile = NULL;
+ m_hFile = nullptr;
}
FX_FILESIZE CFXCRT_FileAccess_Win64::GetSize() const {
if (!m_hFile) {
@@ -116,7 +114,8 @@ size_t CFXCRT_FileAccess_Win64::Read(void* pBuffer, size_t szBuffer) {
return 0;
}
size_t szRead = 0;
- if (!::ReadFile(m_hFile, pBuffer, (DWORD)szBuffer, (LPDWORD)&szRead, NULL)) {
+ if (!::ReadFile(m_hFile, pBuffer, (DWORD)szBuffer, (LPDWORD)&szRead,
+ nullptr)) {
return 0;
}
return szRead;
@@ -127,7 +126,7 @@ size_t CFXCRT_FileAccess_Win64::Write(const void* pBuffer, size_t szBuffer) {
}
size_t szWrite = 0;
if (!::WriteFile(m_hFile, pBuffer, (DWORD)szBuffer, (LPDWORD)&szWrite,
- NULL)) {
+ nullptr)) {
return 0;
}
return szWrite;
diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h
index 13b51bd3fa..8e39f5577a 100644
--- a/core/fxcrt/include/fx_basic.h
+++ b/core/fxcrt/include/fx_basic.h
@@ -476,7 +476,7 @@ class CFX_MapPtrToPtr {
void RemoveAll();
FX_POSITION GetStartPosition() const {
- return (m_nCount == 0) ? NULL : (FX_POSITION)-1;
+ return m_nCount == 0 ? nullptr : (FX_POSITION)-1;
}
void GetNextAssoc(FX_POSITION& rNextPosition,
@@ -515,7 +515,7 @@ class CFX_MapPtrTemplate : public CFX_MapPtrToPtr {
CFX_MapPtrTemplate() : CFX_MapPtrToPtr(10) {}
FX_BOOL Lookup(KeyType key, ValueType& rValue) const {
- void* pValue = NULL;
+ void* pValue = nullptr;
if (!CFX_MapPtrToPtr::Lookup((void*)(uintptr_t)key, pValue)) {
return FALSE;
}
@@ -538,8 +538,8 @@ class CFX_MapPtrTemplate : public CFX_MapPtrToPtr {
void GetNextAssoc(FX_POSITION& rNextPosition,
KeyType& rKey,
ValueType& rValue) const {
- void* pKey = NULL;
- void* pValue = NULL;
+ void* pKey = nullptr;
+ void* pValue = nullptr;
CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue);
rKey = (KeyType)(uintptr_t)pKey;
rValue = (ValueType)(uintptr_t)pValue;
@@ -596,7 +596,7 @@ class CFX_PtrList {
}
FX_POSITION InsertAfter(FX_POSITION pos, void* newElement);
- FX_POSITION Find(void* searchValue, FX_POSITION startAfter = NULL) const;
+ FX_POSITION Find(void* searchValue, FX_POSITION startAfter = nullptr) const;
FX_POSITION FindIndex(int index) const;
void RemoveAt(FX_POSITION pos);
@@ -662,7 +662,7 @@ class CFX_CountRef {
int m_RefCount;
};
- CFX_CountRef() { m_pObject = NULL; }
+ CFX_CountRef() { m_pObject = nullptr; }
CFX_CountRef(const Ref& ref) {
m_pObject = ref.m_pObject;
@@ -716,7 +716,7 @@ class CFX_CountRef {
if (m_pObject->m_RefCount <= 0) {
delete m_pObject;
}
- m_pObject = NULL;
+ m_pObject = nullptr;
}
bool operator==(const Ref& ref) const { return m_pObject == ref.m_pObject; }
@@ -785,15 +785,15 @@ class CFX_SortListArray {
uint8_t* GetAt(int32_t nIndex) {
if (nIndex < 0) {
- return NULL;
+ return nullptr;
}
if (m_CurList < 0 || m_CurList >= m_DataLists.GetSize()) {
- return NULL;
+ return nullptr;
}
DataList* pCurList = m_DataLists.GetDataPtr(m_CurList);
if (!pCurList || nIndex < pCurList->start ||
nIndex >= pCurList->start + pCurList->count) {
- pCurList = NULL;
+ pCurList = nullptr;
int32_t iStart = 0;
int32_t iEnd = m_DataLists.GetUpperBound();
int32_t iMid = 0;
@@ -811,7 +811,8 @@ class CFX_SortListArray {
}
}
}
- return pCurList ? pCurList->data + (nIndex - pCurList->start) * unit : NULL;
+ return pCurList ? pCurList->data + (nIndex - pCurList->start) * unit
+ : nullptr;
}
protected:
diff --git a/core/fxcrt/include/fx_ext.h b/core/fxcrt/include/fx_ext.h
index b6c05ae9bc..d37db67d4a 100644
--- a/core/fxcrt/include/fx_ext.h
+++ b/core/fxcrt/include/fx_ext.h
@@ -24,10 +24,10 @@ FX_FLOAT FXSYS_tan(FX_FLOAT a);
FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x);
FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr,
int32_t iLength = -1,
- int32_t* pUsedLen = NULL);
+ int32_t* pUsedLen = nullptr);
FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr,
int32_t iLength = -1,
- int32_t* pUsedLen = NULL);
+ int32_t* pUsedLen = nullptr);
FX_WCHAR* FXSYS_wcsncpy(FX_WCHAR* dstStr, const FX_WCHAR* srcStr, size_t count);
int32_t FXSYS_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count);
int32_t FXSYS_strnicmp(const FX_CHAR* s1, const FX_CHAR* s2, size_t count);
diff --git a/core/fxcrt/include/fx_system.h b/core/fxcrt/include/fx_system.h
index 61acd73492..ca5d49aad6 100644
--- a/core/fxcrt/include/fx_system.h
+++ b/core/fxcrt/include/fx_system.h
@@ -91,10 +91,6 @@ static_assert(TRUE == true, "true_needs_to_be_true");
static_assert(FALSE == false, "false_needs_to_be_false");
#endif
-#ifndef NULL
-#define NULL 0
-#endif
-
#ifndef ASSERT
#ifndef NDEBUG
#define ASSERT assert
diff --git a/core/fxcrt/include/fx_ucd.h b/core/fxcrt/include/fx_ucd.h
index fbf3187c86..c2c4688628 100644
--- a/core/fxcrt/include/fx_ucd.h
+++ b/core/fxcrt/include/fx_ucd.h
@@ -158,7 +158,7 @@ class CFX_TxtChar : public CFX_Char {
m_iBidiLevel(0),
m_iBidiPos(0),
m_iBidiOrder(0),
- m_pUserData(NULL) {}
+ m_pUserData(nullptr) {}
uint32_t m_dwStatus;
int16_t m_iBidiClass;
int16_t m_iBidiLevel;
@@ -179,7 +179,7 @@ class CFX_RTFChar : public CFX_Char {
m_iBidiPos(0),
m_dwLayoutStyles(0),
m_dwIdentity(0),
- m_pUserData(NULL) {}
+ m_pUserData(nullptr) {}
uint32_t m_dwStatus;
int32_t m_iFontSize;
int32_t m_iFontHeight;
diff --git a/core/fxcrt/include/fx_xml.h b/core/fxcrt/include/fx_xml.h
index 8816e2eae1..0e8c82b103 100644
--- a/core/fxcrt/include/fx_xml.h
+++ b/core/fxcrt/include/fx_xml.h
@@ -53,13 +53,13 @@ class CXML_Element {
static CXML_Element* Parse(const void* pBuffer,
size_t size,
FX_BOOL bSaveSpaceChars = FALSE,
- FX_FILESIZE* pParsedSize = NULL);
+ FX_FILESIZE* pParsedSize = nullptr);
static CXML_Element* Parse(IFX_FileRead* pFile,
FX_BOOL bSaveSpaceChars = FALSE,
- FX_FILESIZE* pParsedSize = NULL);
+ FX_FILESIZE* pParsedSize = nullptr);
static CXML_Element* Parse(IFX_BufferRead* pBuffer,
FX_BOOL bSaveSpaceChars = FALSE,
- FX_FILESIZE* pParsedSize = NULL);
+ FX_FILESIZE* pParsedSize = nullptr);
CXML_Element(const CFX_ByteStringC& qSpace, const CFX_ByteStringC& tagName);
CXML_Element(const CFX_ByteStringC& qTagName);
diff --git a/core/fxcrt/xml_int.h b/core/fxcrt/xml_int.h
index 864b4e8789..6d3db4f525 100644
--- a/core/fxcrt/xml_int.h
+++ b/core/fxcrt/xml_int.h
@@ -48,7 +48,7 @@ class CXML_DataBufAcc : public IFX_BufferRead {
class CXML_DataStmAcc : public IFX_BufferRead {
public:
explicit CXML_DataStmAcc(IFX_FileRead* pFileRead)
- : m_pFileRead(pFileRead), m_pBuffer(NULL), m_nStart(0), m_dwSize(0) {
+ : m_pFileRead(pFileRead), m_pBuffer(nullptr), m_nStart(0), m_dwSize(0) {
ASSERT(m_pFileRead);
}
~CXML_DataStmAcc() override { FX_Free(m_pBuffer); }