diff options
author | Wei Li <weili@chromium.org> | 2016-03-29 16:42:53 -0700 |
---|---|---|
committer | Wei Li <weili@chromium.org> | 2016-03-29 16:42:53 -0700 |
commit | 05d53f0355e9889c43bfa436e985d5643f249d99 (patch) | |
tree | eca037b407114efe357e8280a96e44eee182cdfc /core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp | |
parent | 602aebc11a615971800d38f8d427a4e4f95c1134 (diff) | |
download | pdfium-05d53f0355e9889c43bfa436e985d5643f249d99.tar.xz |
Code change to avoid signed/unsigned mismatch warnings.
This makes pdfium code on Linux and Mac sign-compare warning free.
The warning flag will be re-enabled after checking on windows clang build.
BUG=pdfium:29
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1841643002 .
Diffstat (limited to 'core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp index d81725d06f..18687e5fb7 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; } |