summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-19 10:41:38 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-19 15:16:15 +0000
commit545c6e9d4fa3209eefd3867077c5fe820f0675d0 (patch)
tree1c19c5411a69e7771e6e50f554f13a54215617bd /basic
parentecd82b5121899fe23f0ccbdd8a89c8b18436f027 (diff)
clear ARRAY_VS_SINGLETON coverity warnings
experiment to see if this clears them Change-Id: I91a74e06f621d3012b564cad87586ba74b0367ca
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbunoobj.cxx16
-rw-r--r--basic/source/runtime/methods.cxx8
-rw-r--r--basic/source/runtime/methods1.cxx16
-rw-r--r--basic/source/runtime/runtime.cxx8
4 files changed, 24 insertions, 24 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 56d07c36ef1a..c1de49aa1dee 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -883,11 +883,11 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
bool bNeedsInit = true;
sal_Int32 nSize = nUpper - nLower + 1;
- sal_Int32 nIdx = nLower;
- for( sal_Int32 i = 0 ; i < nSize ; i++,nIdx++ )
+ sal_Int32 aIdx[1];
+ aIdx[0] = nLower;
+ for (sal_Int32 i = 0; i < nSize; ++i, ++aIdx[0])
{
- // coverity[callee_ptr_arith]
- SbxVariableRef xVar = pArray->Get32( &nIdx );
+ SbxVariableRef xVar = pArray->Get32(aIdx);
Type aType = getUnoTypeForSbxValue( xVar.get() );
if( bNeedsInit )
{
@@ -1324,11 +1324,11 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
Type aElemType( reinterpret_cast<typelib_IndirectTypeDescription *>(pSeqTD)->pType );
// convert all array member and register them
- sal_Int32 nIdx = nLower;
- for( sal_Int32 i = 0 ; i < nSeqSize ; i++,nIdx++ )
+ sal_Int32 aIdx[1];
+ aIdx[0] = nLower;
+ for (sal_Int32 i = 0 ; i < nSeqSize; ++i, ++aIdx[0])
{
- // coverity[callee_ptr_arith]
- SbxVariableRef xVar = pArray->Get32( &nIdx );
+ SbxVariableRef xVar = pArray->Get32(aIdx);
// Convert the value of Sbx to Uno
Any aAnyValue = sbxToUnoValue( xVar.get(), aElemType );
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index a95cf5c9219a..ac4351cf62cd 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4359,13 +4359,13 @@ RTLFUNC(StrConv)
pNew->PutByte(*pChar);
pChar++;
pNew->SetFlag( SbxFlagBits::Write );
- short index = i;
+ short aIdx[1];
+ aIdx[0] = i;
if( bIncIndex )
{
- ++index;
+ ++aIdx[0];
}
- // coverity[callee_ptr_arith]
- pArray->Put( pNew, &index );
+ pArray->Put(pNew, aIdx);
}
SbxVariableRef refVar = rPar.Get(0);
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index eb0f245577ba..bad68c593f84 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -832,13 +832,13 @@ RTLFUNC(Array)
SbxVariable* pVar = rPar.Get(i+1);
SbxVariable* pNew = new SbxEnsureParentVariable(*pVar);
pNew->SetFlag( SbxFlagBits::Write );
- short index = static_cast< short >(i);
+ short aIdx[1];
+ aIdx[0] = static_cast< short >(i);
if ( bIncIndex )
{
- ++index;
+ ++aIdx[0];
}
- // coverity[callee_ptr_arith]
- pArray->Put( pNew, &index );
+ pArray->Put(pNew, aIdx);
}
// return array
@@ -1724,12 +1724,12 @@ RTLFUNC(Join)
OUString aRetStr;
short nLower, nUpper;
pArr->GetDim( 1, nLower, nUpper );
- for (short i = nLower; i <= nUpper; ++i)
+ short aIdx[1];
+ for (aIdx[0] = nLower; aIdx[0] <= nUpper; ++aIdx[0])
{
- // coverity[callee_ptr_arith]
- OUString aStr = pArr->Get( &i )->GetOUString();
+ OUString aStr = pArr->Get(aIdx)->GetOUString();
aRetStr += aStr;
- if( i != nUpper )
+ if (aIdx[0] != nUpper)
{
aRetStr += aDelim;
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 38d9a1eb4c77..e4febca102ea 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -639,12 +639,12 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
SbxDimArray* pArray = new SbxDimArray( SbxVARIANT );
sal_uInt16 nParamArrayParamCount = nParamCount - i;
pArray->unoAddDim( 0, nParamArrayParamCount - 1 );
- for( sal_uInt16 j = i ; j < nParamCount ; j++ )
+ for (sal_uInt16 j = i; j < nParamCount ; ++j)
{
SbxVariable* v = pParams->Get( j );
- short nDimIndex = j - i;
- // coverity[callee_ptr_arith]
- pArray->Put( v, &nDimIndex );
+ short aDimIndex[1];
+ aDimIndex[0] = j - i;
+ pArray->Put(v, aDimIndex);
}
SbxVariable* pArrayVar = new SbxVariable( SbxVARIANT );
pArrayVar->SetFlag( SbxFlagBits::ReadWrite );