summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-08 15:51:29 -0700
committerLei Zhang <thestig@chromium.org>2015-10-08 15:51:29 -0700
commitd03ba8d1a5928e8f3f6bd7da063b53b0bc40abfd (patch)
tree7736bff04e9169378df7c21bcb24af043ea70b29 /core/src/fxcodec/codec
parent06f255ca4040f3d73cf09f1dbd63a3b167f6a4c1 (diff)
downloadpdfium-d03ba8d1a5928e8f3f6bd7da063b53b0bc40abfd.tar.xz
Fix a bunch of sign mismatch warnings.
Also remove some gotos and move code into an anonymous namespace. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1356373003 .
Diffstat (limited to 'core/src/fxcodec/codec')
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpeg.cpp4
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpx_opj.cpp10
2 files changed, 7 insertions, 7 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
index efd83f88ae..4fdbb8ed29 100644
--- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
@@ -193,7 +193,7 @@ static void _JpegEncode(const CFX_DIBSource* pSource,
if (nComponents > 1) {
uint8_t* dest_scan = line_buf;
if (nComponents == 3) {
- for (int i = 0; i < width; i++) {
+ for (FX_DWORD i = 0; i < width; i++) {
dest_scan[0] = src_scan[2];
dest_scan[1] = src_scan[1];
dest_scan[2] = src_scan[0];
@@ -201,7 +201,7 @@ static void _JpegEncode(const CFX_DIBSource* pSource,
src_scan += Bpp;
}
} else {
- for (int i = 0; i < pitch; i++) {
+ for (FX_DWORD i = 0; i < pitch; i++) {
*dest_scan++ = ~*src_scan++;
}
}
diff --git a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
index fdffcb66de..76d62f763b 100644
--- a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -616,7 +616,7 @@ class CJPX_Decoder {
public:
explicit CJPX_Decoder(bool use_colorspace);
~CJPX_Decoder();
- FX_BOOL Init(const unsigned char* src_data, int src_size);
+ FX_BOOL Init(const unsigned char* src_data, FX_DWORD src_size);
void GetInfo(FX_DWORD* width, FX_DWORD* height, FX_DWORD* components);
bool Decode(uint8_t* dest_buf,
int pitch,
@@ -624,7 +624,7 @@ class CJPX_Decoder {
private:
const uint8_t* m_SrcData;
- int m_SrcSize;
+ FX_DWORD m_SrcSize;
opj_image_t* image;
opj_codec_t* l_codec;
opj_stream_t* l_stream;
@@ -650,12 +650,12 @@ CJPX_Decoder::~CJPX_Decoder() {
}
}
-FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, int src_size) {
+FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, FX_DWORD src_size) {
static const unsigned char szJP2Header[] = {
0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a};
- if (!src_data || src_size < sizeof(szJP2Header)) {
+ if (!src_data || src_size < sizeof(szJP2Header))
return FALSE;
- }
+
image = NULL;
m_SrcData = src_data;
m_SrcSize = src_size;