summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/xml_int.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
committerLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
commit375a86403b7fa8d17d7b142c270e2d8e33bb924f (patch)
tree1db1ffddb2bbbcd429cd1d7954b1949bfa54e1ab /core/src/fxcrt/xml_int.h
parent492961df3011ccc25646eae12ac6e6dcfe7f26da (diff)
downloadpdfium-375a86403b7fa8d17d7b142c270e2d8e33bb924f.tar.xz
Merge to XFA: Switch most min/max macros to std::min/max.
Fix lint errors along the way. R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1567343002 . (cherry picked from commit 9adfbb0920a258e916003b1ee9515e97879db82a) Review URL: https://codereview.chromium.org/1577503002 .
Diffstat (limited to 'core/src/fxcrt/xml_int.h')
-rw-r--r--core/src/fxcrt/xml_int.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/src/fxcrt/xml_int.h b/core/src/fxcrt/xml_int.h
index b11a64b505..a837327445 100644
--- a/core/src/fxcrt/xml_int.h
+++ b/core/src/fxcrt/xml_int.h
@@ -7,6 +7,8 @@
#ifndef CORE_SRC_FXCRT_XML_INT_H_
#define CORE_SRC_FXCRT_XML_INT_H_
+#include <algorithm>
+
#include "core/include/fxcrt/fx_stream.h"
class CFX_UTF8Decoder;
@@ -43,10 +45,9 @@ class CXML_DataBufAcc : public IFX_BufferRead {
size_t m_dwCurPos;
};
-#define FX_XMLDATASTREAM_BufferSize (32 * 1024)
class CXML_DataStmAcc : public IFX_BufferRead {
public:
- CXML_DataStmAcc(IFX_FileRead* pFileRead)
+ explicit CXML_DataStmAcc(IFX_FileRead* pFileRead)
: m_pFileRead(pFileRead), m_pBuffer(NULL), m_nStart(0), m_dwSize(0) {
FXSYS_assert(m_pFileRead);
}
@@ -69,7 +70,9 @@ class CXML_DataStmAcc : public IFX_BufferRead {
if (m_nStart >= nLength) {
return FALSE;
}
- m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart);
+ static const FX_FILESIZE FX_XMLDATASTREAM_BufferSize = 32 * 1024;
+ m_dwSize = static_cast<size_t>(
+ std::min(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart));
if (!m_pBuffer) {
m_pBuffer = FX_Alloc(uint8_t, m_dwSize);
}