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

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.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_parser/fpdf_parser_parser.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index 121b2f4a040c9ad8de8cc9aed1dbd6166dc29d4b..6e20b582fc4b4233ed068d949392494638a8b364 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -284,7 +284,7 @@ FX_BOOL CPDF_SimpleParser::FindTagParam(const CFX_ByteStringC& token,
CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr) {
int size = bstr.GetLength();
const FX_CHAR* pSrc = bstr.GetCStr();
- if (FXSYS_memchr(pSrc, '#', size) == NULL) {
+ if (!FXSYS_memchr(pSrc, '#', size)) {
return bstr;
}
CFX_ByteString result;
@@ -303,7 +303,7 @@ CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr) {
return result;
}
CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig) {
- if (FXSYS_memchr(orig.c_str(), '#', orig.GetLength()) == NULL) {
+ if (!FXSYS_memchr(orig.c_str(), '#', orig.GetLength())) {
return orig;
}
return PDF_NameDecode(CFX_ByteStringC(orig));
@@ -344,7 +344,7 @@ CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig) {
return res;
}
CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj) {
- if (pObj == NULL) {
+ if (!pObj) {
buf << " null";
return buf;
}
@@ -444,12 +444,12 @@ static CPDF_Object* SearchNumberNode(CPDF_Dictionary* pNode, int num) {
return NULL;
}
CPDF_Array* pKids = pNode->GetArray("Kids");
- if (pKids == NULL) {
+ if (!pKids) {
return NULL;
}
for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
CPDF_Dictionary* pKid = pKids->GetDict(i);
- if (pKid == NULL) {
+ if (!pKid) {
continue;
}
CPDF_Object* pFound = SearchNumberNode(pKid, num);
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698