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

Unified Diff: xfa/src/fgas/src/xml/fx_sax_imp.cpp

Issue 1577503002: Merge to XFA: Switch most min/max macros to std::min/max. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase 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 | « xfa/src/fgas/src/xml/fx_sax_imp.h ('k') | xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fgas/src/xml/fx_sax_imp.cpp
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.cpp b/xfa/src/fgas/src/xml/fx_sax_imp.cpp
index dce96470a69eec15c24d3f18128352a1da22603d..6b3cc778ab0af7842888a1b850b0a95c117bd670 100644
--- a/xfa/src/fgas/src/xml/fx_sax_imp.cpp
+++ b/xfa/src/fgas/src/xml/fx_sax_imp.cpp
@@ -4,8 +4,17 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <algorithm>
+
#include "xfa/src/fgas/src/fgas_base.h"
#include "fx_sax_imp.h"
+
+namespace {
+
+const FX_DWORD kSaxFileBufSize = 32768;
+
+} // namespace
+
IFX_SAXReader* FX_SAXReader_Create() {
return new CFX_SAXReader;
}
@@ -31,7 +40,7 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* pFile,
if (dwLen == 0) {
return FALSE;
}
- m_dwBufSize = FX_MIN(dwLen, FX_SAXFILE_BUFSIZE);
+ m_dwBufSize = std::min(dwLen, kSaxFileBufSize);
m_pBuf = FX_Alloc(uint8_t, m_dwBufSize);
if (!pFile->ReadBlock(m_pBuf, dwStart, m_dwBufSize)) {
return FALSE;
@@ -49,7 +58,7 @@ FX_BOOL CFX_SAXFile::ReadNextBlock() {
if (dwSize == 0) {
return FALSE;
}
- m_dwBufSize = FX_MIN(dwSize, FX_SAXFILE_BUFSIZE);
+ m_dwBufSize = std::min(dwSize, kSaxFileBufSize);
if (!m_pFile->ReadBlock(m_pBuf, m_dwCur, m_dwBufSize)) {
return FALSE;
}
« no previous file with comments | « xfa/src/fgas/src/xml/fx_sax_imp.h ('k') | xfa/src/fwl/src/basewidget/fwl_checkboximp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698