Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: core/fxcrt/fx_basic_array.cpp

Issue 2032613003: Get rid of NULLs in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Fix a bad merge Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxcrt/fx_arabic.cpp ('k') | core/fxcrt/fx_basic_bstring_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_array.cpp
diff --git a/core/fxcrt/fx_basic_array.cpp b/core/fxcrt/fx_basic_array.cpp
index eb6570d950439dc861dd9d72704b4a4323ddb1a4..0a2dc43fc542426f1bb5565b9530a147442f2f30 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;
}
« no previous file with comments | « core/fxcrt/fx_arabic.cpp ('k') | core/fxcrt/fx_basic_bstring_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698