From 8940993efffaaf432320509555dc61122b8b72b2 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Mon, 28 Mar 2016 10:33:33 -0700 Subject: 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 . --- core/fxcodec/codec/fx_codec_flate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/fxcodec/codec/fx_codec_flate.cpp') diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp index e69c017ee7..6961dcccb3 100644 --- a/core/fxcodec/codec/fx_codec_flate.cpp +++ b/core/fxcodec/codec/fx_codec_flate.cpp @@ -9,6 +9,7 @@ #include #include +#include "core/fxcrt/include/fx_ext.h" #include "core/include/fxcodec/fx_codec.h" #include "core/include/fxcodec/fx_codec_flate.h" #include "third_party/zlib_v128/zlib.h" @@ -942,7 +943,7 @@ uint32_t 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 static_cast(-1); + return FX_INVALID_OFFSET; } } { @@ -965,7 +966,7 @@ uint32_t CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW, ret = TIFF_Predictor(dest_buf, dest_size, Colors, BitsPerComponent, Columns); } - return ret ? offset : static_cast(-1); + return ret ? offset : FX_INVALID_OFFSET; } FX_BOOL CCodec_FlateModule::Encode(const uint8_t* src_buf, uint32_t src_size, -- cgit v1.2.3