summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-28 10:33:33 -0700
committerWei Li <weili@chromium.org>2016-03-28 10:33:33 -0700
commit8940993efffaaf432320509555dc61122b8b72b2 (patch)
tree2e9c42a78d96061ae06ee052e8a274ccfb8fcec7 /core/fpdfapi/fpdf_page/cpdf_colorspace.cpp
parentb5e8f14e3eefc5da995b332788d3203cee204883 (diff)
downloadpdfium-8940993efffaaf432320509555dc61122b8b72b2.tar.xz
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 .
Diffstat (limited to 'core/fpdfapi/fpdf_page/cpdf_colorspace.cpp')
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_colorspace.cpp12
1 files changed, 6 insertions, 6 deletions
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++;
}