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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp

Issue 1841643002: Code change to avoid signed/unsigned mismatch warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 9 months 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/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_array.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp b/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp
index 14410dabb5086e3bbda7da0527ffb6a6ab044c6a..ef3395d3aec70815738a68e054de66fa571868dd 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp
@@ -26,7 +26,8 @@ CPDF_Object* CPDF_IndirectObjectHolder::GetIndirectObject(uint32_t objnum) {
auto it = m_IndirectObjs.find(objnum);
if (it != m_IndirectObjs.end())
- return it->second->GetObjNum() != -1 ? it->second : nullptr;
+ return it->second->GetObjNum() != CPDF_Object::kInvalidObjNum ? it->second
+ : nullptr;
if (!m_pParser)
return nullptr;
@@ -56,8 +57,10 @@ uint32_t CPDF_IndirectObjectHolder::AddIndirectObject(CPDF_Object* pObj) {
void CPDF_IndirectObjectHolder::ReleaseIndirectObject(uint32_t objnum) {
auto it = m_IndirectObjs.find(objnum);
- if (it == m_IndirectObjs.end() || it->second->GetObjNum() == -1)
+ if (it == m_IndirectObjs.end() ||
+ it->second->GetObjNum() == CPDF_Object::kInvalidObjNum) {
return;
+ }
it->second->Destroy();
m_IndirectObjs.erase(it);
}
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698