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

Unified Diff: core/src/fxcodec/codec/fx_codec_png.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 | « core/src/fpdftext/fpdf_text_int.cpp ('k') | core/src/fxcodec/lbmp/fx_bmp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/codec/fx_codec_png.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_png.cpp b/core/src/fxcodec/codec/fx_codec_png.cpp
index 6401081ea3a3ca3c5d6ae06dcaa4d8735b60bf30..3acfc1944268a63180f91142f572b4cfb5d6bf42 100644
--- a/core/src/fxcodec/codec/fx_codec_png.cpp
+++ b/core/src/fxcodec/codec/fx_codec_png.cpp
@@ -4,6 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include <algorithm>
+
#include "core/include/fxcodec/fx_codec.h"
#include "core/include/fxge/fx_dib.h"
#include "codec_int.h"
@@ -62,24 +64,24 @@ static void _png_load_bmp_attribute(png_structp png_ptr,
#endif
#if defined(PNG_TEXT_SUPPORTED)
int i;
- FX_DWORD len;
+ FX_STRSIZE len;
const FX_CHAR* buf;
int num_text;
png_textp text = NULL;
png_get_text(png_ptr, info_ptr, &text, &num_text);
for (i = 0; i < num_text; i++) {
- len = (FX_DWORD)FXSYS_strlen(text[i].key);
+ len = FXSYS_strlen(text[i].key);
buf = "Time";
- if (!FXSYS_memcmp(buf, text[i].key, FX_MIN(len, FXSYS_strlen(buf)))) {
+ if (!FXSYS_memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) {
if (!bTime) {
FXSYS_memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime));
FXSYS_memcpy(
pAttribute->m_strTime, text[i].text,
- FX_MIN(sizeof(pAttribute->m_strTime) - 1, text[i].text_length));
+ std::min(sizeof(pAttribute->m_strTime) - 1, text[i].text_length));
}
} else {
buf = "Author";
- if (!FXSYS_memcmp(buf, text[i].key, FX_MIN(len, FXSYS_strlen(buf)))) {
+ if (!FXSYS_memcmp(buf, text[i].key, std::min(len, FXSYS_strlen(buf)))) {
pAttribute->m_strAuthor.Empty();
pAttribute->m_strAuthor.Load((uint8_t*)text[i].text,
(FX_STRSIZE)text[i].text_length);
« no previous file with comments | « core/src/fpdftext/fpdf_text_int.cpp ('k') | core/src/fxcodec/lbmp/fx_bmp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698