summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_parser
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-11 17:00:48 -0800
committerWei Li <weili@chromium.org>2016-03-11 17:00:48 -0800
commit97da97662417085774f75c26e535c6fbe70266ae (patch)
tree9654be693dfb20b49be80911fa8089ff319757f3 /core/src/fpdfapi/fpdf_parser
parent55265016faac358266af280db6c62afa34ce2891 (diff)
downloadpdfium-97da97662417085774f75c26e535c6fbe70266ae.tar.xz
Re-enable MSVC warning 4800 for compiling with chromium_code
Mainly change the code to avoid the warnings; in a few cases we have to use explicit casts. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1783023002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r--core/src/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_parser/cpdf_parser.cpp9
-rw-r--r--core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp3
3 files changed, 8 insertions, 6 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp b/core/src/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
index 6256f4c526..84464fcff2 100644
--- a/core/src/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
+++ b/core/src/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
@@ -267,7 +267,7 @@ FX_BOOL CPDF_HintTables::ReadSharedObjHintTable(CFX_BitStream* hStream,
if (!CanReadFromBitStream(hStream, required_bits))
return FALSE;
- for (int i = 0; i < dwSharedObjTotal; ++i) {
+ for (FX_DWORD i = 0; i < dwSharedObjTotal; ++i) {
dwPrevObjLen = dwCurObjLen;
FX_SAFE_DWORD safeObjLen = hStream->GetBits(dwDeltaGroupLen);
safeObjLen += dwGroupLeastLen;
diff --git a/core/src/fpdfapi/fpdf_parser/cpdf_parser.cpp b/core/src/fpdfapi/fpdf_parser/cpdf_parser.cpp
index c9a2d8d496..e9332901c0 100644
--- a/core/src/fpdfapi/fpdf_parser/cpdf_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/cpdf_parser.cpp
@@ -55,6 +55,7 @@ CPDF_Parser::CPDF_Parser()
m_FileVersion(0),
m_pTrailer(nullptr),
m_pEncryptDict(nullptr),
+ m_bVersionUpdated(false),
m_pLinearized(nullptr),
m_dwFirstPageNo(0),
m_dwXrefStartObjNum(0) {
@@ -124,7 +125,7 @@ void CPDF_Parser::ShrinkObjectMap(FX_DWORD objnum) {
}
void CPDF_Parser::CloseParser() {
- m_bVersionUpdated = FALSE;
+ m_bVersionUpdated = false;
delete m_pDocument;
m_pDocument = nullptr;
@@ -466,7 +467,7 @@ FX_BOOL CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos,
m_ObjectInfo[objnum].pos = offset;
int32_t version = FXSYS_atoi(pEntry + 11);
if (version >= 1)
- m_bVersionUpdated = TRUE;
+ m_bVersionUpdated = true;
m_ObjectInfo[objnum].gennum = version;
if (m_ObjectInfo[objnum].pos < m_pSyntax->m_FileLen)
@@ -541,7 +542,7 @@ bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos,
m_ObjectInfo[objnum].pos = offset;
int32_t version = FXSYS_atoi(pEntry + 11);
if (version >= 1)
- m_bVersionUpdated = TRUE;
+ m_bVersionUpdated = true;
m_ObjectInfo[objnum].gennum = version;
if (m_ObjectInfo[objnum].pos < m_pSyntax->m_FileLen)
@@ -775,7 +776,7 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() {
m_ObjectInfo[objnum].pos = obj_pos;
m_ObjectInfo[objnum].gennum = gennum;
if (oldgen != gennum)
- m_bVersionUpdated = TRUE;
+ m_bVersionUpdated = true;
}
} else {
m_ObjectInfo[objnum].pos = obj_pos;
diff --git a/core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp b/core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
index b414827f95..89ad5eec33 100644
--- a/core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
@@ -772,7 +772,8 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict,
GetNextWordInternal(nullptr);
int numMarkers = ReadEOLMarkers(m_Pos);
- if (m_WordSize == kEndObjStr.GetLength() && numMarkers != 0 &&
+ if (m_WordSize == static_cast<unsigned int>(kEndObjStr.GetLength()) &&
+ numMarkers != 0 &&
FXSYS_memcmp(m_WordBuffer, kEndObjStr.GetPtr(), kEndObjStr.GetLength()) ==
0) {
m_Pos = streamStartPos;