Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3295)

Unified Diff: core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp

Issue 1841643002: Code change to avoid signed/unsigned mismatch warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cpdf_object.h ('k') | core/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 9c1fa36b28425c27a5475577f65ad452fcca3ad2..d3081da26fc2802759945de00a8c2a187893f2d9 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),
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cpdf_object.h ('k') | core/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698