summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-02-24 17:09:15 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-02-25 00:26:43 +0000
commit295bc8703ff5d5133f18ae2b25dc3d88cdfffa93 (patch)
tree4068dacf4e65fcf6bd21161440bfcca040e4634b /basic
parent553473945b6789cb757ec69aabba6b87c4854916 (diff)
basic: remove use of sal_uIntptr in favor of more appropriate type
Change-Id: Ie878f43c7245838519fe7477b039827b079dde63 Reviewed-on: https://gerrit.libreoffice.org/8214 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/basmgr/basmgr.cxx4
-rw-r--r--basic/source/classes/image.cxx10
-rw-r--r--basic/source/runtime/methods.cxx28
-rw-r--r--basic/source/runtime/methods1.cxx14
-rw-r--r--basic/source/sbx/sbxbase.cxx10
-rw-r--r--basic/source/sbx/sbxobj.cxx8
-rw-r--r--basic/source/uno/scriptcont.cxx4
7 files changed, 39 insertions, 39 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index c7c4bd48c189..60f6804bd0bc 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1157,7 +1157,7 @@ sal_Bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurS
sal_Bool BasicManager::ImplEncryptStream( SvStream& rStrm ) const
{
- sal_uIntPtr nPos = rStrm.Tell();
+ sal_Size nPos = rStrm.Tell();
sal_uInt32 nCreator;
rStrm.ReadUInt32( nCreator );
rStrm.Seek( nPos );
@@ -2062,7 +2062,7 @@ uno::Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog )
{
SvMemoryStream aMemStream;
pDialog->Store( aMemStream );
- sal_Int32 nLen = aMemStream.Tell();
+ sal_Size nLen = aMemStream.Tell();
uno::Sequence< sal_Int8 > aData( nLen );
sal_Int8* pDestData = aData.getArray();
const sal_Int8* pSrcData = (const sal_Int8*)aMemStream.GetData();
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index cea14ddcd0fd..6445dd203eca 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -83,15 +83,15 @@ bool SbiGood( SvStream& r )
// Open Record
sal_uIntPtr SbiOpenRecord( SvStream& r, sal_uInt16 nSignature, sal_uInt16 nElem )
{
- sal_uIntPtr nPos = r.Tell();
+ sal_Size nPos = r.Tell();
r.WriteUInt16( nSignature ).WriteInt32( (sal_Int32) 0 ).WriteUInt16( nElem );
return nPos;
}
// Close Record
-void SbiCloseRecord( SvStream& r, sal_uIntPtr nOff )
+void SbiCloseRecord( SvStream& r, sal_Size nOff )
{
- sal_uIntPtr nPos = r.Tell();
+ sal_Size nPos = r.Tell();
r.Seek( nOff + 2 );
r.WriteInt32( (sal_Int32) ( nPos - nOff - 8 ) );
r.Seek( nPos );
@@ -112,7 +112,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
Clear();
// Read Master-Record
r.ReadUInt16( nSign ).ReadUInt32( nLen ).ReadUInt16( nCount );
- sal_uIntPtr nLast = r.Tell() + nLen;
+ sal_Size nLast = r.Tell() + nLen;
sal_uInt32 nCharSet; // System charset
sal_uInt32 lDimBase;
sal_uInt16 nReserved1;
@@ -131,7 +131,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
bool bLegacy = ( nVersion < B_EXT_IMG_VERSION );
- sal_uIntPtr nNext;
+ sal_Size nNext;
while( ( nNext = r.Tell() ) < nLast )
{
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 04ee05998844..c7552ccc2607 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -913,7 +913,7 @@ RTLFUNC(InStr)
(void)pBasic;
(void)bWrite;
- sal_uIntPtr nArgCount = rPar.Count()-1;
+ sal_Size nArgCount = rPar.Count()-1;
if ( nArgCount < 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
@@ -986,7 +986,7 @@ RTLFUNC(InStrRev)
(void)pBasic;
(void)bWrite;
- sal_uIntPtr nArgCount = rPar.Count()-1;
+ sal_Size nArgCount = rPar.Count()-1;
if ( nArgCount < 2 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -1343,7 +1343,7 @@ RTLFUNC(Replace)
(void)pBasic;
(void)bWrite;
- sal_uIntPtr nArgCount = rPar.Count()-1;
+ sal_Size nArgCount = rPar.Count()-1;
if ( nArgCount < 3 || nArgCount > 6 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -3392,7 +3392,7 @@ RTLFUNC(Loc)
return;
}
SvStream* pSvStrm = pSbStrm->GetStrm();
- sal_uIntPtr nPos;
+ sal_Size nPos;
if( pSbStrm->IsRandom())
{
short nBlockLen = pSbStrm->GetBlockLen();
@@ -3440,8 +3440,8 @@ RTLFUNC(Lof)
return;
}
SvStream* pSvStrm = pSbStrm->GetStrm();
- sal_uIntPtr nOldPos = pSvStrm->Tell();
- sal_uIntPtr nLen = pSvStrm->Seek( STREAM_SEEK_TO_END );
+ sal_Size nOldPos = pSvStrm->Tell();
+ sal_Size nLen = pSvStrm->Seek( STREAM_SEEK_TO_END );
pSvStrm->Seek( nOldPos );
rPar.Get(0)->PutLong( (sal_Int32)nLen );
}
@@ -3472,7 +3472,7 @@ RTLFUNC(Seek)
if ( nArgs == 2 ) // Seek-Function
{
- sal_uIntPtr nPos = pStrm->Tell();
+ sal_Size nPos = pStrm->Tell();
if( pSbStrm->IsRandom() )
{
nPos = nPos / pSbStrm->GetBlockLen();
@@ -3494,7 +3494,7 @@ RTLFUNC(Seek)
{
nPos *= pSbStrm->GetBlockLen();
}
- pStrm->Seek( (sal_uIntPtr)nPos );
+ pStrm->Seek( (sal_Size)nPos );
pSbStrm->SetExpandOnWriteTo( nPos );
}
}
@@ -3585,7 +3585,7 @@ RTLFUNC(Shell)
return;
}
- sal_uIntPtr nArgCount = rPar.Count();
+ sal_Size nArgCount = rPar.Count();
if ( nArgCount < 2 || nArgCount > 5 )
{
rPar.Get(0)->PutLong(0);
@@ -4204,10 +4204,10 @@ RTLFUNC(RGB)
return;
}
- sal_uIntPtr nRed = rPar.Get(1)->GetInteger() & 0xFF;
- sal_uIntPtr nGreen = rPar.Get(2)->GetInteger() & 0xFF;
- sal_uIntPtr nBlue = rPar.Get(3)->GetInteger() & 0xFF;
- sal_uIntPtr nRGB;
+ sal_Int32 nRed = rPar.Get(1)->GetInteger() & 0xFF;
+ sal_Int32 nGreen = rPar.Get(2)->GetInteger() & 0xFF;
+ sal_Int32 nBlue = rPar.Get(3)->GetInteger() & 0xFF;
+ sal_Int32 nRGB;
SbiInstance* pInst = GetSbData()->pInst;
bool bCompatibility = ( pInst && pInst->IsCompatibility() );
@@ -4269,7 +4269,7 @@ RTLFUNC(StrConv)
(void)pBasic;
(void)bWrite;
- sal_uIntPtr nArgCount = rPar.Count()-1;
+ sal_Size nArgCount = rPar.Count()-1;
if( nArgCount < 2 || nArgCount > 3 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 9749ece67d6f..6b52e281600e 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -541,7 +541,7 @@ RTLFUNC(Red)
}
else
{
- sal_uIntPtr nRGB = (sal_uIntPtr)rPar.Get(1)->GetLong();
+ sal_Int32 nRGB = rPar.Get(1)->GetLong();
nRGB &= 0x00FF0000;
nRGB >>= 16;
rPar.Get(0)->PutInteger( (sal_Int16)nRGB );
@@ -559,7 +559,7 @@ RTLFUNC(Green)
}
else
{
- sal_uIntPtr nRGB = (sal_uIntPtr)rPar.Get(1)->GetLong();
+ sal_Int32 nRGB = rPar.Get(1)->GetLong();
nRGB &= 0x0000FF00;
nRGB >>= 8;
rPar.Get(0)->PutInteger( (sal_Int16)nRGB );
@@ -577,7 +577,7 @@ RTLFUNC(Blue)
}
else
{
- sal_uIntPtr nRGB = (sal_uIntPtr)rPar.Get(1)->GetLong();
+ sal_Int32 nRGB = rPar.Get(1)->GetLong();
nRGB &= 0x000000FF;
rPar.Get(0)->PutInteger( (sal_Int16)nRGB );
}
@@ -982,7 +982,7 @@ RTLFUNC(FindPropertyObject)
static sal_Bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm,
sal_Bool bBinary, short nBlockLen, sal_Bool bIsArray )
{
- sal_uIntPtr nFPos = pStrm->Tell();
+ sal_Size nFPos = pStrm->Tell();
sal_Bool bIsVariant = !rVar.IsFixed();
SbxDataType eType = rVar.GetType();
@@ -1089,7 +1089,7 @@ static sal_Bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
double aDouble;
- sal_uIntPtr nFPos = pStrm->Tell();
+ sal_Size nFPos = pStrm->Tell();
sal_Bool bIsVariant = !rVar.IsFixed();
SbxDataType eVarType = rVar.GetType();
@@ -1259,7 +1259,7 @@ void PutGet( SbxArray& rPar, sal_Bool bPut )
if( bHasRecordNo )
{
- sal_uIntPtr nFilePos = bRandom ? (sal_uIntPtr)(nBlockLen*nRecordNo) : (sal_uIntPtr)nRecordNo;
+ sal_Size nFilePos = bRandom ? (sal_Size)(nBlockLen * nRecordNo) : (sal_Size)nRecordNo;
pStrm->Seek( nFilePos );
}
@@ -1275,7 +1275,7 @@ void PutGet( SbxArray& rPar, sal_Bool bPut )
if( pArr )
{
- sal_uIntPtr nFPos = pStrm->Tell();
+ sal_Size nFPos = pStrm->Tell();
short nDims = pArr->GetDims();
short* pDims = new short[ nDims ];
bRet = lcl_WriteReadSbxArray(*pArr,pStrm,!bRandom,nDims,pDims,bPut);
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index b6385180f532..7b50b63a0531 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -222,7 +222,7 @@ SbxBase* SbxBase::Load( SvStream& rStrm )
if( nFlags & SBX_RESERVED )
nFlags = ( nFlags & ~SBX_RESERVED ) | SBX_GBLSEARCH;
- sal_uIntPtr nOldPos = rStrm.Tell();
+ sal_Size nOldPos = rStrm.Tell();
rStrm.ReadUInt32( nSize );
SbxBase* p = Create( nSbxId, nCreator );
if( p )
@@ -230,7 +230,7 @@ SbxBase* SbxBase::Load( SvStream& rStrm )
p->nFlags = nFlags;
if( p->LoadData( rStrm, nVer ) )
{
- sal_uIntPtr nNewPos = rStrm.Tell();
+ sal_Size nNewPos = rStrm.Tell();
nOldPos += nSize;
DBG_ASSERT( nOldPos >= nNewPos, "SBX: Too much data loaded" );
if( nOldPos != nNewPos )
@@ -262,7 +262,7 @@ void SbxBase::Skip( SvStream& rStrm )
sal_uInt32 nCreator, nSize;
rStrm.ReadUInt32( nCreator ).ReadUInt16( nSbxId ).ReadUInt16( nFlags ).ReadUInt16( nVer );
- sal_uIntPtr nStartPos = rStrm.Tell();
+ sal_Size nStartPos = rStrm.Tell();
rStrm.ReadUInt32( nSize );
rStrm.Seek( nStartPos + nSize );
@@ -277,10 +277,10 @@ sal_Bool SbxBase::Store( SvStream& rStrm )
.WriteUInt16( (sal_uInt16) GetSbxId() )
.WriteUInt16( (sal_uInt16) GetFlags() )
.WriteUInt16( (sal_uInt16) GetVersion() );
- sal_uIntPtr nOldPos = rStrm.Tell();
+ sal_Size nOldPos = rStrm.Tell();
rStrm.WriteUInt32( (sal_uInt32) 0L );
sal_Bool bRes = StoreData( rStrm );
- sal_uIntPtr nNewPos = rStrm.Tell();
+ sal_Size nNewPos = rStrm.Tell();
rStrm.Seek( nOldPos );
rStrm.WriteUInt32( (sal_uInt32) ( nNewPos - nOldPos ) );
rStrm.Seek( nNewPos );
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 803efaf6fcef..acd894cc8a10 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -637,13 +637,13 @@ sal_Bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer )
OUString aDfltProp;
aClassName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US);
aDfltProp = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US);
- sal_uIntPtr nPos = rStrm.Tell();
+ sal_Size nPos = rStrm.Tell();
rStrm.ReadUInt32( nSize );
if( !LoadPrivateData( rStrm, nVer ) )
{
return sal_False;
}
- sal_uIntPtr nNewPos = rStrm.Tell();
+ sal_Size nNewPos = rStrm.Tell();
nPos += nSize;
DBG_ASSERT( nPos >= nNewPos, "SBX: Loaded too much data" );
if( nPos != nNewPos )
@@ -678,13 +678,13 @@ sal_Bool SbxObject::StoreData( SvStream& rStrm ) const
}
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aClassName, RTL_TEXTENCODING_ASCII_US);
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aDfltProp, RTL_TEXTENCODING_ASCII_US);
- sal_uIntPtr nPos = rStrm.Tell();
+ sal_Size nPos = rStrm.Tell();
rStrm.WriteUInt32( (sal_uInt32) 0L );
if( !StorePrivateData( rStrm ) )
{
return sal_False;
}
- sal_uIntPtr nNew = rStrm.Tell();
+ sal_Size nNew = rStrm.Tell();
rStrm.Seek( nPos );
rStrm.WriteUInt32( (sal_uInt32) ( nNew - nPos ) );
rStrm.Seek( nNew );
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 35df29c923df..dbea90488dc3 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -654,7 +654,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
SvMemoryStream aMemStream;
/*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream );
- sal_Int32 nSize = (sal_Int32)aMemStream.Tell();
+ sal_Size nSize = aMemStream.Tell();
Sequence< sal_Int8 > aBinSeq( nSize );
sal_Int8* pData = aBinSeq.getArray();
memcpy( pData, aMemStream.GetData(), nSize );
@@ -797,7 +797,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
SvMemoryStream aMemStream;
/*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream );
- sal_Int32 nSize = (sal_Int32)aMemStream.Tell();
+ sal_Size nSize = aMemStream.Tell();
Sequence< sal_Int8 > aBinSeq( nSize );
sal_Int8* pData = aBinSeq.getArray();
memcpy( pData, aMemStream.GetData(), nSize );