summaryrefslogtreecommitdiff
path: root/core/fxcrt/include/fx_basic.h
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-07 10:46:22 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-07 10:46:23 -0700
commit4997b22f84307521a62838f874928bf56cd3423c (patch)
treead11d99ac0a491ee222e9d0a42ec3b6ad3354e2a /core/fxcrt/include/fx_basic.h
parent0687e76dc259c678b3f29a6608331f07ffd8f1e2 (diff)
downloadpdfium-4997b22f84307521a62838f874928bf56cd3423c.tar.xz
Get rid of NULLs in core/
Review-Url: https://codereview.chromium.org/2032613003
Diffstat (limited to 'core/fxcrt/include/fx_basic.h')
-rw-r--r--core/fxcrt/include/fx_basic.h23
1 files changed, 12 insertions, 11 deletions
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: