From 375a86403b7fa8d17d7b142c270e2d8e33bb924f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 11 Jan 2016 11:59:17 -0800 Subject: 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 . --- core/src/fxcrt/xml_int.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'core/src/fxcrt/xml_int.h') 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 + #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( + std::min(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart)); if (!m_pBuffer) { m_pBuffer = FX_Alloc(uint8_t, m_dwSize); } -- cgit v1.2.3