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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_hint_tables.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_array.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
index d81725d06fd19e2225769a8f884bd0ea56f29cdf..18687e5fb7d1e3c4c92e6014c9b07d6a5acd025b 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
@@ -59,7 +59,7 @@ FX_BOOL CPDF_HintTables::ReadPageHintTable(CFX_BitStream* hStream) {
// Item 2: The location of the first page's page object.
uint32_t dwFirstObjLoc = hStream->GetBits(32);
- if (dwFirstObjLoc > nStreamOffset) {
+ if (dwFirstObjLoc > static_cast<uint32_t>(nStreamOffset)) {
FX_SAFE_DWORD safeLoc = pdfium::base::checked_cast<uint32_t>(nStreamLen);
safeLoc += dwFirstObjLoc;
if (!safeLoc.IsValid())
@@ -236,7 +236,7 @@ FX_BOOL CPDF_HintTables::ReadSharedObjHintTable(CFX_BitStream* hStream,
// Item 2: The location of the first object in the shared objects section.
uint32_t dwFirstSharedObjLoc = hStream->GetBits(32);
- if (dwFirstSharedObjLoc > nStreamOffset)
+ if (dwFirstSharedObjLoc > static_cast<uint32_t>(nStreamOffset))
dwFirstSharedObjLoc += nStreamLen;
// Item 3: The number of shared object entries for the first page.
@@ -387,12 +387,13 @@ IPDF_DataAvail::DocAvailStatus CPDF_HintTables::CheckPage(
uint32_t dwObjNum = 0;
for (uint32_t j = 0; j < m_dwNSharedObjsArray[index]; ++j) {
dwIndex = m_dwIdentifierArray[offset + j];
- if (dwIndex >= m_dwSharedObjNumArray.GetSize())
+ if (dwIndex >= static_cast<uint32_t>(m_dwSharedObjNumArray.GetSize()))
return IPDF_DataAvail::DataNotAvailable;
dwObjNum = m_dwSharedObjNumArray[dwIndex];
- if (dwObjNum >= nFirstPageObjNum &&
- dwObjNum < nFirstPageObjNum + m_nFirstPageSharedObjs) {
+ if (dwObjNum >= static_cast<uint32_t>(nFirstPageObjNum) &&
+ dwObjNum <
+ static_cast<uint32_t>(nFirstPageObjNum) + m_nFirstPageSharedObjs) {
continue;
}
@@ -428,7 +429,7 @@ FX_BOOL CPDF_HintTables::LoadHintStream(CPDF_Stream* pHintStream) {
// Hint table has at least 60 bytes.
const uint32_t MIN_STREAM_LEN = 60;
if (size < MIN_STREAM_LEN || shared_hint_table_offset <= 0 ||
- size < shared_hint_table_offset) {
+ size < static_cast<uint32_t>(shared_hint_table_offset)) {
return FALSE;
}
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_array.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698