diff options
Diffstat (limited to 'tools/source/memtools/contnr.cxx')
-rw-r--r-- | tools/source/memtools/contnr.cxx | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/tools/source/memtools/contnr.cxx b/tools/source/memtools/contnr.cxx index 4a4ee47886ee..63dc74e37441 100644 --- a/tools/source/memtools/contnr.cxx +++ b/tools/source/memtools/contnr.cxx @@ -84,7 +84,7 @@ const char* CBlock::DbgCheckCBlock( const void* pBlock ) |* *************************************************************************/ -CBlock::CBlock( USHORT nInitSize, CBlock* _pPrev, CBlock* _pNext ) +CBlock::CBlock( sal_uInt16 nInitSize, CBlock* _pPrev, CBlock* _pNext ) { DBG_CTOR( CBlock, DbgCheckCBlock ); @@ -107,7 +107,7 @@ CBlock::CBlock( USHORT nInitSize, CBlock* _pPrev, CBlock* _pNext ) |* *************************************************************************/ -CBlock::CBlock( USHORT _nSize, CBlock* _pPrev ) +CBlock::CBlock( sal_uInt16 _nSize, CBlock* _pPrev ) { DBG_CTOR( CBlock, DbgCheckCBlock ); DBG_ASSERT( _nSize, "CBlock::CBlock(): nSize == 0" ); @@ -175,7 +175,7 @@ inline CBlock::~CBlock() |* *************************************************************************/ -void CBlock::Insert( void* p, USHORT nIndex, USHORT nReSize ) +void CBlock::Insert( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize ) { DBG_CHKTHIS( CBlock, DbgCheckCBlock ); DBG_ASSERT( nIndex <= nCount, "CBlock::Insert(): Index > nCount" ); @@ -231,12 +231,12 @@ void CBlock::Insert( void* p, USHORT nIndex, USHORT nReSize ) |* *************************************************************************/ -CBlock* CBlock::Split( void* p, USHORT nIndex, USHORT nReSize ) +CBlock* CBlock::Split( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize ) { DBG_CHKTHIS( CBlock, DbgCheckCBlock ); - USHORT nNewSize; - USHORT nMiddle; + sal_uInt16 nNewSize; + sal_uInt16 nMiddle; CBlock* pNewBlock; nMiddle = nCount/2; @@ -368,7 +368,7 @@ CBlock* CBlock::Split( void* p, USHORT nIndex, USHORT nReSize ) |* *************************************************************************/ -void* CBlock::Remove( USHORT nIndex, USHORT nReSize ) +void* CBlock::Remove( sal_uInt16 nIndex, sal_uInt16 nReSize ) { DBG_CHKTHIS( CBlock, DbgCheckCBlock ); @@ -427,7 +427,7 @@ void* CBlock::Remove( USHORT nIndex, USHORT nReSize ) |* *************************************************************************/ -inline void* CBlock::Replace( void* p, USHORT nIndex ) +inline void* CBlock::Replace( void* p, sal_uInt16 nIndex ) { DBG_CHKTHIS( CBlock, DbgCheckCBlock ); @@ -448,7 +448,7 @@ inline void* CBlock::Replace( void* p, USHORT nIndex ) |* *************************************************************************/ -inline void** CBlock::GetObjectPtr( USHORT nIndex ) +inline void** CBlock::GetObjectPtr( sal_uInt16 nIndex ) { DBG_CHKTHIS( CBlock, DbgCheckCBlock ); @@ -465,7 +465,7 @@ inline void** CBlock::GetObjectPtr( USHORT nIndex ) |* *************************************************************************/ -void CBlock::SetSize( USHORT nNewSize ) +void CBlock::SetSize( sal_uInt16 nNewSize ) { DBG_CHKTHIS( CBlock, DbgCheckCBlock ); DBG_ASSERT( nNewSize, "CBlock::SetSize(): nNewSize == 0" ); @@ -589,7 +589,7 @@ void Container::ImpCopyContainer( const Container* pCont2 ) |* *************************************************************************/ -Container::Container( USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize ) +Container::Container( sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) { DBG_CTOR( Container, DbgCheckContainer ); @@ -654,7 +654,7 @@ Container::Container( USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize ) |* *************************************************************************/ -Container::Container( ULONG nSize ) +Container::Container( sal_uIntPtr nSize ) { DBG_CTOR( Container, DbgCheckContainer ); @@ -675,7 +675,7 @@ Container::Container( ULONG nSize ) // Muss mehr als ein Block angelegt werden if ( nSize <= nBlockSize ) { - pFirstBlock = new CBlock( (USHORT)nSize, NULL ); + pFirstBlock = new CBlock( (sal_uInt16)nSize, NULL ); pLastBlock = pFirstBlock; } else @@ -696,7 +696,7 @@ Container::Container( ULONG nSize ) nSize -= nBlockSize; } - pLastBlock = new CBlock( (USHORT)nSize, pBlock1 ); + pLastBlock = new CBlock( (sal_uInt16)nSize, pBlock1 ); pBlock1->SetNextBlock( pLastBlock ); } @@ -756,7 +756,7 @@ Container::~Container() |* *************************************************************************/ -void Container::ImpInsert( void* p, CBlock* pBlock, USHORT nIndex ) +void Container::ImpInsert( void* p, CBlock* pBlock, sal_uInt16 nIndex ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -856,7 +856,7 @@ void Container::Insert( void* p ) |* *************************************************************************/ -void Container::Insert( void* p, ULONG nIndex ) +void Container::Insert( void* p, sal_uIntPtr nIndex ) { if ( nCount <= nIndex ) { @@ -875,7 +875,7 @@ void Container::Insert( void* p, ULONG nIndex ) pTemp = pTemp->GetNextBlock(); } - ImpInsert( p, pTemp, (USHORT)nIndex ); + ImpInsert( p, pTemp, (sal_uInt16)nIndex ); } } @@ -891,7 +891,7 @@ void Container::Insert( void* p, ULONG nIndex ) void Container::Insert( void* pNew, void* pOld ) { - ULONG nIndex = GetPos( pOld ); + sal_uIntPtr nIndex = GetPos( pOld ); if ( nIndex != CONTAINER_ENTRY_NOTFOUND ) Insert( pNew, nIndex ); } @@ -906,7 +906,7 @@ void Container::Insert( void* pNew, void* pOld ) |* *************************************************************************/ -void* Container::ImpRemove( CBlock* pBlock, USHORT nIndex ) +void* Container::ImpRemove( CBlock* pBlock, sal_uInt16 nIndex ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1002,7 +1002,7 @@ void* Container::Remove() |* *************************************************************************/ -void* Container::Remove( ULONG nIndex ) +void* Container::Remove( sal_uIntPtr nIndex ) { // Ist Index nicht innerhalb des Containers, dann NULL zurueckgeben if ( nCount <= nIndex ) @@ -1017,7 +1017,7 @@ void* Container::Remove( ULONG nIndex ) pTemp = pTemp->GetNextBlock(); } - return ImpRemove( pTemp, (USHORT)nIndex ); + return ImpRemove( pTemp, (sal_uInt16)nIndex ); } } @@ -1051,7 +1051,7 @@ void* Container::Replace( void* p ) |* *************************************************************************/ -void* Container::Replace( void* p, ULONG nIndex ) +void* Container::Replace( void* p, sal_uIntPtr nIndex ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1068,7 +1068,7 @@ void* Container::Replace( void* p, ULONG nIndex ) pTemp = pTemp->GetNextBlock(); } - return pTemp->Replace( p, (USHORT)nIndex ); + return pTemp->Replace( p, (sal_uInt16)nIndex ); } } @@ -1082,7 +1082,7 @@ void* Container::Replace( void* p, ULONG nIndex ) |* *************************************************************************/ -void Container::SetSize( ULONG nNewSize ) +void Container::SetSize( sal_uIntPtr nNewSize ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1092,7 +1092,7 @@ void Container::SetSize( ULONG nNewSize ) if ( nNewSize != nCount ) { CBlock* pTemp; - ULONG nTemp; + sal_uIntPtr nTemp; // Wird verkleinert if ( nNewSize < nCount ) @@ -1106,14 +1106,14 @@ void Container::SetSize( ULONG nNewSize ) } // Alle folgenden Bloecke loeschen - BOOL bLast = FALSE; + sal_Bool bLast = sal_False; CBlock* pDelNext; CBlock* pDelBlock = pTemp->GetNextBlock(); while ( pDelBlock ) { // Muss CurrentBlock umgesetzt werden if ( pDelBlock == pCurBlock ) - bLast = TRUE; + bLast = sal_True; pDelNext = pDelBlock->GetNextBlock(); delete pDelBlock; pDelBlock = pDelNext; @@ -1124,7 +1124,7 @@ void Container::SetSize( ULONG nNewSize ) { pLastBlock = pTemp; pTemp->SetNextBlock( NULL ); - pTemp->SetSize( (USHORT)(nNewSize-nTemp) ); + pTemp->SetSize( (sal_uInt16)(nNewSize-nTemp) ); } else { @@ -1151,7 +1151,7 @@ void Container::SetSize( ULONG nNewSize ) // Muss mehr als ein Block angelegt werden if ( nNewSize <= nBlockSize ) { - pFirstBlock = new CBlock( (USHORT)nNewSize, NULL ); + pFirstBlock = new CBlock( (sal_uInt16)nNewSize, NULL ); pLastBlock = pFirstBlock; } else @@ -1172,7 +1172,7 @@ void Container::SetSize( ULONG nNewSize ) nNewSize -= nBlockSize; } - pLastBlock = new CBlock( (USHORT)nNewSize, pBlock1 ); + pLastBlock = new CBlock( (sal_uInt16)nNewSize, pBlock1 ); pBlock1->SetNextBlock( pLastBlock ); } @@ -1180,7 +1180,7 @@ void Container::SetSize( ULONG nNewSize ) } // Reicht es, den letzen Puffer in der Groesse anzupassen else if ( (nTemp+pTemp->Count()) <= nBlockSize ) - pTemp->SetSize( (USHORT)(nTemp+pTemp->Count()) ); + pTemp->SetSize( (sal_uInt16)(nTemp+pTemp->Count()) ); else { // Puffer auf max. Blockgroesse setzen @@ -1201,7 +1201,7 @@ void Container::SetSize( ULONG nNewSize ) // Den letzten Block anlegen if ( nTemp ) { - pLastBlock = new CBlock( (USHORT)nTemp, pTemp ); + pLastBlock = new CBlock( (sal_uInt16)nTemp, pTemp ); pTemp->SetNextBlock( pLastBlock ); } else @@ -1278,7 +1278,7 @@ void* Container::GetCurObject() const |* *************************************************************************/ -ULONG Container::GetCurPos() const +sal_uIntPtr Container::GetCurPos() const { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1289,7 +1289,7 @@ ULONG Container::GetCurPos() const { // Block suchen CBlock* pTemp = pFirstBlock; - ULONG nTemp = 0; + sal_uIntPtr nTemp = 0; while ( pTemp != pCurBlock ) { nTemp += pTemp->Count(); @@ -1310,7 +1310,7 @@ ULONG Container::GetCurPos() const |* *************************************************************************/ -void** Container::GetObjectPtr( ULONG nIndex ) +void** Container::GetObjectPtr( sal_uIntPtr nIndex ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1328,7 +1328,7 @@ void** Container::GetObjectPtr( ULONG nIndex ) } // Item innerhalb des gefundenen Blocks zurueckgeben - return pTemp->GetObjectPtr( (USHORT)nIndex ); + return pTemp->GetObjectPtr( (sal_uInt16)nIndex ); } } @@ -1342,7 +1342,7 @@ void** Container::GetObjectPtr( ULONG nIndex ) |* *************************************************************************/ -void* Container::GetObject( ULONG nIndex ) const +void* Container::GetObject( sal_uIntPtr nIndex ) const { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1360,7 +1360,7 @@ void* Container::GetObject( ULONG nIndex ) const } // Item innerhalb des gefundenen Blocks zurueckgeben - return pTemp->GetObject( (USHORT)nIndex ); + return pTemp->GetObject( (sal_uInt16)nIndex ); } } @@ -1374,15 +1374,15 @@ void* Container::GetObject( ULONG nIndex ) const |* *************************************************************************/ -ULONG Container::GetPos( const void* p ) const +sal_uIntPtr Container::GetPos( const void* p ) const { DBG_CHKTHIS( Container, DbgCheckContainer ); void** pNodes; CBlock* pTemp; - ULONG nTemp; - USHORT nBlockCount; - USHORT i; + sal_uIntPtr nTemp; + sal_uInt16 nBlockCount; + sal_uInt16 i; // Block suchen pTemp = pFirstBlock; @@ -1416,8 +1416,8 @@ ULONG Container::GetPos( const void* p ) const |* *************************************************************************/ -ULONG Container::GetPos( const void* p, ULONG nStartIndex, - BOOL bForward ) const +sal_uIntPtr Container::GetPos( const void* p, sal_uIntPtr nStartIndex, + sal_Bool bForward ) const { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1427,12 +1427,12 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex, else { void** pNodes; - USHORT nBlockCount; - USHORT i; + sal_uInt16 nBlockCount; + sal_uInt16 i; // Block suchen CBlock* pTemp = pFirstBlock; - ULONG nTemp = 0; + sal_uIntPtr nTemp = 0; while ( nTemp+pTemp->Count() <= nStartIndex ) { nTemp += pTemp->Count(); @@ -1443,7 +1443,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex, if ( bForward ) { // Alle Bloecke durchrsuchen - i = (USHORT)(nStartIndex - nTemp); + i = (sal_uInt16)(nStartIndex - nTemp); pNodes = pTemp->GetObjectPtr( i ); do { @@ -1465,12 +1465,12 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex, else break; } - while ( TRUE ); + while ( sal_True ); } else { // Alle Bloecke durchrsuchen - i = (USHORT)(nStartIndex-nTemp)+1; + i = (sal_uInt16)(nStartIndex-nTemp)+1; pNodes = pTemp->GetObjectPtr( i-1 ); do { @@ -1494,7 +1494,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex, else break; } - while ( TRUE ); + while ( sal_True ); } } @@ -1511,7 +1511,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex, |* *************************************************************************/ -void* Container::Seek( ULONG nIndex ) +void* Container::Seek( sal_uIntPtr nIndex ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1530,7 +1530,7 @@ void* Container::Seek( ULONG nIndex ) // Item innerhalb des gefundenen Blocks zurueckgeben pCurBlock = pTemp; - nCurIndex = (USHORT)nIndex; + nCurIndex = (sal_uInt16)nIndex; return pCurBlock->GetObject( nCurIndex ); } } @@ -1689,20 +1689,20 @@ Container& Container::operator =( const Container& r ) |* *************************************************************************/ -BOOL Container::operator ==( const Container& r ) const +sal_Bool Container::operator ==( const Container& r ) const { DBG_CHKTHIS( Container, DbgCheckContainer ); if ( nCount != r.nCount ) - return FALSE; + return sal_False; - ULONG i = 0; + sal_uIntPtr i = 0; while ( i < nCount ) { if ( GetObject( i ) != r.GetObject( i ) ) - return FALSE; + return sal_False; i++; } - return TRUE; + return sal_True; } |