diff options
author | Wei Li <weili@chromium.org> | 2016-03-11 17:00:48 -0800 |
---|---|---|
committer | Wei Li <weili@chromium.org> | 2016-03-11 17:00:48 -0800 |
commit | 97da97662417085774f75c26e535c6fbe70266ae (patch) | |
tree | 9654be693dfb20b49be80911fa8089ff319757f3 /core/src/fpdfapi/fpdf_render | |
parent | 55265016faac358266af280db6c62afa34ce2891 (diff) | |
download | pdfium-97da97662417085774f75c26e535c6fbe70266ae.tar.xz |
Re-enable MSVC warning 4800 for compiling with chromium_code
Mainly change the code to avoid the warnings; in a few cases we have
to use explicit casts.
BUG=pdfium:29
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1783023002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 6618a13709..93b867005c 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -628,13 +628,14 @@ int CPDF_DIBSource::CreateDecoder() { pParams ? pParams->GetIntegerBy("ColorTransform", 1) : 1)); if (!m_pDecoder) { FX_BOOL bTransform = FALSE; - int comps, bpc; + int comps; + int bpc; ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule(); if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps, bpc, bTransform)) { - if (m_nComponents != comps) { + if (m_nComponents != static_cast<FX_DWORD>(comps)) { FX_Free(m_pCompData); - m_nComponents = comps; + m_nComponents = static_cast<FX_DWORD>(comps); if (m_Family == PDFCS_LAB && m_nComponents != 3) { m_pCompData = nullptr; return 0; @@ -1440,7 +1441,9 @@ void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp, FX_BOOL bFlipX, int clip_left, int clip_width) const { - int last_src_x = -1; + // last_src_x used to store the last seen src_x position which should be + // in [0, src_width). Set the initial value to be an invalid src_x value. + FX_DWORD last_src_x = src_width; FX_ARGB last_argb = FXARGB_MAKE(0xFF, 0xFF, 0xFF, 0xFF); FX_FLOAT unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1); for (int i = 0; i < clip_width; i++) { |