diff options
author | Valentin Kettner <vakevk+libreoffice@gmail.com> | 2014-03-17 17:18:08 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-03-28 20:08:46 +0100 |
commit | 061130bd6d60c648991afb83bc0befb48a68f34e (patch) | |
tree | 45960c905e6456296614cff0ab32f284bdf074fe /basic/source/runtime | |
parent | 018652591d0e2a0fc740a16200bc887a9acc93a3 (diff) |
fdo#75280 Started cleaning up of sal_uIntPtr usage.
Converted wrong usage of sal_uIntPtr to appropriate other types in basic
module.
The bug is not fully fixed with this since many other occurences of sal_uIntPtr remain.
Update due to code review comments:
Fixed forgetting to change some declarations in iosys.cxx.
Cleaned up the one remaining sal_uIntPtr in iosys.cxx
Fixed adding a sal_uInt64 to a Date (uses long now instead) in methods.cxx
Fixed the VarDecFromUI4 call in sbxdec.cxx from sal_uLong to ULONG .
Conflicts:
basic/source/runtime/iosys.cxx
Change-Id: Ia6460be04967deb68b92eb62d945da8814fae605
Diffstat (limited to 'basic/source/runtime')
-rw-r--r-- | basic/source/runtime/inputbox.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/iosys.cxx | 48 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 4 | ||||
-rw-r--r-- | basic/source/runtime/stdobj.cxx | 2 |
4 files changed, 28 insertions, 28 deletions
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx index e574e4e51c96..152d625e46f7 100644 --- a/basic/source/runtime/inputbox.cxx +++ b/basic/source/runtime/inputbox.cxx @@ -148,7 +148,7 @@ RTLFUNC(InputBox) (void)pBasic; (void)bWrite; - sal_uIntPtr nArgCount = rPar.Count(); + sal_uInt32 nArgCount = rPar.Count(); if ( nArgCount < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index dd486a927a3c..e5f868f1c838 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -313,11 +313,11 @@ class OslStream : public SvStream public: OslStream( const OUString& rName, short nStrmMode ); ~OslStream(); - virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ) SAL_OVERRIDE; - virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ) SAL_OVERRIDE; - virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ) SAL_OVERRIDE; + virtual sal_uInt64 GetData( void* pData, sal_uInt64 nSize ) SAL_OVERRIDE; + virtual sal_uInt64 PutData( const void* pData, sal_uInt64 nSize ) SAL_OVERRIDE; + virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) SAL_OVERRIDE; virtual void FlushData() SAL_OVERRIDE; - virtual void SetSize( sal_uIntPtr nSize ) SAL_OVERRIDE; + virtual void SetSize( sal_uInt64 nSize) SAL_OVERRIDE; }; OslStream::OslStream( const OUString& rName, short nStrmMode ) @@ -357,21 +357,21 @@ OslStream::~OslStream() maFile.close(); } -sal_uIntPtr OslStream::GetData( void* pData, sal_uIntPtr nSize ) +sal_uInt64 OslStream::GetData( void* pData, sal_uInt64 nSize ) { sal_uInt64 nBytesRead = nSize; maFile.read( pData, nBytesRead, nBytesRead ); - return (sal_uIntPtr)nBytesRead; + return nBytesRead; } -sal_uIntPtr OslStream::PutData( const void* pData, sal_uIntPtr nSize ) +sal_uInt64 OslStream::PutData( const void* pData, sal_uInt64 nSize ) { sal_uInt64 nBytesWritten; - maFile.write( pData, (sal_uInt64)nSize, nBytesWritten ); - return (sal_uIntPtr)nBytesWritten; + maFile.write( pData, nSize, nBytesWritten ); + return nBytesWritten; } -sal_uIntPtr OslStream::SeekPos( sal_uIntPtr nPos ) +sal_uInt64 OslStream::SeekPos( sal_uInt64 nPos ) { ::osl::FileBase::RC rc = ::osl::FileBase::E_None; if( nPos == STREAM_SEEK_TO_END ) @@ -385,16 +385,16 @@ sal_uIntPtr OslStream::SeekPos( sal_uIntPtr nPos ) OSL_VERIFY(rc == ::osl::FileBase::E_None); sal_uInt64 nRealPos(0); maFile.getPos( nRealPos ); - return sal::static_int_cast<sal_uIntPtr>(nRealPos); + return nRealPos; } void OslStream::FlushData() { } -void OslStream::SetSize( sal_uIntPtr nSize ) +void OslStream::SetSize( sal_uInt64 nSize ) { - maFile.setSize( (sal_uInt64)nSize ); + maFile.setSize( nSize ); } @@ -407,11 +407,11 @@ public: UCBStream( Reference< XInputStream > & xIS ); UCBStream( Reference< XStream > & xS ); ~UCBStream(); - virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ) SAL_OVERRIDE; - virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ) SAL_OVERRIDE; - virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ) SAL_OVERRIDE; + virtual sal_uInt64 GetData( void* pData, sal_uInt64 nSize ) SAL_OVERRIDE; + virtual sal_uInt64 PutData( const void* pData, sal_uInt64 nSize ) SAL_OVERRIDE; + virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) SAL_OVERRIDE; virtual void FlushData() SAL_OVERRIDE; - virtual void SetSize( sal_uIntPtr nSize ) SAL_OVERRIDE; + virtual void SetSize( sal_uInt64 nSize ) SAL_OVERRIDE; }; UCBStream::UCBStream( Reference< XInputStream > & rStm ) @@ -450,7 +450,7 @@ UCBStream::~UCBStream() } } -sal_uIntPtr UCBStream::GetData( void* pData, sal_uIntPtr nSize ) +sal_uInt64 UCBStream::GetData( void* pData, sal_uInt64 nSize ) { try { @@ -481,7 +481,7 @@ sal_uIntPtr UCBStream::GetData( void* pData, sal_uIntPtr nSize ) return 0; } -sal_uIntPtr UCBStream::PutData( const void* pData, sal_uIntPtr nSize ) +sal_uInt64 UCBStream::PutData( const void* pData, sal_uInt64 nSize ) { try { @@ -504,13 +504,13 @@ sal_uIntPtr UCBStream::PutData( const void* pData, sal_uIntPtr nSize ) return 0; } -sal_uIntPtr UCBStream::SeekPos( sal_uIntPtr nPos ) +sal_uInt64 UCBStream::SeekPos( sal_uInt64 nPos ) { try { if( xSeek.is() ) { - sal_uIntPtr nLen = sal::static_int_cast<sal_uIntPtr>( xSeek->getLength() ); + sal_uInt64 nLen = static_cast<sal_uInt64>( xSeek->getLength() ); if( nPos > nLen ) { nPos = nLen; @@ -550,7 +550,7 @@ void UCBStream::FlushData() } } -void UCBStream::SetSize( sal_uIntPtr nSize ) +void UCBStream::SetSize( sal_uInt64 nSize ) { (void)nSize; @@ -687,10 +687,10 @@ void SbiStream::ExpandFile() { if ( nExpandOnWriteTo ) { - sal_uIntPtr nCur = pStrm->Seek(STREAM_SEEK_TO_END); + sal_uInt64 nCur = pStrm->Seek(STREAM_SEEK_TO_END); if( nCur < nExpandOnWriteTo ) { - sal_uIntPtr nDiff = nExpandOnWriteTo - nCur; + sal_uInt64 nDiff = nExpandOnWriteTo - nCur; char c = 0; while( nDiff-- ) { diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index b35d8d626ddd..7544946240b1 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -1828,12 +1828,12 @@ sal_Int16 implGetDateDay( double aDate ) if ( aDate >= 0.0 ) { aDate = floor( aDate ); - aRefDate += (sal_uIntPtr)aDate; + aRefDate += static_cast<long>(aDate); } else { aDate = ceil( aDate ); - aRefDate -= (sal_uIntPtr)(-1.0 * aDate); + aRefDate -= static_cast<long>(-1.0 * aDate); } sal_Int16 nRet = (sal_Int16)( aRefDate.GetDay() ); diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index 5e46c9b00e8f..47df365a5f01 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -828,7 +828,7 @@ void SbiStdObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); - sal_uIntPtr t = pHint->GetId(); + sal_uLong t = pHint->GetId(); sal_uInt16 nCallId = (sal_uInt16) pVar->GetUserData(); if( nCallId ) { |