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/fxcodec/codec/fx_codec_png.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core/src/fxcodec/codec') 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 + #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); -- cgit v1.2.3