summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-28 11:15:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-29 09:00:52 +0200
commit6dbae37b8d2d2d1ecad85c772fd684803b5a52cb (patch)
treecb6637327913a5f9641c2c0065de4c6a00983947 /cppu
parentdc06c8f4989fc28d0c31ebd333e53dfe0e0f5f66 (diff)
loplugin:constantparam (1)
Change-Id: I25077e391ecca1b678062d261a83d88daadf0a58 Reviewed-on: https://gerrit.libreoffice.org/59701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/uno/sequence.cxx78
1 files changed, 39 insertions, 39 deletions
diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx
index 3420e5c8ec27..513ae613c93a 100644
--- a/cppu/source/uno/sequence.cxx
+++ b/cppu/source/uno/sequence.cxx
@@ -313,7 +313,7 @@ static inline bool idefaultConstructElements(
static inline bool icopyConstructFromElements(
uno_Sequence ** ppSeq, void * pSourceElements,
typelib_TypeDescriptionReference * pElementType,
- sal_Int32 nStartIndex, sal_Int32 nStopIndex,
+ sal_Int32 nStopIndex,
uno_AcquireFunc acquire,
sal_Int32 nAlloc )
{
@@ -325,9 +325,9 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
memcpy(
- pSeq->elements + (sizeof(sal_Unicode) * nStartIndex),
- static_cast<char *>(pSourceElements) + (sizeof(sal_Unicode) * nStartIndex),
- sizeof(sal_Unicode) * (nStopIndex - nStartIndex) );
+ pSeq->elements,
+ pSourceElements,
+ sizeof(sal_Unicode) * nStopIndex );
}
break;
case typelib_TypeClass_BOOLEAN:
@@ -335,9 +335,9 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
memcpy(
- pSeq->elements + (sizeof(sal_Bool) * nStartIndex),
- static_cast<char *>(pSourceElements) + (sizeof(sal_Bool) * nStartIndex),
- sizeof(sal_Bool) * (nStopIndex - nStartIndex) );
+ pSeq->elements,
+ pSourceElements,
+ sizeof(sal_Bool) * nStopIndex );
}
break;
case typelib_TypeClass_BYTE:
@@ -345,9 +345,9 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
memcpy(
- pSeq->elements + (sizeof(sal_Int8) * nStartIndex),
- static_cast<char *>(pSourceElements) + (sizeof(sal_Int8) * nStartIndex),
- sizeof(sal_Int8) * (nStopIndex - nStartIndex) );
+ pSeq->elements,
+ pSourceElements,
+ sizeof(sal_Int8) * nStopIndex );
}
break;
case typelib_TypeClass_SHORT:
@@ -356,9 +356,9 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
memcpy(
- pSeq->elements + (sizeof(sal_Int16) * nStartIndex),
- static_cast<char *>(pSourceElements) + (sizeof(sal_Int16) * nStartIndex),
- sizeof(sal_Int16) * (nStopIndex - nStartIndex) );
+ pSeq->elements,
+ pSourceElements,
+ sizeof(sal_Int16) * nStopIndex );
}
break;
case typelib_TypeClass_LONG:
@@ -367,9 +367,9 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
memcpy(
- pSeq->elements + (sizeof(sal_Int32) * nStartIndex),
- static_cast<char *>(pSourceElements) + (sizeof(sal_Int32) * nStartIndex),
- sizeof(sal_Int32) * (nStopIndex - nStartIndex) );
+ pSeq->elements,
+ pSourceElements,
+ sizeof(sal_Int32) * nStopIndex );
}
break;
case typelib_TypeClass_HYPER:
@@ -378,9 +378,9 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
memcpy(
- pSeq->elements + (sizeof(sal_Int64) * nStartIndex),
- static_cast<char *>(pSourceElements) + (sizeof(sal_Int64) * nStartIndex),
- sizeof(sal_Int64) * (nStopIndex - nStartIndex) );
+ pSeq->elements,
+ pSourceElements,
+ sizeof(sal_Int64) * nStopIndex );
}
break;
case typelib_TypeClass_FLOAT:
@@ -388,9 +388,9 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
memcpy(
- pSeq->elements + (sizeof(float) * nStartIndex),
- static_cast<char *>(pSourceElements) + (sizeof(float) * nStartIndex),
- sizeof(float) * (nStopIndex - nStartIndex) );
+ pSeq->elements,
+ pSourceElements,
+ sizeof(float) * nStopIndex );
}
break;
case typelib_TypeClass_DOUBLE:
@@ -398,9 +398,9 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
memcpy(
- pSeq->elements + (sizeof(double) * nStartIndex),
- static_cast<char *>(pSourceElements) + (sizeof(double) * nStartIndex),
- sizeof(double) * (nStopIndex - nStartIndex) );
+ pSeq->elements,
+ pSourceElements,
+ sizeof(double) * nStopIndex );
}
break;
case typelib_TypeClass_ENUM:
@@ -408,9 +408,9 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
memcpy(
- pSeq->elements + (sizeof(sal_Int32) * nStartIndex),
- static_cast<char *>(pSourceElements) + (sizeof(sal_Int32) * nStartIndex),
- sizeof(sal_Int32) * (nStopIndex - nStartIndex) );
+ pSeq->elements,
+ pSourceElements,
+ sizeof(sal_Int32) * nStopIndex );
}
break;
case typelib_TypeClass_STRING:
@@ -419,7 +419,7 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
rtl_uString ** pDestElements = reinterpret_cast<rtl_uString **>(pSeq->elements);
- for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos )
+ for ( sal_Int32 nPos = 0; nPos < nStopIndex; ++nPos )
{
// This code tends to trigger coverity's overrun-buffer-arg warning
// coverity[index_parm_via_loop_bound] - https://communities.coverity.com/thread/2993
@@ -438,7 +438,7 @@ static inline bool icopyConstructFromElements(
{
typelib_TypeDescriptionReference ** pDestElements =
reinterpret_cast<typelib_TypeDescriptionReference **>(pSeq->elements);
- for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos )
+ for ( sal_Int32 nPos = 0; nPos < nStopIndex; ++nPos )
{
TYPE_ACQUIRE(
static_cast<typelib_TypeDescriptionReference **>(
@@ -456,7 +456,7 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
uno_Any * pDestElements = reinterpret_cast<uno_Any *>(pSeq->elements);
- for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos )
+ for ( sal_Int32 nPos = 0; nPos < nStopIndex; ++nPos )
{
uno_Any * pSource = static_cast<uno_Any *>(pSourceElements) + nPos;
_copyConstructAny(
@@ -482,7 +482,7 @@ static inline bool icopyConstructFromElements(
typelib_CompoundTypeDescription * pTypeDescr =
reinterpret_cast<typelib_CompoundTypeDescription *>(pElementTypeDescr);
- for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos )
+ for ( sal_Int32 nPos = 0; nPos < nStopIndex; ++nPos )
{
char * pDest =
pDestElements + (nElementSize * nPos);
@@ -527,7 +527,7 @@ static inline bool icopyConstructFromElements(
typelib_TypeDescriptionReference * pSeqElementType =
reinterpret_cast<typelib_IndirectTypeDescription *>(pElementTypeDescr)->pType;
uno_Sequence ** pDestElements = reinterpret_cast<uno_Sequence **>(pSeq->elements);
- for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos )
+ for ( sal_Int32 nPos = 0; nPos < nStopIndex; ++nPos )
{
uno_Sequence * pNew = icopyConstructSequence(
static_cast<uno_Sequence **>(pSourceElements)[nPos],
@@ -547,7 +547,7 @@ static inline bool icopyConstructFromElements(
if (pSeq != nullptr)
{
void ** pDestElements = reinterpret_cast<void **>(pSeq->elements);
- for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos )
+ for ( sal_Int32 nPos = 0; nPos < nStopIndex; ++nPos )
{
_acquire( pDestElements[nPos] =
static_cast<void **>(pSourceElements)[nPos], acquire );
@@ -596,7 +596,7 @@ static inline bool ireallocSequence(
{
ret = icopyConstructFromElements(
&pNew, pSeq->elements, pElementType,
- 0, nCopy, acquire,
+ nCopy, acquire,
nSize ); // alloc to nSize
}
if (ret && nRest > 0)
@@ -683,7 +683,7 @@ sal_Bool SAL_CALL uno_type_sequence_construct(
{
ret = icopyConstructFromElements(
ppSequence, pElements, pElementType,
- 0, len, acquire,
+ len, acquire,
len ); // alloc to len
}
@@ -724,7 +724,7 @@ sal_Bool SAL_CALL uno_sequence_construct(
{
ret = icopyConstructFromElements(
ppSequence, pElements, pElementType,
- 0, len, acquire,
+ len, acquire,
len ); // alloc to len
}
}
@@ -800,7 +800,7 @@ sal_Bool SAL_CALL uno_type_sequence_reference2One(
ret = icopyConstructFromElements(
&pNew, pSequence->elements,
reinterpret_cast<typelib_IndirectTypeDescription *>(pTypeDescr)->pType,
- 0, pSequence->nElements, acquire,
+ pSequence->nElements, acquire,
pSequence->nElements ); // alloc nElements
if (ret)
{
@@ -844,7 +844,7 @@ sal_Bool SAL_CALL uno_sequence_reference2One(
ret = icopyConstructFromElements(
&pNew, pSequence->elements,
reinterpret_cast<typelib_IndirectTypeDescription *>(pTypeDescr)->pType,
- 0, pSequence->nElements, acquire,
+ pSequence->nElements, acquire,
pSequence->nElements ); // alloc nElements
if (ret)
{