From 97da97662417085774f75c26e535c6fbe70266ae Mon Sep 17 00:00:00 2001 From: Wei Li Date: Fri, 11 Mar 2016 17:00:48 -0800 Subject: 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 . --- core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'core/src/fpdfapi/fpdf_render') 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(comps)) { FX_Free(m_pCompData); - m_nComponents = comps; + m_nComponents = static_cast(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++) { -- cgit v1.2.3