diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-08 15:51:29 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-08 15:51:29 -0700 |
commit | d03ba8d1a5928e8f3f6bd7da063b53b0bc40abfd (patch) | |
tree | 7736bff04e9169378df7c21bcb24af043ea70b29 /core/src/fpdfapi/fpdf_render | |
parent | 06f255ca4040f3d73cf09f1dbd63a3b167f6a4c1 (diff) | |
download | pdfium-d03ba8d1a5928e8f3f6bd7da063b53b0bc40abfd.tar.xz |
Fix a bunch of sign mismatch warnings.
Also remove some gotos and move code into an anonymous namespace.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1356373003 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 4 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp | 16 |
2 files changed, 11 insertions, 9 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 1e7f077d48..c3029e0091 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -738,7 +738,7 @@ void CPDF_DIBSource::LoadJpxBitmap() { } m_pCachedBitmap->Clear(0xFFFFFFFF); std::vector<uint8_t> output_offsets(components); - for (int i = 0; i < components; ++i) + for (FX_DWORD i = 0; i < components; ++i) output_offsets[i] = i; if (bSwapRGB) { output_offsets[0] = 2; @@ -1484,7 +1484,7 @@ void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp, bTransMask); } } else { - for (int j = 0; j < m_nComponents; ++j) { + for (FX_DWORD j = 0; j < m_nComponents; ++j) { int color_value = (int)((m_pCompData[j].m_DecodeMin + m_pCompData[j].m_DecodeStep * (FX_FLOAT)pSrcPixel[j]) * diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp index 054dabc8ed..89ac8ac143 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -525,7 +525,7 @@ class CPDF_CharPosList { FXTEXT_CHARPOS* m_pCharPos; FX_DWORD m_nChars; }; -FX_FLOAT _CIDTransformToFloat(uint8_t ch); + CPDF_CharPosList::CPDF_CharPosList() { m_pCharPos = NULL; } @@ -578,12 +578,14 @@ void CPDF_CharPosList::Load(int nChars, } const uint8_t* pTransform = pCIDFont->GetCIDTransform(CID); if (pTransform && !bVert) { - charpos.m_AdjustMatrix[0] = _CIDTransformToFloat(pTransform[0]); - charpos.m_AdjustMatrix[2] = _CIDTransformToFloat(pTransform[2]); - charpos.m_AdjustMatrix[1] = _CIDTransformToFloat(pTransform[1]); - charpos.m_AdjustMatrix[3] = _CIDTransformToFloat(pTransform[3]); - charpos.m_OriginX += _CIDTransformToFloat(pTransform[4]) * FontSize; - charpos.m_OriginY += _CIDTransformToFloat(pTransform[5]) * FontSize; + charpos.m_AdjustMatrix[0] = pCIDFont->CIDTransformToFloat(pTransform[0]); + charpos.m_AdjustMatrix[2] = pCIDFont->CIDTransformToFloat(pTransform[2]); + charpos.m_AdjustMatrix[1] = pCIDFont->CIDTransformToFloat(pTransform[1]); + charpos.m_AdjustMatrix[3] = pCIDFont->CIDTransformToFloat(pTransform[3]); + charpos.m_OriginX += + pCIDFont->CIDTransformToFloat(pTransform[4]) * FontSize; + charpos.m_OriginY += + pCIDFont->CIDTransformToFloat(pTransform[5]) * FontSize; charpos.m_bGlyphAdjust = TRUE; } } |