From 8940993efffaaf432320509555dc61122b8b72b2 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Mon, 28 Mar 2016 10:33:33 -0700 Subject: Reduce signed/unsigned comparison warnings The warnings generated by Clang. This is part 1 for some simple cases. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1840483003 . --- core/fpdfapi/fpdf_page/cpdf_colorspace.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/fpdfapi/fpdf_page/cpdf_colorspace.cpp') diff --git a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp index 3add21cfed..213d777ecb 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp @@ -467,7 +467,7 @@ void CPDF_ColorSpace::GetDefaultColor(FX_FLOAT* buf) const { return; } FX_FLOAT min, max; - for (int i = 0; i < m_nComponents; i++) { + for (uint32_t i = 0; i < m_nComponents; i++) { GetDefaultValue(i, buf[i], min, max); } } @@ -490,7 +490,7 @@ void CPDF_ColorSpace::TranslateImageLine(uint8_t* dest_buf, FX_FLOAT* src = srcbuf; FX_FLOAT R, G, B; for (int i = 0; i < pixels; i++) { - for (int j = 0; j < m_nComponents; j++) + for (uint32_t j = 0; j < m_nComponents; j++) if (m_Family == PDFCS_INDEXED) { src[j] = (FX_FLOAT)(*src_buf++); } else { @@ -842,7 +842,7 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) { } CPDF_Array* pRanges = pDict->GetArrayBy("Range"); m_pRanges = FX_Alloc2D(FX_FLOAT, m_nComponents, 2); - for (int i = 0; i < m_nComponents * 2; i++) { + for (uint32_t i = 0; i < m_nComponents * 2; i++) { if (pRanges) m_pRanges[i] = pRanges->GetNumberAt(i); else if (i % 2) @@ -918,7 +918,7 @@ void CPDF_ICCBasedCS::TranslateImageLine(uint8_t* pDestBuf, ReverseRGB(pDestBuf, pSrcBuf, pixels); } else if (m_pProfile->m_pTransform) { int nMaxColors = 1; - for (int i = 0; i < m_nComponents; i++) { + for (uint32_t i = 0; i < m_nComponents; i++) { nMaxColors *= 52; } if (m_nComponents > 3 || image_width * image_height < nMaxColors * 3 / 2) { @@ -932,7 +932,7 @@ void CPDF_ICCBasedCS::TranslateImageLine(uint8_t* pDestBuf, for (int i = 0; i < nMaxColors; i++) { uint32_t color = i; uint32_t order = nMaxColors / 52; - for (int c = 0; c < m_nComponents; c++) { + for (uint32_t c = 0; c < m_nComponents; c++) { *pSrc++ = (uint8_t)(color / order * 5); color %= order; order /= 52; @@ -944,7 +944,7 @@ void CPDF_ICCBasedCS::TranslateImageLine(uint8_t* pDestBuf, } for (int i = 0; i < pixels; i++) { int index = 0; - for (int c = 0; c < m_nComponents; c++) { + for (uint32_t c = 0; c < m_nComponents; c++) { index = index * 52 + (*pSrcBuf) / 5; pSrcBuf++; } -- cgit v1.2.3