From 6daeb04d3f61378d46d2543573d87e587dd9e544 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 24 Jan 2018 21:57:40 +0000 Subject: Fix some nits in CPDF_Parser. Change-Id: Ib4c6589a63761e8993e8cd33ed9459ba3d1e206c Reviewed-on: https://pdfium-review.googlesource.com/23911 Reviewed-by: dsinclair Commit-Queue: Lei Zhang --- core/fpdfapi/parser/cpdf_parser.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp index 0d1b02a5ce..d8ac8c97b3 100644 --- a/core/fpdfapi/parser/cpdf_parser.cpp +++ b/core/fpdfapi/parser/cpdf_parser.cpp @@ -35,6 +35,7 @@ namespace { // this may be large enough in practice. const int32_t kMaxXRefSize = 1048576; +// "%PDF-1.7\n" constexpr FX_FILESIZE kPDFHeaderSize = 9; uint32_t GetVarInt(const uint8_t* p, int32_t n) { @@ -167,7 +168,7 @@ bool CPDF_Parser::IsObjectFreeOrNull(uint32_t objnum) const { case ObjectType::kCompressed: return false; } - ASSERT(false); // NOTREACHED(); + NOTREACHED(); return false; } @@ -395,7 +396,7 @@ bool CPDF_Parser::VerifyCrossRefV4() { // something is wrong with the cross reference table. return false; } - return true; + break; } return true; } @@ -637,15 +638,13 @@ bool CPDF_Parser::ParseCrossRefV4(std::vector* out_objects) { return true; } -bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, - bool bSkip) { +bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, bool bSkip) { m_pSyntax->SetPos(pos); std::vector objects; if (!ParseCrossRefV4(bSkip ? nullptr : &objects)) return false; MergeCrossRefObjectsData(objects); - return true; } @@ -1077,7 +1076,7 @@ bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE* pos, bool bMainXRef) { } } - if (arrIndex.size() == 0) + if (arrIndex.empty()) arrIndex.push_back(std::make_pair(0, size)); pArray = pDict->GetArrayFor("W"); -- cgit v1.2.3