summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_basic_array.cpp
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/fx_basic_array.cpp
parent0687e76dc259c678b3f29a6608331f07ffd8f1e2 (diff)
downloadpdfium-4997b22f84307521a62838f874928bf56cd3423c.tar.xz
Get rid of NULLs in core/
Review-Url: https://codereview.chromium.org/2032613003
Diffstat (limited to 'core/fxcrt/fx_basic_array.cpp')
-rw-r--r--core/fxcrt/fx_basic_array.cpp12
1 files changed, 6 insertions, 6 deletions
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;
}