diff options
Diffstat (limited to 'tools/source/memtools/contnr.cxx')
-rwxr-xr-x[-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 3aff098aa3bc..9fe9babc5f05 100644..100755 --- a/tools/source/memtools/contnr.cxx +++ b/tools/source/memtools/contnr.cxx @@ -75,7 +75,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 ); @@ -96,7 +96,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" ); @@ -158,7 +158,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" ); @@ -212,12 +212,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; @@ -347,7 +347,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 ); @@ -404,7 +404,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 ); @@ -423,7 +423,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 ); @@ -438,7 +438,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" ); @@ -554,7 +554,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 ); @@ -615,7 +615,7 @@ Container::Container( USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize ) |* *************************************************************************/ -Container::Container( ULONG nSize ) +Container::Container( sal_uIntPtr nSize ) { DBG_CTOR( Container, DbgCheckContainer ); @@ -636,7 +636,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 @@ -657,7 +657,7 @@ Container::Container( ULONG nSize ) nSize -= nBlockSize; } - pLastBlock = new CBlock( (USHORT)nSize, pBlock1 ); + pLastBlock = new CBlock( (sal_uInt16)nSize, pBlock1 ); pBlock1->SetNextBlock( pLastBlock ); } @@ -707,7 +707,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 ); @@ -799,7 +799,7 @@ void Container::Insert( void* p ) |* *************************************************************************/ -void Container::Insert( void* p, ULONG nIndex ) +void Container::Insert( void* p, sal_uIntPtr nIndex ) { if ( nCount <= nIndex ) { @@ -818,7 +818,7 @@ void Container::Insert( void* p, ULONG nIndex ) pTemp = pTemp->GetNextBlock(); } - ImpInsert( p, pTemp, (USHORT)nIndex ); + ImpInsert( p, pTemp, (sal_uInt16)nIndex ); } } @@ -830,7 +830,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 ); } @@ -843,7 +843,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 ); @@ -931,7 +931,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 ) @@ -946,7 +946,7 @@ void* Container::Remove( ULONG nIndex ) pTemp = pTemp->GetNextBlock(); } - return ImpRemove( pTemp, (USHORT)nIndex ); + return ImpRemove( pTemp, (sal_uInt16)nIndex ); } } @@ -972,7 +972,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 ); @@ -989,7 +989,7 @@ void* Container::Replace( void* p, ULONG nIndex ) pTemp = pTemp->GetNextBlock(); } - return pTemp->Replace( p, (USHORT)nIndex ); + return pTemp->Replace( p, (sal_uInt16)nIndex ); } } @@ -999,7 +999,7 @@ void* Container::Replace( void* p, ULONG nIndex ) |* *************************************************************************/ -void Container::SetSize( ULONG nNewSize ) +void Container::SetSize( sal_uIntPtr nNewSize ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1009,7 +1009,7 @@ void Container::SetSize( ULONG nNewSize ) if ( nNewSize != nCount ) { CBlock* pTemp; - ULONG nTemp; + sal_uIntPtr nTemp; // Wird verkleinert if ( nNewSize < nCount ) @@ -1023,14 +1023,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; @@ -1041,7 +1041,7 @@ void Container::SetSize( ULONG nNewSize ) { pLastBlock = pTemp; pTemp->SetNextBlock( NULL ); - pTemp->SetSize( (USHORT)(nNewSize-nTemp) ); + pTemp->SetSize( (sal_uInt16)(nNewSize-nTemp) ); } else { @@ -1068,7 +1068,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 @@ -1089,7 +1089,7 @@ void Container::SetSize( ULONG nNewSize ) nNewSize -= nBlockSize; } - pLastBlock = new CBlock( (USHORT)nNewSize, pBlock1 ); + pLastBlock = new CBlock( (sal_uInt16)nNewSize, pBlock1 ); pBlock1->SetNextBlock( pLastBlock ); } @@ -1097,7 +1097,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 @@ -1118,7 +1118,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 @@ -1183,7 +1183,7 @@ void* Container::GetCurObject() const |* *************************************************************************/ -ULONG Container::GetCurPos() const +sal_uIntPtr Container::GetCurPos() const { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1194,7 +1194,7 @@ ULONG Container::GetCurPos() const { // Block suchen CBlock* pTemp = pFirstBlock; - ULONG nTemp = 0; + sal_uIntPtr nTemp = 0; while ( pTemp != pCurBlock ) { nTemp += pTemp->Count(); @@ -1213,7 +1213,7 @@ ULONG Container::GetCurPos() const |* *************************************************************************/ -void** Container::GetObjectPtr( ULONG nIndex ) +void** Container::GetObjectPtr( sal_uIntPtr nIndex ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1231,7 +1231,7 @@ void** Container::GetObjectPtr( ULONG nIndex ) } // Item innerhalb des gefundenen Blocks zurueckgeben - return pTemp->GetObjectPtr( (USHORT)nIndex ); + return pTemp->GetObjectPtr( (sal_uInt16)nIndex ); } } @@ -1241,7 +1241,7 @@ void** Container::GetObjectPtr( ULONG nIndex ) |* *************************************************************************/ -void* Container::GetObject( ULONG nIndex ) const +void* Container::GetObject( sal_uIntPtr nIndex ) const { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1259,7 +1259,7 @@ void* Container::GetObject( ULONG nIndex ) const } // Item innerhalb des gefundenen Blocks zurueckgeben - return pTemp->GetObject( (USHORT)nIndex ); + return pTemp->GetObject( (sal_uInt16)nIndex ); } } @@ -1269,15 +1269,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; @@ -1307,8 +1307,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 ); @@ -1318,12 +1318,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(); @@ -1334,7 +1334,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 { @@ -1356,12 +1356,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 { @@ -1385,7 +1385,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex, else break; } - while ( TRUE ); + while ( sal_True ); } } @@ -1398,7 +1398,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex, |* *************************************************************************/ -void* Container::Seek( ULONG nIndex ) +void* Container::Seek( sal_uIntPtr nIndex ) { DBG_CHKTHIS( Container, DbgCheckContainer ); @@ -1417,7 +1417,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 ); } } @@ -1552,22 +1552,22 @@ 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; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |