summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-08-30 10:22:55 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-30 14:33:53 +0000
commit980a3ea30872cef9ada360aa85e7c3573d7668b5 (patch)
treebf4306399f11aa9e46a6274f1665a5d41c417bb6 /core/fxcrt/xml
parent304eefb58759e56be3fb357c78204accd4fa98fc (diff)
downloadpdfium-980a3ea30872cef9ada360aa85e7c3573d7668b5.tar.xz
Cleanup CFX_SeekableStreamProxy
Clean up being done in preperation for removal of negative length strings. This means that FX_STRSIZE will become unsigned so the return methods cannot return -1. Other cleanup suggested by reviewers is included. BUG=pdfium:828 Change-Id: I2cfb78c8ab7738516e0c9f8a99caec6f6cb12cde Reviewed-on: https://pdfium-review.googlesource.com/12170 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/xml')
-rw-r--r--core/fxcrt/xml/cfx_xmlsyntaxparser.cpp6
-rw-r--r--core/fxcrt/xml/cfx_xmlsyntaxparser.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp b/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp
index e3d690f5ab..bbbc4f4399 100644
--- a/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp
+++ b/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp
@@ -128,8 +128,8 @@ FX_XmlSyntaxResult CFX_XMLSyntaxParser::DoSyntaxParse() {
return m_syntaxParserResult;
}
- int32_t iStreamLength = m_pStream->GetLength();
- int32_t iPos;
+ FX_FILESIZE iStreamLength = m_pStream->GetLength();
+ FX_FILESIZE iPos;
FX_XmlSyntaxResult syntaxParserResult = FX_XmlSyntaxResult::None;
while (true) {
@@ -141,7 +141,7 @@ FX_XmlSyntaxResult CFX_XMLSyntaxParser::DoSyntaxParse() {
m_ParsedChars += m_End;
m_iParsedBytes = m_iCurrentPos;
if (m_pStream->GetPosition() != m_iCurrentPos)
- m_pStream->Seek(CFX_SeekableStreamProxy::Pos::Begin, m_iCurrentPos);
+ m_pStream->Seek(CFX_SeekableStreamProxy::From::Begin, m_iCurrentPos);
m_iBufferChars =
m_pStream->ReadString(m_Buffer.data(), m_iXMLPlaneSize, &m_bEOS);
diff --git a/core/fxcrt/xml/cfx_xmlsyntaxparser.h b/core/fxcrt/xml/cfx_xmlsyntaxparser.h
index 32e55f1ff0..c59cabae19 100644
--- a/core/fxcrt/xml/cfx_xmlsyntaxparser.h
+++ b/core/fxcrt/xml/cfx_xmlsyntaxparser.h
@@ -102,13 +102,13 @@ class CFX_XMLSyntaxParser {
CFX_RetainPtr<CFX_SeekableStreamProxy> m_pStream;
FX_STRSIZE m_iXMLPlaneSize;
- int32_t m_iCurrentPos;
+ FX_FILESIZE m_iCurrentPos;
int32_t m_iCurrentNodeNum;
int32_t m_iLastNodeNum;
int32_t m_iParsedBytes;
FX_FILESIZE m_ParsedChars;
std::vector<wchar_t> m_Buffer;
- int32_t m_iBufferChars;
+ FX_STRSIZE m_iBufferChars;
bool m_bEOS;
FX_FILESIZE m_Start; // Start position in m_Buffer
FX_FILESIZE m_End; // End position in m_Buffer