Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp

Issue 1253603002: Fix FX_BOOL type mismatches. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Public API Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp ('k') | core/src/fxcrt/fx_basic_gcc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "JBig2_HuffmanDecoder.h" 7 #include "JBig2_HuffmanDecoder.h"
8 CJBig2_HuffmanDecoder::CJBig2_HuffmanDecoder(CJBig2_BitStream *pStream) 8 CJBig2_HuffmanDecoder::CJBig2_HuffmanDecoder(CJBig2_BitStream *pStream)
9 { 9 {
10 m_pStream = pStream; 10 m_pStream = pStream;
11 } 11 }
12 CJBig2_HuffmanDecoder::~CJBig2_HuffmanDecoder() 12 CJBig2_HuffmanDecoder::~CJBig2_HuffmanDecoder()
13 { 13 {
14 } 14 }
15 int CJBig2_HuffmanDecoder::decodeAValue(CJBig2_HuffmanTable *pTable, int *nResul t) 15 int CJBig2_HuffmanDecoder::decodeAValue(CJBig2_HuffmanTable *pTable, int *nResul t)
16 { 16 {
17 int nVal, nTmp, i, nBits; 17 int i;
18 nVal = 0; 18 int nVal = 0;
19 nBits = 0; 19 int nBits = 0;
20 FX_DWORD nTmp;
20 while(1) { 21 while(1) {
21 if(m_pStream->read1Bit(&nTmp) == -1) { 22 if(m_pStream->read1Bit(&nTmp) == -1) {
22 return -1; 23 return -1;
23 } 24 }
24 nVal = (nVal << 1) | nTmp; 25 nVal = (nVal << 1) | nTmp;
25 nBits ++; 26 nBits ++;
26 for(i = 0; i < pTable->NTEMP; i++) { 27 for(i = 0; i < pTable->NTEMP; i++) {
27 if((pTable->PREFLEN[i] == nBits) && (pTable->CODES[i] == nVal)) { 28 if((pTable->PREFLEN[i] == nBits) && (pTable->CODES[i] == nVal)) {
28 if((pTable->HTOOB == 1) && (i == pTable->NTEMP - 1)) { 29 if((pTable->HTOOB == 1) && (i == pTable->NTEMP - 1)) {
29 return JBIG2_OOB; 30 return JBIG2_OOB;
(...skipping 16 matching lines...) Expand all
46 } else { 47 } else {
47 *nResult = pTable->RANGELOW[i] + nTmp; 48 *nResult = pTable->RANGELOW[i] + nTmp;
48 return 0; 49 return 0;
49 } 50 }
50 } 51 }
51 } 52 }
52 } 53 }
53 } 54 }
54 return -2; 55 return -2;
55 } 56 }
OLDNEW
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp ('k') | core/src/fxcrt/fx_basic_gcc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698