diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-09-14 17:01:50 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-09-15 12:01:11 +0200 |
commit | b647996a9babbee7b33cf45192e57df6a124628b (patch) | |
tree | ddc6dfe8a62ec53fbacc4eeccfeb20019f3ef4f0 /unotools | |
parent | a19a67e20e847a42063559694ec5beec71abcfb3 (diff) |
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
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/streaming/streamhelper.cxx | 4 | ||||
-rw-r--r-- | unotools/source/streaming/streamwrap.cxx | 2 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 10 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.hxx | 4 | ||||
-rw-r--r-- | unotools/source/ucbhelper/xtempfile.cxx | 4 |
5 files changed, 12 insertions, 12 deletions
diff --git a/unotools/source/streaming/streamhelper.cxx b/unotools/source/streaming/streamhelper.cxx index 9efb0e992419..e2881b7b9a55 100644 --- a/unotools/source/streaming/streamhelper.cxx +++ b/unotools/source/streaming/streamhelper.cxx @@ -35,7 +35,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >& if (aData.getLength() < nBytesToRead) aData.realloc(nBytesToRead); - sal_Size nRead(0); + std::size_t nRead(0); ErrCode nError = m_xLockBytes->ReadAt(m_nActPos, static_cast<void*>(aData.getArray()), nBytesToRead, &nRead); m_nActPos += nRead; @@ -43,7 +43,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >& throw css::io::IOException(OUString(), static_cast<css::uno::XWeak*>(this)); // adjust sequence if data read is lower than the desired data - if (nRead < (sal_Size)aData.getLength()) + if (nRead < (std::size_t)aData.getLength()) aData.realloc( nRead ); return nRead; diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx index e64957005a03..92f7aa4165d2 100644 --- a/unotools/source/streaming/streamwrap.cxx +++ b/unotools/source/streaming/streamwrap.cxx @@ -62,7 +62,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::readBytes(css::uno::Sequence< sal_Int8 > checkError(); // Wenn gelesene Zeichen < MaxLength, css::uno::Sequence anpassen - if (nRead < (sal_Size)aData.getLength()) + if (nRead < (std::size_t)aData.getLength()) aData.realloc( nRead ); return nRead; diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index b814387336da..f3a556e06be1 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1168,7 +1168,7 @@ void UcbLockBytes::terminate_Impl() } ErrCode UcbLockBytes::ReadAt(sal_uInt64 const nPos, - void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const + void *pBuffer, std::size_t nCount, std::size_t *pRead) const { if ( IsSynchronMode() ) { @@ -1230,13 +1230,13 @@ ErrCode UcbLockBytes::ReadAt(sal_uInt64 const nPos, memcpy (pBuffer, aData.getConstArray(), nSize); if (pRead) - *pRead = sal_uLong(nSize); + *pRead = static_cast<std::size_t>(nSize); return ERRCODE_NONE; } ErrCode UcbLockBytes::WriteAt(sal_uInt64 const nPos, const void *pBuffer, - sal_uLong nCount, sal_uLong *pWritten) + std::size_t nCount, std::size_t *pWritten) { if ( pWritten ) *pWritten = 0; @@ -1296,7 +1296,7 @@ ErrCode UcbLockBytes::SetSize (sal_uInt64 const nNewSize) { SvLockBytesStat aStat; Stat( &aStat, (SvLockBytesStatFlag) 0 ); - sal_uLong nSize = aStat.nSize; + std::size_t nSize = aStat.nSize; if ( nSize > nNewSize ) { @@ -1313,7 +1313,7 @@ ErrCode UcbLockBytes::SetSize (sal_uInt64 const nNewSize) if ( nSize < nNewSize ) { - sal_uLong nDiff = nNewSize-nSize, nCount=0; + std::size_t nDiff = nNewSize-nSize, nCount=0; sal_uInt8* pBuffer = new sal_uInt8[ nDiff ]; memset(pBuffer, 0, nDiff); // initialize for enhanced security WriteAt( nSize, pBuffer, nDiff, &nCount ); diff --git a/unotools/source/ucbhelper/ucblockbytes.hxx b/unotools/source/ucbhelper/ucblockbytes.hxx index f9d3fb29de60..06ec8d30dd42 100644 --- a/unotools/source/ucbhelper/ucblockbytes.hxx +++ b/unotools/source/ucbhelper/ucblockbytes.hxx @@ -102,8 +102,8 @@ public: static UcbLockBytesRef CreateLockBytes( const css::uno::Reference < css::io::XStream >& xContent ); // SvLockBytes - virtual ErrCode ReadAt(sal_uInt64 nPos, void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const override; - virtual ErrCode WriteAt(sal_uInt64, const void*, sal_uLong, sal_uLong *pWritten) override; + virtual ErrCode ReadAt(sal_uInt64 nPos, void *pBuffer, std::size_t nCount, std::size_t *pRead) const override; + virtual ErrCode WriteAt(sal_uInt64, const void*, std::size_t, std::size_t *pWritten) override; virtual ErrCode Flush() const override; virtual ErrCode SetSize(sal_uInt64) override; virtual ErrCode Stat ( SvLockBytesStat *pStat, SvLockBytesStatFlag) const override; diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index c05ed9821c55..572871e3e4df 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -163,7 +163,7 @@ throw (css::io::NotConnectedException, css::io::BufferSizeExceededException, css sal_uInt32 nRead = mpStream->ReadBytes(static_cast<void*>(aData.getArray()), nBytesToRead); checkError(); - if (nRead < (sal_Size)aData.getLength()) + if (nRead < (std::size_t)aData.getLength()) aData.realloc( nRead ); if ( sal::static_int_cast<sal_uInt32>(nBytesToRead) > nRead ) @@ -315,7 +315,7 @@ void OTempFileService::checkConnected () mpStream = mpTempFile->GetStream( StreamMode::STD_READWRITE ); if ( mpStream && mbHasCachedPos ) { - mpStream->Seek( sal::static_int_cast<sal_Size>(mnCachedPos) ); + mpStream->Seek( sal::static_int_cast<std::size_t>(mnCachedPos) ); if ( mpStream->SvStream::GetError () == ERRCODE_NONE ) { mbHasCachedPos = false; |