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

Side by Side Diff: core/fxcodec/jbig2/JBig2_BitStream.cpp

Issue 1821043003: Remove FX_WORD in favor of uint16_t. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Use stdint.h directly, bitfield minefield. Created 4 years, 9 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/fxcodec/jbig2/JBig2_BitStream.h ('k') | core/fxcodec/jbig2/JBig2_Context.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 2015 PDFium Authors. All rights reserved. 1 // Copyright 2015 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 "core/fxcodec/jbig2/JBig2_BitStream.h" 7 #include "core/fxcodec/jbig2/JBig2_BitStream.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 int32_t CJBig2_BitStream::readInteger(FX_DWORD* dwResult) { 94 int32_t CJBig2_BitStream::readInteger(FX_DWORD* dwResult) {
95 if (m_dwByteIdx + 3 >= m_dwLength) 95 if (m_dwByteIdx + 3 >= m_dwLength)
96 return -1; 96 return -1;
97 97
98 *dwResult = (m_pBuf[m_dwByteIdx] << 24) | (m_pBuf[m_dwByteIdx + 1] << 16) | 98 *dwResult = (m_pBuf[m_dwByteIdx] << 24) | (m_pBuf[m_dwByteIdx + 1] << 16) |
99 (m_pBuf[m_dwByteIdx + 2] << 8) | m_pBuf[m_dwByteIdx + 3]; 99 (m_pBuf[m_dwByteIdx + 2] << 8) | m_pBuf[m_dwByteIdx + 3];
100 m_dwByteIdx += 4; 100 m_dwByteIdx += 4;
101 return 0; 101 return 0;
102 } 102 }
103 103
104 int32_t CJBig2_BitStream::readShortInteger(FX_WORD* dwResult) { 104 int32_t CJBig2_BitStream::readShortInteger(uint16_t* dwResult) {
105 if (m_dwByteIdx + 1 >= m_dwLength) 105 if (m_dwByteIdx + 1 >= m_dwLength)
106 return -1; 106 return -1;
107 107
108 *dwResult = (m_pBuf[m_dwByteIdx] << 8) | m_pBuf[m_dwByteIdx + 1]; 108 *dwResult = (m_pBuf[m_dwByteIdx] << 8) | m_pBuf[m_dwByteIdx + 1];
109 m_dwByteIdx += 2; 109 m_dwByteIdx += 2;
110 return 0; 110 return 0;
111 } 111 }
112 112
113 void CJBig2_BitStream::alignByte() { 113 void CJBig2_BitStream::alignByte() {
114 if (m_dwBitIdx != 0) { 114 if (m_dwBitIdx != 0) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 return m_dwByteIdx < m_dwLength; 180 return m_dwByteIdx < m_dwLength;
181 } 181 }
182 182
183 FX_DWORD CJBig2_BitStream::LengthInBits() const { 183 FX_DWORD CJBig2_BitStream::LengthInBits() const {
184 return m_dwLength << 3; 184 return m_dwLength << 3;
185 } 185 }
186 186
187 FX_DWORD CJBig2_BitStream::getObjNum() const { 187 FX_DWORD CJBig2_BitStream::getObjNum() const {
188 return m_dwObjNum; 188 return m_dwObjNum;
189 } 189 }
OLDNEW
« no previous file with comments | « core/fxcodec/jbig2/JBig2_BitStream.h ('k') | core/fxcodec/jbig2/JBig2_Context.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698