summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/fx_codec_flate.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/fxcodec/codec/fx_codec_flate.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/fxcodec/codec/fx_codec_flate.cpp')
-rw-r--r--core/fxcodec/codec/fx_codec_flate.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index 49a4f34166..27416f1c67 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -147,7 +147,7 @@ int CLZWDecoder::Decode(uint8_t* dest_buf,
m_Early = bEarlyChange ? 1 : 0;
m_nCodes = 0;
FX_DWORD old_code = (FX_DWORD)-1;
- uint8_t last_char;
+ uint8_t last_char = 0;
while (1) {
if (m_InPos + m_CodeLen > src_size * 8) {
break;
@@ -942,7 +942,7 @@ FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
offset = src_size;
int err = decoder->Decode(NULL, dest_size, src_buf, offset, bEarlyChange);
if (err || dest_size == 0 || dest_size + 1 < dest_size) {
- return -1;
+ return static_cast<FX_DWORD>(-1);
}
}
{
@@ -965,7 +965,7 @@ FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
ret =
TIFF_Predictor(dest_buf, dest_size, Colors, BitsPerComponent, Columns);
}
- return ret ? offset : -1;
+ return ret ? offset : static_cast<FX_DWORD>(-1);
}
FX_BOOL CCodec_FlateModule::Encode(const uint8_t* src_buf,
FX_DWORD src_size,