diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 11:34:44 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 11:34:44 -0700 |
commit | 065e9321b84fc0490f3da9099e8840c65e06868d (patch) | |
tree | 3b0bb772a59669f06b86824a444fd06642592d4b /core/src/fxcodec | |
parent | 3c012fef2bb72c8ec1faa73e11ee35539b2559d6 (diff) | |
download | pdfium-065e9321b84fc0490f3da9099e8840c65e06868d.tar.xz |
Fix FX_BOOL type mismatches.
Extracted from https://codereview.chromium.org/1252613002/
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1253603002 .
Diffstat (limited to 'core/src/fxcodec')
-rw-r--r-- | core/src/fxcodec/codec/codec_int.h | 2 | ||||
-rw-r--r-- | core/src/fxcodec/codec/fx_codec_flate.cpp | 8 | ||||
-rw-r--r-- | core/src/fxcodec/codec/fx_codec_jpeg.cpp | 4 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_Context.cpp | 22 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp | 2 | ||||
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp | 7 |
6 files changed, 27 insertions, 18 deletions
diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h index 4c7eba08b3..7668f84a20 100644 --- a/core/src/fxcodec/codec/codec_int.h +++ b/core/src/fxcodec/codec/codec_int.h @@ -152,7 +152,7 @@ public: virtual void Finish(void* pContext); virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size); virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps); - virtual FX_BOOL StartScanline(void* pContext, int down_scale); + virtual int StartScanline(void* pContext, int down_scale); virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf); virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr); protected: diff --git a/core/src/fxcodec/codec/fx_codec_flate.cpp b/core/src/fxcodec/codec/fx_codec_flate.cpp index 6223b9c670..d129e36392 100644 --- a/core/src/fxcodec/codec/fx_codec_flate.cpp +++ b/core/src/fxcodec/codec/fx_codec_flate.cpp @@ -84,19 +84,21 @@ extern "C" class CLZWDecoder { public: - FX_BOOL Decode(uint8_t* output, FX_DWORD& outlen, const uint8_t* input, FX_DWORD& size, FX_BOOL bEarlyChange); + int Decode(uint8_t* output, FX_DWORD& outlen, const uint8_t* input, FX_DWORD& size, FX_BOOL bEarlyChange); + private: + void AddCode(FX_DWORD prefix_code, uint8_t append_char); + void DecodeString(FX_DWORD code); + FX_DWORD m_InPos; FX_DWORD m_OutPos; uint8_t* m_pOutput; const uint8_t* m_pInput; FX_BOOL m_Early; - void AddCode(FX_DWORD prefix_code, uint8_t append_char); FX_DWORD m_CodeArray[5021]; FX_DWORD m_nCodes; uint8_t m_DecodeStack[4000]; FX_DWORD m_StackLen; - void DecodeString(FX_DWORD code); int m_CodeLen; }; void CLZWDecoder::AddCode(FX_DWORD prefix_code, uint8_t append_char) diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp index b7d9fbe512..6839d31509 100644 --- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp @@ -641,14 +641,14 @@ int CCodec_JpegModule::ReadHeader(void* pContext, int* width, int* height, int* *nComps = p->m_Info.num_components; return 0; } -FX_BOOL CCodec_JpegModule::StartScanline(void* pContext, int down_scale) +int CCodec_JpegModule::StartScanline(void* pContext, int down_scale) { if (m_pExtProvider) { return m_pExtProvider->StartScanline(pContext, down_scale); } FXJPEG_Context* p = (FXJPEG_Context*)pContext; if (setjmp(p->m_JumpMark) == -1) { - return FALSE; + return 0; } p->m_Info.scale_denom = down_scale; return jpeg_start_decompress(&p->m_Info); diff --git a/core/src/fxcodec/jbig2/JBig2_Context.cpp b/core/src/fxcodec/jbig2/JBig2_Context.cpp index ed26ec6833..68c973547c 100644 --- a/core/src/fxcodec/jbig2/JBig2_Context.cpp +++ b/core/src/fxcodec/jbig2/JBig2_Context.cpp @@ -873,7 +873,7 @@ failed: return nRet; } -FX_BOOL CJBig2_Context::parseTextRegion(CJBig2_Segment *pSegment) +int32_t CJBig2_Context::parseTextRegion(CJBig2_Segment *pSegment) { FX_DWORD dwTemp; FX_WORD wFlags; @@ -1239,7 +1239,7 @@ failed: return nRet; } -FX_BOOL CJBig2_Context::parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause) +int32_t CJBig2_Context::parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause) { FX_DWORD dwTemp; uint8_t cFlags; @@ -1293,7 +1293,7 @@ failed: delete pPDD; return nRet; } -FX_BOOL CJBig2_Context::parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) +int32_t CJBig2_Context::parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) { FX_DWORD dwTemp; uint8_t cFlags; @@ -1387,7 +1387,7 @@ failed: return nRet; } -FX_BOOL CJBig2_Context::parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) +int32_t CJBig2_Context::parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause) { FX_DWORD dwTemp; uint8_t cFlags; @@ -1504,7 +1504,7 @@ failed: return nRet; } -FX_BOOL CJBig2_Context::parseGenericRefinementRegion(CJBig2_Segment *pSegment) +int32_t CJBig2_Context::parseGenericRefinementRegion(CJBig2_Segment *pSegment) { FX_DWORD dwTemp; JBig2RegionInfo ri; @@ -1591,7 +1591,7 @@ failed: delete pGRRD; return nRet; } -FX_BOOL CJBig2_Context::parseTable(CJBig2_Segment *pSegment) +int32_t CJBig2_Context::parseTable(CJBig2_Segment *pSegment) { pSegment->m_nResultType = JBIG2_HUFFMAN_TABLE_POINTER; JBIG2_ALLOC(pSegment->m_Result.ht, CJBig2_HuffmanTable(m_pStream)); @@ -1618,9 +1618,15 @@ JBig2HuffmanCode *CJBig2_Context::decodeSymbolIDHuffmanTable(CJBig2_BitStream *p FX_DWORD SBNUMSYMS) { JBig2HuffmanCode *SBSYMCODES; - int32_t runcodes[35], runcodes_len[35], runcode; - int32_t i, j, nTemp, nVal, nBits; + int32_t runcodes[35]; + int32_t runcodes_len[35]; + int32_t runcode; + int32_t i; + int32_t j; + int32_t nVal; + int32_t nBits; int32_t run; + FX_DWORD nTemp; SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(sizeof(JBig2HuffmanCode), SBNUMSYMS); for (i = 0; i < 35; i ++) { if(pStream->readNBits(4, &runcodes_len[i]) != 0) { diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp index 622f04b160..cabcd4c634 100644 --- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp +++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp @@ -2101,7 +2101,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J CJBig2_Image *IBI; FX_DWORD WI, HI; int32_t IDS; - FX_BOOL RI; + int RI; int32_t RDWI, RDHI, RDXI, RDYI; CJBig2_Image *IBOI; FX_DWORD WOI, HOI; diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp index dd820ae4ca..ef84547992 100644 --- a/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp +++ b/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp @@ -14,9 +14,10 @@ CJBig2_HuffmanDecoder::~CJBig2_HuffmanDecoder() } int CJBig2_HuffmanDecoder::decodeAValue(CJBig2_HuffmanTable *pTable, int *nResult) { - int nVal, nTmp, i, nBits; - nVal = 0; - nBits = 0; + int i; + int nVal = 0; + int nBits = 0; + FX_DWORD nTmp; while(1) { if(m_pStream->read1Bit(&nTmp) == -1) { return -1; |