summaryrefslogtreecommitdiff
path: root/core/fxge/dib/fx_dib_main.cpp
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-21 11:20:44 -0700
committerWei Li <weili@chromium.org>2016-03-21 11:20:44 -0700
commitd4e8f1222ca17b57ac74019b2fc3706e1192645c (patch)
tree0dd5e1627fd684205631f875cbf5946178177766 /core/fxge/dib/fx_dib_main.cpp
parent34fa8d90ae2f60fae219e4dbeff14c053d2e8eef (diff)
downloadpdfium-d4e8f1222ca17b57ac74019b2fc3706e1192645c.tar.xz
Re-enable several MSVC warnings
Re-enable the following warnings: 4245: signed/unsigned conversion mismatch; 4310: cast may truncate data; 4389: operator on signed/unsigned mismatch; 4701: use potentially uninitialized local variable; 4706: assignment within conditional expression Clean up the code to avoid those warnings. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1801383002 .
Diffstat (limited to 'core/fxge/dib/fx_dib_main.cpp')
-rw-r--r--core/fxge/dib/fx_dib_main.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp
index 8ce20568df..a7f7dc75bc 100644
--- a/core/fxge/dib/fx_dib_main.cpp
+++ b/core/fxge/dib/fx_dib_main.cpp
@@ -1234,14 +1234,31 @@ void CFX_DIBitmap::DownSampleScanline(int line,
}
}
}
+
+// TODO(weili): Split this function into two for handling CMYK and RGB
+// colors separately.
FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor,
FX_DWORD backcolor) {
ASSERT(!IsAlphaMask());
if (!m_pBuffer || IsAlphaMask()) {
return FALSE;
}
- int fc, fm, fy, fk, bc, bm, by, bk;
- int fr, fg, fb, br, bg, bb;
+ // Values used for CMYK colors.
+ int fc = 0;
+ int fm = 0;
+ int fy = 0;
+ int fk = 0;
+ int bc = 0;
+ int bm = 0;
+ int by = 0;
+ int bk = 0;
+ // Values used for RGB colors.
+ int fr = 0;
+ int fg = 0;
+ int fb = 0;
+ int br = 0;
+ int bg = 0;
+ int bb = 0;
FX_BOOL isCmykImage = IsCmykImage();
if (isCmykImage) {
fc = FXSYS_GetCValue(forecolor);