summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-09 13:24:12 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-09 13:24:12 -0700
commitbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (patch)
tree4cfbe682869d89900f33751c37f6a84865beeb0a /xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
parentb116136da234afcad018bb44a3ccb64b9ad2a554 (diff)
downloadpdfium-bfa9a824a20f37c2dd7111012b46c929cf2ed8a0.tar.xz
Merge to XFA: Use stdint.h types throughout PDFium.
Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002
Diffstat (limited to 'xfa/src/fxbarcode/common/BC_CommonBitSource.cpp')
-rw-r--r--xfa/src/fxbarcode/common/BC_CommonBitSource.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp b/xfa/src/fxbarcode/common/BC_CommonBitSource.cpp
index b71848a60c..f32d634a5a 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;
}