summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_parser
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/fpdfapi/fpdf_parser
parent0687e76dc259c678b3f29a6608331f07ffd8f1e2 (diff)
downloadpdfium-4997b22f84307521a62838f874928bf56cd3423c.tar.xz
Get rid of NULLs in core/
Review-Url: https://codereview.chromium.org/2032613003
Diffstat (limited to 'core/fpdfapi/fpdf_parser')
-rw-r--r--core/fpdfapi/fpdf_parser/cfdf_document.cpp6
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_array.cpp4
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp2
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp22
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp5
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_document.h2
6 files changed, 21 insertions, 20 deletions
diff --git a/core/fpdfapi/fpdf_parser/cfdf_document.cpp b/core/fpdfapi/fpdf_parser/cfdf_document.cpp
index d4f49f659b..c039871401 100644
--- a/core/fpdfapi/fpdf_parser/cfdf_document.cpp
+++ b/core/fpdfapi/fpdf_parser/cfdf_document.cpp
@@ -10,9 +10,9 @@
#include "core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
-CFDF_Document::CFDF_Document() : CPDF_IndirectObjectHolder(NULL) {
- m_pRootDict = NULL;
- m_pFile = NULL;
+CFDF_Document::CFDF_Document() : CPDF_IndirectObjectHolder(nullptr) {
+ m_pRootDict = nullptr;
+ m_pFile = nullptr;
m_bOwnFile = FALSE;
}
CFDF_Document::~CFDF_Document() {
diff --git a/core/fpdfapi/fpdf_parser/cpdf_array.cpp b/core/fpdfapi/fpdf_parser/cpdf_array.cpp
index 20073772b7..a047b3af7b 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_array.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_array.cpp
@@ -101,12 +101,12 @@ FX_FLOAT CPDF_Array::GetNumberAt(size_t i) const {
CPDF_Dictionary* CPDF_Array::GetDictAt(size_t i) const {
CPDF_Object* p = GetDirectObjectAt(i);
if (!p)
- return NULL;
+ return nullptr;
if (CPDF_Dictionary* pDict = p->AsDictionary())
return pDict;
if (CPDF_Stream* pStream = p->AsStream())
return pStream->GetDict();
- return NULL;
+ return nullptr;
}
CPDF_Stream* CPDF_Array::GetStreamAt(size_t i) const {
diff --git a/core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp b/core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp
index 2d845d856a..3cd973c277 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp
@@ -328,7 +328,7 @@ FX_BOOL CPDF_CryptoHandler::EncryptContent(uint32_t objnum,
return TRUE;
}
CPDF_CryptoHandler::CPDF_CryptoHandler() {
- m_pAESContext = NULL;
+ m_pAESContext = nullptr;
m_Cipher = FXCIPHER_NONE;
m_KeyLen = 0;
}
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
index c705a657aa..d3f9a54f4c 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
@@ -74,13 +74,13 @@ CPDF_DataAvail::CPDF_DataAvail(IPDF_DataAvail::FileAvail* pFileAvail,
m_bPageLoadedOK = FALSE;
m_bNeedDownLoadResource = FALSE;
m_bLinearizedFormParamLoad = FALSE;
- m_pLinearized = NULL;
- m_pRoot = NULL;
- m_pTrailer = NULL;
- m_pCurrentParser = NULL;
- m_pAcroForm = NULL;
- m_pPageDict = NULL;
- m_pPageResource = NULL;
+ m_pLinearized = nullptr;
+ m_pRoot = nullptr;
+ m_pTrailer = nullptr;
+ m_pCurrentParser = nullptr;
+ m_pAcroForm = nullptr;
+ m_pPageDict = nullptr;
+ m_pPageResource = nullptr;
m_docStatus = PDF_DATAAVAIL_HEADER;
m_parser.m_bOwnFileRead = false;
m_bTotalLoadPageTree = FALSE;
@@ -569,7 +569,7 @@ FX_BOOL CPDF_DataAvail::GetPageKids(CPDF_Parser* pParser, CPDF_Object* pPages) {
}
CPDF_Dictionary* pDict = pPages->GetDict();
- CPDF_Object* pKids = pDict ? pDict->GetObjectBy("Kids") : NULL;
+ CPDF_Object* pKids = pDict ? pDict->GetObjectBy("Kids") : nullptr;
if (!pKids)
return TRUE;
@@ -642,19 +642,19 @@ FX_BOOL CPDF_DataAvail::CheckHeader(IPDF_DataAvail::DownloadHints* pHints) {
FX_BOOL CPDF_DataAvail::CheckFirstPage(IPDF_DataAvail::DownloadHints* pHints) {
CPDF_Dictionary* pDict = m_pLinearized->GetDict();
- CPDF_Object* pEndOffSet = pDict ? pDict->GetObjectBy("E") : NULL;
+ CPDF_Object* pEndOffSet = pDict ? pDict->GetObjectBy("E") : nullptr;
if (!pEndOffSet) {
m_docStatus = PDF_DATAAVAIL_ERROR;
return FALSE;
}
- CPDF_Object* pXRefOffset = pDict ? pDict->GetObjectBy("T") : NULL;
+ CPDF_Object* pXRefOffset = pDict ? pDict->GetObjectBy("T") : nullptr;
if (!pXRefOffset) {
m_docStatus = PDF_DATAAVAIL_ERROR;
return FALSE;
}
- CPDF_Object* pFileLen = pDict ? pDict->GetObjectBy("L") : NULL;
+ CPDF_Object* pFileLen = pDict ? pDict->GetObjectBy("L") : nullptr;
if (!pFileLen) {
m_docStatus = PDF_DATAAVAIL_ERROR;
return FALSE;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp b/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp
index a4629dcf6b..65d3173613 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp
@@ -531,7 +531,7 @@ void CPDF_SecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict,
owner_size = user_size;
}
if (m_Revision >= 5) {
- int t = (int)time(NULL);
+ int t = (int)time(nullptr);
uint8_t sha[128];
CRYPT_SHA256Start(sha);
CRYPT_SHA256Update(sha, (uint8_t*)&t, sizeof t);
@@ -620,7 +620,8 @@ void CPDF_SecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict,
const uint8_t* user_pass,
uint32_t user_size,
uint32_t type) {
- OnCreate(pEncryptDict, pIdArray, user_pass, user_size, NULL, 0, FALSE, type);
+ OnCreate(pEncryptDict, pIdArray, user_pass, user_size, nullptr, 0, FALSE,
+ type);
}
void CPDF_SecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptDict,
const uint8_t* password,
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_document.h b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
index e1d1c77a12..24d400fcd7 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
@@ -70,7 +70,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
// |pFontDict| must not be null.
CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict);
CPDF_ColorSpace* LoadColorSpace(CPDF_Object* pCSObj,
- CPDF_Dictionary* pResources = NULL);
+ CPDF_Dictionary* pResources = nullptr);
CPDF_Pattern* LoadPattern(CPDF_Object* pObj,
FX_BOOL bShading,