From a700b851c31a67ce4034731e8c06808498a9903b Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Tue, 19 Jun 2018 15:33:12 +0000 Subject: Use const pointers within GetDirectInteger function. Change-Id: I4a2905f9ce4433e8c00b274fa9703ff4dc459e95 Reviewed-on: https://pdfium-review.googlesource.com/35510 Commit-Queue: Art Snake Reviewed-by: dsinclair --- core/fpdfapi/parser/fpdf_parser_utility.cpp | 4 ++-- core/fpdfapi/parser/fpdf_parser_utility.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp index 1dad2a8ab3..3c99415d21 100644 --- a/core/fpdfapi/parser/fpdf_parser_utility.cpp +++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp @@ -84,8 +84,8 @@ int32_t GetHeaderOffset(const RetainPtr& pFile) { return kInvalidHeaderOffset; } -int32_t GetDirectInteger(CPDF_Dictionary* pDict, const ByteString& key) { - CPDF_Number* pObj = ToNumber(pDict->GetObjectFor(key)); +int32_t GetDirectInteger(const CPDF_Dictionary* pDict, const ByteString& key) { + const CPDF_Number* pObj = ToNumber(pDict->GetObjectFor(key)); return pObj ? pObj->GetInteger() : 0; } diff --git a/core/fpdfapi/parser/fpdf_parser_utility.h b/core/fpdfapi/parser/fpdf_parser_utility.h index 3ae8f6f13f..7529fbc484 100644 --- a/core/fpdfapi/parser/fpdf_parser_utility.h +++ b/core/fpdfapi/parser/fpdf_parser_utility.h @@ -43,7 +43,7 @@ constexpr int32_t kInvalidHeaderOffset = -1; // |kInvalidHeaderOffset|. int32_t GetHeaderOffset(const RetainPtr& pFile); -int32_t GetDirectInteger(CPDF_Dictionary* pDict, const ByteString& key); +int32_t GetDirectInteger(const CPDF_Dictionary* pDict, const ByteString& key); ByteString PDF_NameDecode(const ByteStringView& orig); ByteString PDF_NameEncode(const ByteString& orig); -- cgit v1.2.3