summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-29 16:42:53 -0700
committerWei Li <weili@chromium.org>2016-03-29 16:42:53 -0700
commit05d53f0355e9889c43bfa436e985d5643f249d99 (patch)
treeeca037b407114efe357e8280a96e44eee182cdfc /core/fpdfapi/fpdf_render
parent602aebc11a615971800d38f8d427a4e4f95c1134 (diff)
downloadpdfium-05d53f0355e9889c43bfa436e985d5643f249d99.tar.xz
Code change to avoid signed/unsigned mismatch warnings.
This makes pdfium code on Linux and Mac sign-compare warning free. The warning flag will be re-enabled after checking on windows clang build. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1841643002 .
Diffstat (limited to 'core/fpdfapi/fpdf_render')
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 9c1fa36b28..d3081da26f 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -58,15 +58,13 @@ static void DrawAxialShading(CFX_DIBitmap* pBitmap,
FX_FLOAT axis_len_square = (x_span * x_span) + (y_span * y_span);
CFX_Matrix matrix;
matrix.SetReverse(*pObject2Bitmap);
- int total_results = 0;
+ uint32_t total_results = 0;
for (int j = 0; j < nFuncs; j++) {
- if (pFuncs[j]) {
+ if (pFuncs[j])
total_results += pFuncs[j]->CountOutputs();
- }
}
- if (pCS->CountComponents() > total_results) {
+ if (pCS->CountComponents() > total_results)
total_results = pCS->CountComponents();
- }
CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
FX_FLOAT* pResults = result_array;
FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT));
@@ -144,7 +142,7 @@ static void DrawRadialShading(CFX_DIBitmap* pBitmap,
bStartExtend = pArray->GetIntegerAt(0);
bEndExtend = pArray->GetIntegerAt(1);
}
- int total_results = 0;
+ uint32_t total_results = 0;
for (int j = 0; j < nFuncs; j++) {
if (pFuncs[j]) {
total_results += pFuncs[j]->CountOutputs();
@@ -273,15 +271,13 @@ static void DrawFuncShading(CFX_DIBitmap* pBitmap,
int width = pBitmap->GetWidth();
int height = pBitmap->GetHeight();
int pitch = pBitmap->GetPitch();
- int total_results = 0;
+ uint32_t total_results = 0;
for (int j = 0; j < nFuncs; j++) {
- if (pFuncs[j]) {
+ if (pFuncs[j])
total_results += pFuncs[j]->CountOutputs();
- }
}
- if (pCS->CountComponents() > total_results) {
+ if (pCS->CountComponents() > total_results)
total_results = pCS->CountComponents();
- }
CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
FX_FLOAT* pResults = result_array;
FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT));
@@ -845,9 +841,8 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
if (pBackColor &&
pBackColor->GetCount() >= pColorSpace->CountComponents()) {
CFX_FixedBufGrow<FX_FLOAT, 16> comps(pColorSpace->CountComponents());
- for (int i = 0; i < pColorSpace->CountComponents(); i++) {
+ for (uint32_t i = 0; i < pColorSpace->CountComponents(); i++)
comps[i] = pBackColor->GetNumberAt(i);
- }
FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f;
pColorSpace->GetRGB(comps, R, G, B);
background = ArgbEncode(255, (int32_t)(R * 255), (int32_t)(G * 255),