From b647996a9babbee7b33cf45192e57df6a124628b Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 14 Sep 2016 17:01:50 +0200 Subject: replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos) ... except in include/rtl, include/sal, include/uno, where sal_Size is retained for compatibility, and where callers of rtl functions pass in pointers that are incompatible on MSVC. Change-Id: I8344453780689f5120ba0870e44965b6d292450c --- sot/source/sdstor/stgole.cxx | 4 ++-- sot/source/sdstor/stgole.hxx | 4 ++-- sot/source/sdstor/stgstrms.cxx | 4 ++-- sot/source/sdstor/stgstrms.hxx | 4 ++-- sot/source/sdstor/storage.cxx | 8 ++++---- sot/source/sdstor/storinfo.cxx | 2 +- sot/source/sdstor/ucbstorage.cxx | 16 ++++++++-------- 7 files changed, 21 insertions(+), 21 deletions(-) (limited to 'sot/source') diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index 48147043691e..a13a68ff6d2f 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -48,7 +48,7 @@ StgInternalStream::~StgInternalStream() delete m_pStrm; } -sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize ) +std::size_t StgInternalStream::GetData(void* pData, std::size_t nSize) { if( m_pStrm ) { @@ -60,7 +60,7 @@ sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize ) return 0; } -sal_uLong StgInternalStream::PutData( const void* pData, sal_uLong nSize ) +std::size_t StgInternalStream::PutData(const void* pData, std::size_t nSize) { if( m_pStrm ) { diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 80a090ea3943..30d8ab3336cb 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -28,8 +28,8 @@ class StgInternalStream : public SvStream { BaseStorageStream* m_pStrm; - virtual sal_uLong GetData( void* pData, sal_uLong nSize ) override; - virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) override; + virtual std::size_t GetData(void* pData, std::size_t nSize) override; + virtual std::size_t PutData(const void* pData, std::size_t nSize) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void FlushData() override; public: diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 92473d0bca47..7063a4ce99d3 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1258,7 +1258,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) } } -sal_Size StgTmpStrm::GetData( void* pData, sal_Size n ) +std::size_t StgTmpStrm::GetData( void* pData, std::size_t n ) { if( m_pStrm ) { @@ -1270,7 +1270,7 @@ sal_Size StgTmpStrm::GetData( void* pData, sal_Size n ) return SvMemoryStream::GetData( pData, n ); } -sal_Size StgTmpStrm::PutData( const void* pData, sal_Size n ) +std::size_t StgTmpStrm::PutData( const void* pData, std::size_t n ) { sal_uInt32 nCur = Tell(); sal_uInt32 nNew = nCur + n; diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index 739cc124aac6..e523e98a924f 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -145,8 +145,8 @@ class StgTmpStrm : public SvMemoryStream OUString m_aName; SvFileStream* m_pStrm; using SvMemoryStream::GetData; - virtual sal_Size GetData( void* pData, sal_Size nSize ) override; - virtual sal_Size PutData( const void* pData, sal_Size nSize ) override; + virtual std::size_t GetData( void* pData, std::size_t nSize ) override; + virtual std::size_t PutData( const void* pData, std::size_t nSize ) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void FlushData() override; diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 3d26f5c12116..1c3d5807726a 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -100,9 +100,9 @@ void SotStorageStream::ResetError() pOwnStm->ResetError(); } -sal_uLong SotStorageStream::GetData( void* pData, sal_uLong nSize ) +std::size_t SotStorageStream::GetData(void* pData, std::size_t const nSize) { - sal_uLong nRet = 0; + std::size_t nRet = 0; if( pOwnStm ) { @@ -115,9 +115,9 @@ sal_uLong SotStorageStream::GetData( void* pData, sal_uLong nSize ) return nRet; } -sal_uLong SotStorageStream::PutData( const void* pData, sal_uLong nSize ) +std::size_t SotStorageStream::PutData(const void* pData, std::size_t const nSize) { - sal_uLong nRet = 0; + std::size_t nRet = 0; if( pOwnStm ) { diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx index 1c5025bf13f2..f2813a238db9 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -36,7 +36,7 @@ SotClipboardFormatId ReadClipboardFormat( SvStream & rStm ) { // get a string name std::unique_ptr p(new( ::std::nothrow ) sal_Char[ nLen ]); - if (p && rStm.ReadBytes(p.get(), nLen) == static_cast(nLen)) + if (p && rStm.ReadBytes(p.get(), nLen) == static_cast(nLen)) { nFormat = SotExchange::RegisterFormatName(OUString(p.get(), nLen-1, RTL_TEXTENCODING_ASCII_US)); } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index e5078b682d73..d352537b4222 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -405,8 +405,8 @@ class UCBStorageStream_Impl : public SvRefBase, public SvStream virtual ~UCBStorageStream_Impl() override; public: - virtual sal_uLong GetData( void* pData, sal_uLong nSize ) override; - virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) override; + virtual std::size_t GetData(void* pData, std::size_t nSize) override; + virtual std::size_t PutData(const void* pData, std::size_t nSize) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void SetSize( sal_uInt64 nSize ) override; virtual void FlushData() override; @@ -869,9 +869,9 @@ void UCBStorageStream_Impl::CopySourceToTemporary() // UCBStorageStream_Impl must have a SvStream interface, because it then can be used as underlying stream // of an OLEStorage; so every write access caused by storage operations marks the UCBStorageStream as modified -sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) +std::size_t UCBStorageStream_Impl::GetData(void* pData, std::size_t const nSize) { - sal_uLong aResult = 0; + std::size_t aResult = 0; if( !Init() ) return 0; @@ -884,13 +884,13 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) // read the tail of the data from original stream // copy this tail to the temporary stream - sal_uLong aToRead = nSize - aResult; + std::size_t aToRead = nSize - aResult; pData = static_cast( static_cast(pData) + aResult ); try { Sequence aData( aToRead ); - sal_uLong aReaded = m_rSource->readBytes( aData, aToRead ); + std::size_t aReaded = m_rSource->readBytes( aData, aToRead ); aResult += m_pStream->WriteBytes(static_cast(aData.getArray()), aReaded); memcpy( pData, aData.getArray(), aReaded ); } @@ -907,7 +907,7 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) return aResult; } -sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize ) +std::size_t UCBStorageStream_Impl::PutData(const void* pData, std::size_t const nSize) { if ( !(m_nMode & StreamMode::WRITE) ) { @@ -918,7 +918,7 @@ sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize ) if( !nSize || !Init() ) return 0; - sal_uLong aResult = m_pStream->WriteBytes( pData, nSize ); + std::size_t aResult = m_pStream->WriteBytes( pData, nSize ); m_bModified = aResult > 0; -- cgit