summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
committerLei Zhang <thestig@chromium.org>2016-01-11 11:59:17 -0800
commit375a86403b7fa8d17d7b142c270e2d8e33bb924f (patch)
tree1db1ffddb2bbbcd429cd1d7954b1949bfa54e1ab /core/src/fxcodec/codec
parent492961df3011ccc25646eae12ac6e6dcfe7f26da (diff)
downloadpdfium-375a86403b7fa8d17d7b142c270e2d8e33bb924f.tar.xz
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 .
Diffstat (limited to 'core/src/fxcodec/codec')
-rw-r--r--core/src/fxcodec/codec/fx_codec_png.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_png.cpp b/core/src/fxcodec/codec/fx_codec_png.cpp
index 6401081ea3..3acfc19442 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);