[Libreoffice-commits] core.git: sal/rtl sot/source store/source svl/source ucb/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Jan 9 06:21:21 UTC 2018


 sal/rtl/strimp.cxx                           |    2 +-
 sot/source/sdstor/stg.cxx                    |    8 ++++----
 sot/source/sdstor/stgcache.cxx               |    8 ++++----
 sot/source/sdstor/stgdir.cxx                 |    4 ++--
 store/source/stordir.cxx                     |    6 +++---
 svl/source/items/slstitm.cxx                 |    4 ++--
 ucb/source/cacher/cachedcontentresultset.cxx |   14 +++++++-------
 ucb/source/sorter/sortdynres.cxx             |    4 ++--
 ucb/source/sorter/sortresult.cxx             |    4 ++--
 9 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 75c604a4ecd61322285f4139621e14166a8db1f2
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jan 8 13:49:54 2018 +0200

    loplugin:convertlong in ucb,sot
    
    Change-Id: I6fa355448834701f11b84584649dfcdecd0f7b2c
    Reviewed-on: https://gerrit.libreoffice.org/47596
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sal/rtl/strimp.cxx b/sal/rtl/strimp.cxx
index d520d2412b6e..e760de186417 100644
--- a/sal/rtl/strimp.cxx
+++ b/sal/rtl/strimp.cxx
@@ -81,7 +81,7 @@ static void *pre_allocateStringFn(sal_Size n)
 static void pre_freeStringFn(void *data)
 {
     char    *addr = static_cast<char*>(data) - 4;
-    sal_Size size = reinterpret_cast<sal_uInt32*>(addr)[0] + 12;
+    sal_uInt32 size = reinterpret_cast<sal_uInt32*>(addr)[0] + 12;
 
     rtl_arena_free(pre_arena, addr, size);
 }
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index 313d2c893840..64583644d7cc 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -316,7 +316,7 @@ bool Storage::IsStorageFile( SvStream* pStream )
     if ( pStream )
     {
         StgHeader aHdr;
-        sal_uLong nPos = pStream->Tell();
+        sal_uInt64 nPos = pStream->Tell();
         bRet = ( aHdr.Load( *pStream ) && aHdr.Check() );
 
         // It's not a stream error if it is too small for a OLE storage header
@@ -374,7 +374,7 @@ Storage::Storage( SvStream& r, bool bDirect )
     if( r.GetError() == ERRCODE_NONE )
     {
         pIo->SetStrm( &r, false );
-        sal_uLong nSize = r.Seek( STREAM_SEEK_TO_END );
+        sal_uInt64 nSize = r.Seek( STREAM_SEEK_TO_END );
         r.Seek( 0 );
         // Initializing is OK if the stream is empty
         Init( nSize == 0 );
@@ -419,7 +419,7 @@ Storage::Storage( UCBStorageStream& rStrm, bool bDirect )
 
     pIo->SetStrm( &rStrm );
 
-    sal_uLong nSize = pStream->Seek( STREAM_SEEK_TO_END );
+    sal_uInt64 nSize = pStream->Seek( STREAM_SEEK_TO_END );
     pStream->Seek( 0 );
     // Initializing is OK if the stream is empty
     Init( nSize == 0 );
@@ -444,7 +444,7 @@ void Storage::Init( bool bCreate )
     OSL_ENSURE( pIo, "The pointer may not be empty at this point!" );
     if( pIo->Good() && pIo->GetStrm() )
     {
-        sal_uLong nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END );
+        sal_uInt64 nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END );
         pIo->GetStrm()->Seek( 0 );
         if( nSize )
         {
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index 8f77abdbc345..3665aac7b856 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -111,8 +111,8 @@ void StgCache::SetPhysPageSize( short n )
     if ( n >= 512 )
     {
         m_nPageSize = n;
-        sal_uLong nPos = m_pStrm->Tell();
-        sal_uLong nFileSize = m_pStrm->Seek( STREAM_SEEK_TO_END );
+        sal_uInt64 nPos = m_pStrm->Tell();
+        sal_uInt64 nFileSize = m_pStrm->Seek( STREAM_SEEK_TO_END );
         m_nPages = lcl_GetPageCount( nFileSize, m_nPageSize );
         m_pStrm->Seek( nPos );
     }
@@ -295,7 +295,7 @@ bool StgCache::Open( const OUString& rName, StreamMode nMode )
     SetStrm( pFileStrm, true );
     if( pFileStrm->IsOpen() )
     {
-        sal_uLong nFileSize = m_pStrm->Seek( STREAM_SEEK_TO_END );
+        sal_uInt64 nFileSize = m_pStrm->Seek( STREAM_SEEK_TO_END );
         m_nPages = lcl_GetPageCount( nFileSize, m_nPageSize );
         m_pStrm->Seek( 0 );
     }
@@ -384,7 +384,7 @@ bool StgCache::Write( sal_Int32 nPage, void const * pBuf )
         {
             m_pStrm->Seek(nPos);
         }
-        sal_uLong nRes = m_pStrm->WriteBytes( pBuf, nBytes );
+        size_t nRes = m_pStrm->WriteBytes( pBuf, nBytes );
         if( nRes != nBytes )
             SetError( SVSTREAM_WRITE_ERROR );
         else
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 309c5f896112..3cad0ee08962 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -625,7 +625,7 @@ bool StgDirEntry::Tmp2Strm()
         OSL_ENSURE( m_pStgStrm, "The pointer may not be NULL!" );
         if ( !m_pStgStrm )
             return false;
-        sal_uLong n = m_pTmpStrm->GetSize();
+        sal_uInt64 n = m_pTmpStrm->GetSize();
         StgStrm* pNewStrm;
         StgIo& rIo = m_pStgStrm->GetIo();
         sal_uLong nThreshold = (sal_uLong) rIo.m_aHdr.GetThreshold();
@@ -639,7 +639,7 @@ bool StgDirEntry::Tmp2Strm()
             m_pTmpStrm->Seek( 0 );
             while( n )
             {
-                sal_uLong nn = n;
+                sal_uInt64 nn = n;
                 if( nn > 4096 )
                     nn = 4096;
                 if (m_pTmpStrm->ReadBytes( p, nn ) != nn)
diff --git a/store/source/stordir.cxx b/store/source/stordir.cxx
index bbfe71876e39..c1d70ef7a84b 100644
--- a/store/source/stordir.cxx
+++ b/store/source/stordir.cxx
@@ -179,8 +179,8 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData)
 
                 // Setup FindData.
                 sal_Char *p = xNode->m_aNameBlock.m_pData;
-                sal_Size  n = rtl_str_getLength (p);
-                sal_Size  k = rFindData.m_nLength;
+                sal_Int32 n = rtl_str_getLength (p);
+                sal_Int32 k = rFindData.m_nLength;
 
                 n = convertTextToUnicode (
                     m_hTextCvt, p, n,
@@ -191,7 +191,7 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData)
                     memset (&rFindData.m_pszName[n], 0, k);
                 }
 
-                rFindData.m_nLength  = static_cast<sal_Int32>(n);
+                rFindData.m_nLength  = n;
                 rFindData.m_nAttrib |= aPage.attrib();
 
                 // Leave.
diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx
index a0acd09fc532..5399706c2e85 100644
--- a/svl/source/items/slstitm.cxx
+++ b/svl/source/items/slstitm.cxx
@@ -195,10 +195,10 @@ void SfxStringListItem::SetStringList( const css::uno::Sequence< OUString >& rLi
 
 void SfxStringListItem::GetStringList( css::uno::Sequence< OUString >& rList ) const
 {
-    long nCount = mpList->size();
+    size_t nCount = mpList->size();
 
     rList.realloc( nCount );
-    for( long i=0; i < nCount; i++ )
+    for( size_t i=0; i < nCount; i++ )
         rList[i] = (*mpList)[i];
 }
 
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index 54c1d112ea2e..c7444b5d8f45 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -151,8 +151,8 @@ bool CachedContentResultSet::CCRS_Cache
 {
     if( !m_pResult )
         return false;
-    long nStart = m_pResult->StartIndex;
-    long nEnd = nStart;
+    sal_Int32 nStart = m_pResult->StartIndex;
+    sal_Int32 nEnd = nStart;
     if( m_pResult->Orientation )
         nEnd += m_pResult->Rows.getLength() - 1;
     else
@@ -166,7 +166,7 @@ sal_Int32 CachedContentResultSet::CCRS_Cache
 {
     if( !m_pResult )
         return 0;
-    long nEnd = m_pResult->StartIndex;
+    sal_Int32 nEnd = m_pResult->StartIndex;
     if( m_pResult->Orientation )
         return nEnd += m_pResult->Rows.getLength() - 1;
     else
@@ -192,7 +192,7 @@ bool CachedContentResultSet::CCRS_Cache
     if( !( m_pResult->FetchError & FetchError::EXCEPTION ) )
         return false;
 
-    long nEnd = m_pResult->StartIndex;
+    sal_Int32 nEnd = m_pResult->StartIndex;
     if( m_pResult->Orientation )
         nEnd += m_pResult->Rows.getLength();
 
@@ -209,7 +209,7 @@ Any& CachedContentResultSet::CCRS_Cache
     if( !hasRow( nRow ) )
         throw SQLException();
 
-    long nDiff = nRow - m_pResult->StartIndex;
+    sal_Int32 nDiff = nRow - m_pResult->StartIndex;
     if( nDiff < 0 )
         nDiff *= -1;
 
@@ -222,7 +222,7 @@ void CachedContentResultSet::CCRS_Cache
     //remind that this row was mapped
     if( !m_pResult )
         return;
-    long nDiff = nRow - m_pResult->StartIndex;
+    sal_Int32 nDiff = nRow - m_pResult->StartIndex;
     if( nDiff < 0 )
         nDiff *= -1;
     Sequence< sal_Bool >* pMappedReminder = getMappedReminder();
@@ -235,7 +235,7 @@ bool CachedContentResultSet::CCRS_Cache
 {
     if( !m_pMappedReminder || !m_pResult )
         return false;
-    long nDiff = nRow - m_pResult->StartIndex;
+    sal_Int32 nDiff = nRow - m_pResult->StartIndex;
     if( nDiff < 0 )
         nDiff *= -1;
     if( nDiff < m_pMappedReminder->getLength() )
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index dfd99daa0f15..7d8fef03c82c 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -380,14 +380,14 @@ void SortedDynamicResultSet::impl_disposing()
 
 void SortedDynamicResultSet::SendNotify()
 {
-    long nCount = maActions.Count();
+    sal_Int32 nCount = maActions.Count();
 
     if ( nCount && mxListener.is() )
     {
         Sequence< ListAction > aActionList( maActions.Count() );
         ListAction *pActionList = aActionList.getArray();
 
-        for ( long i=0; i<nCount; i++ )
+        for ( sal_Int32 i=0; i<nCount; i++ )
         {
             pActionList[ i ] = *(maActions.GetAction( i ));
         }
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index 6c5e99226e40..4998409330e2 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -877,7 +877,7 @@ sal_IntPtr SortedResultSet::CompareImpl( const Reference < XResultSet >& xResult
     Reference < XRow > xRowTwo( xResultTwo, UNO_QUERY );
 
     sal_IntPtr nCompare = 0;
-    sal_IntPtr nColumn = pSortInfo->mnColumn;
+    sal_Int32 nColumn = pSortInfo->mnColumn;
 
     switch ( pSortInfo->mnType )
     {
@@ -1535,7 +1535,7 @@ void SortedResultSet::BuildSortInfo(
     OUString    aPropName;
     SortInfo    *pInfo;
 
-    for ( sal_IntPtr i=xSortInfo.getLength(); i > 0; )
+    for ( sal_Int32 i=xSortInfo.getLength(); i > 0; )
     {
         --i;
         nColumn = pSortInfo[ i ].ColumnIndex;


More information about the Libreoffice-commits mailing list