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

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp

Issue 1512763013: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
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
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
index 2d9df06f679237e8d7edee13b7b13b9e77151dd7..7858eae057d53cce61bd342eb4477fa1e556e4e9 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -161,7 +161,7 @@ CPDF_Array* CPDF_Object::GetArray() const {
return const_cast<CPDF_Array*>(AsArray());
}
void CPDF_Object::SetString(const CFX_ByteString& str) {
- ASSERT(this != NULL);
+ ASSERT(this);
Tom Sepez 2015/12/14 19:14:07 Uh, no.
Lei Zhang 2015/12/15 01:38:32 Done.
switch (m_Type) {
case PDFOBJ_BOOLEAN:
AsBoolean()->m_bValue = (str == "true");
@@ -526,17 +526,15 @@ void CPDF_Array::SetAt(FX_DWORD i,
void CPDF_Array::InsertAt(FX_DWORD index,
CPDF_Object* pObj,
CPDF_IndirectObjects* pObjs) {
- ASSERT(pObj != NULL);
if (pObj->GetObjNum()) {
- ASSERT(pObjs != NULL);
+ ASSERT(pObjs);
Tom Sepez 2015/12/14 19:14:08 Probably segvs under next line? Or is it special
Lei Zhang 2015/12/15 01:38:32 The next line dereferences |pObj| but not |pObjs|.
pObj = new CPDF_Reference(pObjs, pObj->GetObjNum());
}
m_Objects.InsertAt(index, pObj);
}
void CPDF_Array::Add(CPDF_Object* pObj, CPDF_IndirectObjects* pObjs) {
- ASSERT(pObj != NULL);
if (pObj->GetObjNum()) {
- ASSERT(pObjs != NULL);
+ ASSERT(pObjs);
Tom Sepez 2015/12/14 19:14:07 and here.
Lei Zhang 2015/12/15 01:38:32 Same as above.
pObj = new CPDF_Reference(pObjs, pObj->GetObjNum());
}
m_Objects.Add(pObj);

Powered by Google App Engine
This is Rietveld 408576698