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

Unified Diff: xfa/src/fxbarcode/common/BC_CommonBitSource.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/src/fxbarcode/common/BC_CommonBitSource.h ('k') | xfa/src/fxbarcode/common/BC_CommonByteArray.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp b/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
index b71848a60c9cf0787bb09025739151fd8f244f1a..f32d634a5a11c1c3d041aea7c3adc96a1c36c5cd 100644
--- a/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
+++ b/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
@@ -31,18 +31,18 @@ CBC_CommonBitSource::CBC_CommonBitSource(CFX_ByteArray* bytes)
CBC_CommonBitSource::~CBC_CommonBitSource()
{
}
-FX_INT32 CBC_CommonBitSource::ReadBits(FX_INT32 numBits, FX_INT32 &e)
+int32_t CBC_CommonBitSource::ReadBits(int32_t numBits, int32_t &e)
{
if (numBits < 1 || numBits > 32) {
e = BCExceptionIllegalArgument;
return 0;
}
- FX_INT32 result = 0;
+ int32_t result = 0;
if (m_bitOffset > 0) {
- FX_INT32 bitsLeft = 8 - m_bitOffset;
- FX_INT32 toRead = numBits < bitsLeft ? numBits : bitsLeft;
- FX_INT32 bitsToNotRead = bitsLeft - toRead;
- FX_INT32 mask = (0xff >> (8 - toRead)) << bitsToNotRead;
+ int32_t bitsLeft = 8 - m_bitOffset;
+ int32_t toRead = numBits < bitsLeft ? numBits : bitsLeft;
+ int32_t bitsToNotRead = bitsLeft - toRead;
+ int32_t mask = (0xff >> (8 - toRead)) << bitsToNotRead;
result = (m_bytes[m_byteOffset] & mask) >> bitsToNotRead;
numBits -= toRead;
m_bitOffset += toRead;
@@ -58,19 +58,19 @@ FX_INT32 CBC_CommonBitSource::ReadBits(FX_INT32 numBits, FX_INT32 &e)
numBits -= 8;
}
if (numBits > 0) {
- FX_INT32 bitsToNotRead = 8 - numBits;
- FX_INT32 mask = (0xff >> bitsToNotRead) << bitsToNotRead;
+ int32_t bitsToNotRead = 8 - numBits;
+ int32_t mask = (0xff >> bitsToNotRead) << bitsToNotRead;
result = (result << numBits) | ((m_bytes[m_byteOffset] & mask) >> bitsToNotRead);
m_bitOffset += numBits;
}
}
return result;
}
-FX_INT32 CBC_CommonBitSource::Available()
+int32_t CBC_CommonBitSource::Available()
{
return 8 * (m_bytes.GetSize() - m_byteOffset) - m_bitOffset;
}
-FX_INT32 CBC_CommonBitSource::getByteOffset()
+int32_t CBC_CommonBitSource::getByteOffset()
{
return m_byteOffset;
}
« no previous file with comments | « xfa/src/fxbarcode/common/BC_CommonBitSource.h ('k') | xfa/src/fxbarcode/common/BC_CommonByteArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698