summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/xml_int.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-08 15:31:47 -0800
committerLei Zhang <thestig@chromium.org>2016-01-08 15:31:47 -0800
commit9adfbb0920a258e916003b1ee9515e97879db82a (patch)
tree69c568cf9857ea028da91cc3a73f15a21a2c4c73 /core/src/fxcrt/xml_int.h
parente5ae7226fc3ffad3f76995d31a0f6b2254d50656 (diff)
downloadpdfium-9adfbb0920a258e916003b1ee9515e97879db82a.tar.xz
Switch most min/max macros to std::min/max.
Fix lint errors along the way. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1567343002 .
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);
}