summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/xml_int.h
diff options
context:
space:
mode:
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);
}