Chromium Code Reviews| Index: core/fxcodec/jbig2/JBig2_TrdProc.cpp |
| diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp |
| index 401249e3f2e6bfcd5aa0d8874affee94243231c2..f44f96e8fbe55a9289cd5b0a800e96aed6b5d564 100644 |
| --- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp |
| +++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp |
| @@ -15,20 +15,15 @@ |
| CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream, |
| JBig2ArithCtx* grContext) { |
| - int32_t STRIPT, FIRSTS; |
| - FX_DWORD NINSTANCES; |
| - int32_t DT, DFS, CURS; |
| - int32_t SI, TI; |
| - CJBig2_Image* IBI; |
| - FX_DWORD WI, HI; |
| - int32_t IDS; |
| - FX_BOOL RI; |
| - int32_t RDWI, RDHI, RDXI, RDYI; |
| - CJBig2_Image* IBOI; |
| - FX_DWORD WOI, HOI; |
| - FX_BOOL bFirst; |
| - FX_DWORD nTmp; |
| - int32_t nVal, nBits; |
| + int32_t STRIPT = 0; |
| + int32_t DT = 0, DFS = 0; |
| + int32_t CURS = 0; |
| + CJBig2_Image* IBI = nullptr; |
| + int32_t IDS = 0; |
| + FX_BOOL RI = 0; |
| + int32_t RDWI = 0, RDHI = 0, RDXI = 0, RDYI = 0; |
|
dsinclair
2016/03/16 13:23:32
ditto
Wei Li
2016/03/16 17:51:31
Done.
|
| + FX_DWORD nTmp = 0; |
| + int32_t nVal = 0, nBits = 0; |
|
Tom Sepez
2016/03/16 18:34:59
These are probably OK since the compiler can't pro
Wei Li
2016/03/17 02:24:05
Very good idea. :)
|
| std::unique_ptr<CJBig2_HuffmanDecoder> pHuffmanDecoder( |
| new CJBig2_HuffmanDecoder(pStream)); |
| std::unique_ptr<CJBig2_Image> SBREG(new CJBig2_Image(SBW, SBH)); |
| @@ -38,15 +33,15 @@ CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream, |
| STRIPT *= SBSTRIPS; |
| STRIPT = -STRIPT; |
| - FIRSTS = 0; |
| - NINSTANCES = 0; |
| + int32_t FIRSTS = 0; |
| + FX_DWORD NINSTANCES = 0; |
| while (NINSTANCES < SBNUMINSTANCES) { |
| if (pHuffmanDecoder->decodeAValue(SBHUFFDT, &DT) != 0) |
| return nullptr; |
| DT *= SBSTRIPS; |
| STRIPT = STRIPT + DT; |
| - bFirst = TRUE; |
| + FX_BOOL bFirst = TRUE; |
|
dsinclair
2016/03/16 13:23:32
nit: bool
Wei Li
2016/03/16 17:51:31
Done.
|
| for (;;) { |
| if (bFirst) { |
| if (pHuffmanDecoder->decodeAValue(SBHUFFFS, &DFS) != 0) |
| @@ -76,7 +71,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream, |
| CURT = nVal; |
| } |
| - TI = STRIPT + CURT; |
| + int32_t TI = STRIPT + CURT; |
| nVal = 0; |
| nBits = 0; |
| FX_DWORD IDI; |
| @@ -115,12 +110,12 @@ CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream, |
| } |
| pStream->alignByte(); |
| nTmp = pStream->getOffset(); |
| - IBOI = SBSYMS[IDI]; |
| + CJBig2_Image* IBOI = SBSYMS[IDI]; |
| if (!IBOI) |
| return nullptr; |
| - WOI = IBOI->m_nWidth; |
| - HOI = IBOI->m_nHeight; |
| + FX_DWORD WOI = IBOI->m_nWidth; |
| + FX_DWORD HOI = IBOI->m_nHeight; |
| if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0) |
| return nullptr; |
| @@ -155,8 +150,8 @@ CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream, |
| if (!IBI) { |
| continue; |
| } |
| - WI = IBI->m_nWidth; |
| - HI = IBI->m_nHeight; |
| + FX_DWORD WI = IBI->m_nWidth; |
| + FX_DWORD HI = IBI->m_nHeight; |
| if (TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPRIGHT) || |
| (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) { |
| CURS = CURS + WI - 1; |
| @@ -164,7 +159,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream, |
| (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) { |
| CURS = CURS + HI - 1; |
| } |
| - SI = CURS; |
| + int32_t SI = CURS; |
| if (TRANSPOSED == 0) { |
| switch (REFCORNER) { |
| case JBIG2_CORNER_TOPLEFT: |
| @@ -277,7 +272,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, |
| int32_t FIRSTS = 0; |
| FX_DWORD NINSTANCES = 0; |
| while (NINSTANCES < SBNUMINSTANCES) { |
| - int32_t CURS; |
| + int32_t CURS = 0; |
| int32_t DT; |
| pIADT->decode(pArithDecoder, &DT); |
| DT *= SBSTRIPS; |