summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-12 11:09:55 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-12 12:25:20 +0000
commitc24df3e0904cdf8aa289db435ad3e6dc8c25a437 (patch)
tree139c9a5d97660a8108f1734f6b186f9ffc5cd59d /sfx2
parent95f4ec094fdd0e06626ac4f7952309c18877c3e9 (diff)
sal_uIntPtr->sal_uInt32 for BitSet
because this ancient horror expects a 32bit type here Change-Id: Icf8b775ea67afa0ead559a55b8c335ad1afc4010
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/bitset.hxx4
-rw-r--r--sfx2/source/bastyp/bitset.cxx24
2 files changed, 14 insertions, 14 deletions
diff --git a/sfx2/inc/bitset.hxx b/sfx2/inc/bitset.hxx
index fdc17e14bb40..e8847462ef03 100644
--- a/sfx2/inc/bitset.hxx
+++ b/sfx2/inc/bitset.hxx
@@ -25,11 +25,11 @@ private:
void CopyFrom( const BitSet& rSet );
sal_uInt16 nBlocks;
sal_uInt16 nCount;
- sal_uIntPtr* pBitmap;
+ sal_uInt32* pBitmap;
public:
BitSet operator<<( sal_uInt16 nOffset ) const;
BitSet operator>>( sal_uInt16 nOffset ) const;
- static sal_uInt16 CountBits( sal_uIntPtr nBits );
+ static sal_uInt16 CountBits(sal_uInt32 nBits);
bool operator!() const;
BitSet();
BitSet( const BitSet& rOrig );
diff --git a/sfx2/source/bastyp/bitset.cxx b/sfx2/source/bastyp/bitset.cxx
index d8ded8b9c9e5..621e56599ce6 100644
--- a/sfx2/source/bastyp/bitset.cxx
+++ b/sfx2/source/bastyp/bitset.cxx
@@ -37,7 +37,7 @@ BitSet BitSet::operator<<( sal_uInt16 nOffset ) const
// compute the shiftment in long-words and bits
sal_uInt16 nBlockDiff = nOffset / 32;
- sal_uIntPtr nBitValDiff = nOffset % 32;
+ sal_uInt32 nBitValDiff = nOffset % 32;
// compute the new number of bits
for ( sal_uInt16 nBlock = 0; nBlock < nBlockDiff; ++nBlock )
@@ -64,7 +64,7 @@ BitSet BitSet::operator<<( sal_uInt16 nOffset ) const
// shorten the block-array
if ( nTarget < aSet.nBlocks )
{
- sal_uIntPtr* pNewMap = new sal_uIntPtr[nTarget];
+ sal_uInt32* pNewMap = new sal_uInt32[nTarget];
memcpy( pNewMap, aSet.pBitmap, 4 * nTarget );
delete [] aSet.pBitmap;
aSet.pBitmap = pNewMap;
@@ -93,7 +93,7 @@ void BitSet::CopyFrom( const BitSet& rSet )
nBlocks = rSet.nBlocks;
if ( rSet.nBlocks )
{
- pBitmap = new sal_uIntPtr[nBlocks];
+ pBitmap = new sal_uInt32[nBlocks];
memcpy( pBitmap, rSet.pBitmap, 4 * nBlocks );
}
else
@@ -152,10 +152,10 @@ BitSet& BitSet::operator=( sal_uInt16 nBit )
delete [] pBitmap;
nBlocks = nBit / 32;
- sal_uIntPtr nBitVal = 1L << (nBit % 32);
+ sal_uInt32 nBitVal = 1L << (nBit % 32);
nCount = 1;
- pBitmap = new sal_uIntPtr[nBlocks + 1];
+ pBitmap = new sal_uInt32[nBlocks + 1];
memset( pBitmap, 0, 4 * (nBlocks + 1) );
*(pBitmap+nBlocks) = nBitVal;
@@ -170,7 +170,7 @@ BitSet& BitSet::operator=( sal_uInt16 nBit )
BitSet& BitSet::operator-=(sal_uInt16 nBit)
{
sal_uInt16 nBlock = nBit / 32;
- sal_uIntPtr nBitVal = 1L << (nBit % 32);
+ sal_uInt32 nBitVal = 1L << (nBit % 32);
if ( nBlock >= nBlocks )
return *this;
@@ -195,7 +195,7 @@ BitSet& BitSet::operator|=( const BitSet& rSet )
// expand the bitmap
if ( nBlocks < rSet.nBlocks )
{
- sal_uIntPtr *pNewMap = new sal_uIntPtr[rSet.nBlocks];
+ sal_uInt32 *pNewMap = new sal_uInt32[rSet.nBlocks];
memset( pNewMap + nBlocks, 0, 4 * (rSet.nBlocks - nBlocks) );
if ( pBitmap )
@@ -211,7 +211,7 @@ BitSet& BitSet::operator|=( const BitSet& rSet )
for ( sal_uInt16 nBlock = 0; nBlock < nMax; ++nBlock )
{
// compute numberof additional bits
- sal_uIntPtr nDiff = ~*(pBitmap+nBlock) & *(rSet.pBitmap+nBlock);
+ sal_uInt32 nDiff = ~*(pBitmap+nBlock) & *(rSet.pBitmap+nBlock);
nCount = nCount + CountBits(nDiff);
*(pBitmap+nBlock) |= *(rSet.pBitmap+nBlock);
@@ -227,11 +227,11 @@ BitSet& BitSet::operator|=( const BitSet& rSet )
BitSet& BitSet::operator|=( sal_uInt16 nBit )
{
sal_uInt16 nBlock = nBit / 32;
- sal_uIntPtr nBitVal = 1L << (nBit % 32);
+ sal_uInt32 nBitVal = 1L << (nBit % 32);
if ( nBlock >= nBlocks )
{
- sal_uIntPtr *pNewMap = new sal_uIntPtr[nBlock+1];
+ sal_uInt32 *pNewMap = new sal_uInt32[nBlock+1];
memset( pNewMap + nBlocks, 0, 4 * (nBlock - nBlocks + 1) );
if ( pBitmap )
@@ -259,7 +259,7 @@ BitSet& BitSet::operator|=( sal_uInt16 nBit )
bool BitSet::Contains( sal_uInt16 nBit ) const
{
sal_uInt16 nBlock = nBit / 32;
- sal_uIntPtr nBitVal = 1L << (nBit % 32);
+ sal_uInt32 nBitVal = 1L << (nBit % 32);
if ( nBlock >= nBlocks )
return false;
@@ -287,7 +287,7 @@ bool BitSet::operator==( const BitSet& rSet ) const
// counts the number of 1-bits in the parameter
-sal_uInt16 BitSet::CountBits( sal_uIntPtr nBits )
+sal_uInt16 BitSet::CountBits( sal_uInt32 nBits )
{
sal_uInt16 nCount = 0;
int nBit = 32;