diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
commit | bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (patch) | |
tree | 4cfbe682869d89900f33751c37f6a84865beeb0a /xfa/src/fxbarcode/common/BC_CommonBitArray.cpp | |
parent | b116136da234afcad018bb44a3ccb64b9ad2a554 (diff) | |
download | pdfium-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_CommonBitArray.cpp')
-rw-r--r-- | xfa/src/fxbarcode/common/BC_CommonBitArray.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp b/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp index 6263affbe8..a73fd37148 100644 --- a/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp +++ b/xfa/src/fxbarcode/common/BC_CommonBitArray.cpp @@ -32,7 +32,7 @@ CBC_CommonBitArray::CBC_CommonBitArray() m_bits.SetSize(1);
m_size = 0;
}
-CBC_CommonBitArray::CBC_CommonBitArray(FX_INT32 size)
+CBC_CommonBitArray::CBC_CommonBitArray(int32_t size)
{
m_bits.SetSize((size + 31) >> 5);
m_size = size;
@@ -41,7 +41,7 @@ CBC_CommonBitArray::~CBC_CommonBitArray() {
m_size = 0;
}
-FX_INT32 CBC_CommonBitArray::GetSize()
+int32_t CBC_CommonBitArray::GetSize()
{
return m_size;
}
@@ -49,31 +49,31 @@ CFX_Int32Array& CBC_CommonBitArray::GetBits() {
return m_bits;
}
-FX_INT32 CBC_CommonBitArray::GetSizeInBytes()
+int32_t CBC_CommonBitArray::GetSizeInBytes()
{
return (m_size + 7) >> 3;
}
-FX_BOOL CBC_CommonBitArray::Get(FX_INT32 i)
+FX_BOOL CBC_CommonBitArray::Get(int32_t i)
{
return (m_bits[i >> 5] & (1 << (i & 0x1f))) != 0;
}
-void CBC_CommonBitArray::Set(FX_INT32 i)
+void CBC_CommonBitArray::Set(int32_t i)
{
m_bits[i >> 5] |= 1 << (i & 0x1F);
}
-void CBC_CommonBitArray::Flip(FX_INT32 i)
+void CBC_CommonBitArray::Flip(int32_t i)
{
m_bits[i >> 5] ^= 1 << (i & 0x1F);
}
-void CBC_CommonBitArray::SetBulk(FX_INT32 i, FX_INT32 newBits)
+void CBC_CommonBitArray::SetBulk(int32_t i, int32_t newBits)
{
m_bits[i >> 5] = newBits;
}
void CBC_CommonBitArray::Clear()
{
- FXSYS_memset32(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(FX_INT32));
+ FXSYS_memset32(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(int32_t));
}
-FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e)
+FX_BOOL CBC_CommonBitArray::IsRange(int32_t start, int32_t end, FX_BOOL value, int32_t &e)
{
if (end < start) {
e = BCExceptionEndLessThanStart;
@@ -83,18 +83,18 @@ FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, return TRUE;
}
end--;
- FX_INT32 firstInt = start >> 5;
- FX_INT32 lastInt = end >> 5;
- FX_INT32 i;
+ int32_t firstInt = start >> 5;
+ int32_t lastInt = end >> 5;
+ int32_t i;
for (i = firstInt; i <= lastInt; i++) {
- FX_INT32 firstBit = i > firstInt ? 0 : start & 0x1F;
- FX_INT32 lastBit = i < lastInt ? 31 : end & 0x1F;
- FX_INT32 mask;
+ int32_t firstBit = i > firstInt ? 0 : start & 0x1F;
+ int32_t lastBit = i < lastInt ? 31 : end & 0x1F;
+ int32_t mask;
if (firstBit == 0 && lastBit == 31) {
mask = -1;
} else {
mask = 0;
- for (FX_INT32 j = firstBit; j <= lastBit; j++) {
+ for (int32_t j = firstBit; j <= lastBit; j++) {
mask |= 1 << j;
}
}
@@ -104,21 +104,21 @@ FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, }
return TRUE;
}
-FX_INT32* CBC_CommonBitArray::GetBitArray()
+int32_t* CBC_CommonBitArray::GetBitArray()
{
return &m_bits[0];
}
void CBC_CommonBitArray::Reverse()
{
- FX_INT32* newBits = FX_Alloc(FX_INT32, m_bits.GetSize());
- FXSYS_memset32(newBits, 0x00, m_bits.GetSize() * sizeof(FX_INT32));
- FX_INT32 size = m_size;
- FX_INT32 i;
+ int32_t* newBits = FX_Alloc(int32_t, m_bits.GetSize());
+ FXSYS_memset32(newBits, 0x00, m_bits.GetSize() * sizeof(int32_t));
+ int32_t size = m_size;
+ int32_t i;
for (i = 0; i < size; i++) {
if (Get(size - i - 1)) {
newBits[i >> 5] |= 1 << (i & 0x1F);
}
}
- FXSYS_memcpy32(&m_bits[0], newBits, m_bits.GetSize() * sizeof(FX_INT32));
+ FXSYS_memcpy32(&m_bits[0], newBits, m_bits.GetSize() * sizeof(int32_t));
FX_Free(newBits);
}
|