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

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: rebase Created 5 years 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/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index fbe6faa47100a04a744ec54ed6431d12d5f17dcf..2f68d788082dbe460b9b3a3ac39e48a58c6d1eb1 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -249,7 +249,7 @@ CPDF_StreamParser::~CPDF_StreamParser() {
FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder,
uint8_t*& dest_buf,
FX_DWORD& dest_size) {
- if (pDecoder == NULL) {
+ if (!pDecoder) {
return (FX_DWORD)-1;
}
int ncomps = pDecoder->CountComps();
@@ -353,7 +353,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
FX_DWORD bpc = pDict->GetInteger("BitsPerComponent");
FX_DWORD nComponents = 1;
CPDF_ColorSpace* pCS = pDoc->LoadColorSpace(pCSObj);
- if (pCS == NULL) {
+ if (!pCS) {
nComponents = 3;
} else {
nComponents = pCS->CountComponents();
@@ -634,7 +634,7 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray,
CFX_ByteString key =
PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1));
CPDF_Object* pObj = ReadNextObject(TRUE);
- if (pObj == NULL) {
+ if (!pObj) {
if (pDict) {
pDict->Release();
}
@@ -655,7 +655,7 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray,
CPDF_Array* pArray = CPDF_Array::Create();
while (1) {
CPDF_Object* pObj = ReadNextObject(bAllowNestedArray, TRUE);
- if (pObj == NULL) {
+ if (!pObj) {
if (m_WordSize == 0 || m_WordBuffer[0] == ']') {
return pArray;
}
@@ -924,8 +924,8 @@ void CPDF_ContentParser::Clear() {
m_Status = Ready;
}
void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions) {
- if (m_Status != Ready || pPage == NULL || pPage->m_pDocument == NULL ||
- pPage->m_pFormDict == NULL) {
+ if (m_Status != Ready || !pPage || !pPage->m_pDocument ||
+ !pPage->m_pFormDict) {
m_Status = Done;
return;
}
@@ -938,7 +938,7 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions) {
m_InternalStage = PAGEPARSE_STAGE_GETCONTENT;
m_CurrentOffset = 0;
CPDF_Object* pContent = pPage->m_pFormDict->GetElementValue("Contents");
- if (pContent == NULL) {
+ if (!pContent) {
m_Status = Done;
return;
}
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698