Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Unified Diff: core/src/fxcrt/xml_int.h

Issue 1567343002: Switch most min/max macros to std::min/max. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: actually compile Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxcrt/fx_extension.cpp ('k') | core/src/fxge/agg/src/fx_agg_driver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/xml_int.h
diff --git a/core/src/fxcrt/xml_int.h b/core/src/fxcrt/xml_int.h
index b11a64b5050890af90a266a35f0c6c636ffe008b..a837327445c8c2339001dbe867565b223d6c58d0 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);
}
« no previous file with comments | « core/src/fxcrt/fx_extension.cpp ('k') | core/src/fxge/agg/src/fx_agg_driver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698