diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-12 10:56:22 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-07-13 06:38:12 +0000 |
commit | c9b4e298137ed7c3112de533d44ddf56b1ebca6d (patch) | |
tree | e0afe5a2b31aa4cd04a40a364d7338a48f1d0535 | |
parent | 5ff1e6bdf7f5b9db3b72d62537047fc45b7d104b (diff) |
loplugin:constparams in tools
Change-Id: Iea05efbb90a0a95fefd18ae9673095a31422f06c
Reviewed-on: https://gerrit.libreoffice.org/27137
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | include/tools/b3dtrans.hxx | 4 | ||||
-rw-r--r-- | include/tools/fract.hxx | 2 | ||||
-rw-r--r-- | include/tools/globname.hxx | 2 | ||||
-rw-r--r-- | include/tools/multisel.hxx | 2 | ||||
-rw-r--r-- | include/tools/rc.hxx | 2 | ||||
-rw-r--r-- | include/tools/resmgr.hxx | 6 | ||||
-rw-r--r-- | include/tools/unqidx.hxx | 2 | ||||
-rw-r--r-- | include/tools/zcodec.hxx | 2 | ||||
-rw-r--r-- | svl/source/items/globalnameitem.cxx | 2 | ||||
-rw-r--r-- | tools/inc/poly.h | 2 | ||||
-rw-r--r-- | tools/source/generic/b3dtrans.cxx | 2 | ||||
-rw-r--r-- | tools/source/generic/fract.cxx | 2 | ||||
-rw-r--r-- | tools/source/generic/poly.cxx | 6 | ||||
-rw-r--r-- | tools/source/memtools/multisel.cxx | 2 | ||||
-rw-r--r-- | tools/source/memtools/unqidx.cxx | 2 | ||||
-rw-r--r-- | tools/source/rc/resmgr.cxx | 38 | ||||
-rw-r--r-- | tools/source/ref/errinf.cxx | 4 | ||||
-rw-r--r-- | tools/source/ref/globname.cxx | 2 | ||||
-rw-r--r-- | tools/source/stream/strmunx.cxx | 2 | ||||
-rw-r--r-- | tools/source/zcodec/zcodec.cxx | 2 |
20 files changed, 44 insertions, 44 deletions
diff --git a/include/tools/b3dtrans.hxx b/include/tools/b3dtrans.hxx index 6dabf504c310..8b47ba9ed90b 100644 --- a/include/tools/b3dtrans.hxx +++ b/include/tools/b3dtrans.hxx @@ -127,8 +127,8 @@ public: void SetPerspective(bool bNew); - void SetViewportRectangle(Rectangle& rRect, Rectangle& rVisible); - void SetViewportRectangle(Rectangle& rRect) { SetViewportRectangle(rRect, rRect); } + void SetViewportRectangle(Rectangle const & rRect, Rectangle const & rVisible); + void SetViewportRectangle(Rectangle const & rRect) { SetViewportRectangle(rRect, rRect); } void CalcViewport(); diff --git a/include/tools/fract.hxx b/include/tools/fract.hxx index adecddff35c3..65110d245388 100644 --- a/include/tools/fract.hxx +++ b/include/tools/fract.hxx @@ -71,7 +71,7 @@ public: TOOLS_DLLPUBLIC friend bool operator<=( const Fraction& rVal1, const Fraction& rVal2 ); TOOLS_DLLPUBLIC friend bool operator>=( const Fraction& rVal1, const Fraction& rVal2 ); - TOOLS_DLLPUBLIC friend SvStream& ReadFraction( SvStream& rIStream, Fraction& rFract ); + TOOLS_DLLPUBLIC friend SvStream& ReadFraction( SvStream& rIStream, Fraction const & rFract ); TOOLS_DLLPUBLIC friend SvStream& WriteFraction( SvStream& rOStream, const Fraction& rFract ); }; diff --git a/include/tools/globname.hxx b/include/tools/globname.hxx index 8c30b3745d47..42928a8ce112 100644 --- a/include/tools/globname.hxx +++ b/include/tools/globname.hxx @@ -85,7 +85,7 @@ public: bool operator != ( const SvGlobalName & rObj ) const { return !(*this == rObj); } - void MakeFromMemory( void * pData ); + void MakeFromMemory( void const * pData ); bool MakeId( const OUString & rId ); OUString GetHexName() const; diff --git a/include/tools/multisel.hxx b/include/tools/multisel.hxx index 2a8a656d4189..6159145e7ad5 100644 --- a/include/tools/multisel.hxx +++ b/include/tools/multisel.hxx @@ -164,7 +164,7 @@ public: sal_Int32 i_nMinNumber, sal_Int32 i_nMaxNumber, sal_Int32 i_nLogicalOffset = -1, - std::set< sal_Int32 >* i_pPossibleValues = nullptr + std::set< sal_Int32 > const * i_pPossibleValues = nullptr ); }; diff --git a/include/tools/rc.hxx b/include/tools/rc.hxx index 372b70b7675e..edb82ae4b7a8 100644 --- a/include/tools/rc.hxx +++ b/include/tools/rc.hxx @@ -52,7 +52,7 @@ protected: { return ResMgr::GetObjSize( pHT ); } // get a 32bit value from Resource data - static sal_Int32 GetLongRes( void * pLong ) + static sal_Int32 GetLongRes( void const * pLong ) { return ResMgr::GetLong( pLong ); } // read a 32bit value from resource data and increment pointer diff --git a/include/tools/resmgr.hxx b/include/tools/resmgr.hxx index b6561ef3068c..100ae4c8b7e3 100644 --- a/include/tools/resmgr.hxx +++ b/include/tools/resmgr.hxx @@ -174,11 +174,11 @@ public: static sal_uInt32 GetStringSize( const sal_uInt8* pStr, sal_uInt32& nLen ); /// Return a int64 - static sal_uInt64 GetUInt64( void* pDatum ); + static sal_uInt64 GetUInt64( void const * pDatum ); /// Return a long - static sal_Int32 GetLong( void * pLong ); + static sal_Int32 GetLong( void const * pLong ); /// Return a short - static sal_Int16 GetShort( void * pShort ); + static sal_Int16 GetShort( void const * pShort ); /// Return a pointer to the resource void * GetClass(); diff --git a/include/tools/unqidx.hxx b/include/tools/unqidx.hxx index 99c565540be7..2a83ed70ca72 100644 --- a/include/tools/unqidx.hxx +++ b/include/tools/unqidx.hxx @@ -42,7 +42,7 @@ public: void* Remove( Index aIndex ); void* Get( Index aIndex ) const; - Index GetIndexOf( void* p ) const; + Index GetIndexOf( void const* p ) const; Index FirstIndex() const; Index LastIndex() const; Index NextIndex( Index aCurrIndex ) const; diff --git a/include/tools/zcodec.hxx b/include/tools/zcodec.hxx index 7cce2a4fe122..d3c17792092d 100644 --- a/include/tools/zcodec.hxx +++ b/include/tools/zcodec.hxx @@ -55,7 +55,7 @@ class TOOLS_DLLPUBLIC ZCodec void InitCompress(); void InitDecompress(SvStream & inStream); void ImplWriteBack(); - void UpdateCRC( sal_uInt8* pSource, long nDatSize ); + void UpdateCRC( sal_uInt8 const * pSource, long nDatSize ); public: ZCodec( sal_uIntPtr nInBuf = 0x8000UL, sal_uIntPtr nOutBuf = 0x8000UL ); diff --git a/svl/source/items/globalnameitem.cxx b/svl/source/items/globalnameitem.cxx index e0239a5e9aa8..46b3972e283b 100644 --- a/svl/source/items/globalnameitem.cxx +++ b/svl/source/items/globalnameitem.cxx @@ -73,7 +73,7 @@ bool SfxGlobalNameItem::PutValue( const css::uno::Any& rVal, sal_uInt8 ) aNew >>= aSeq; if ( aSeq.getLength() == 16 ) { - m_aName.MakeFromMemory( const_cast<sal_Int8 *>(aSeq.getConstArray()) ); + m_aName.MakeFromMemory( aSeq.getConstArray() ); return true; } diff --git a/tools/inc/poly.h b/tools/inc/poly.h index 69d2de298563..63c6b738ddd4 100644 --- a/tools/inc/poly.h +++ b/tools/inc/poly.h @@ -42,7 +42,7 @@ public: void ImplSetSize( sal_uInt16 nSize, bool bResize = true ); void ImplCreateFlagArray(); - void ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon* pInitPoly = nullptr ); + void ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon const * pInitPoly = nullptr ); }; #define MAX_POLYGONS ((sal_uInt16)0x3FF0) diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx index 3d0d977cc9ef..c6364b7c23e1 100644 --- a/tools/source/generic/b3dtrans.cxx +++ b/tools/source/generic/b3dtrans.cxx @@ -327,7 +327,7 @@ void B3dTransformationSet::SetPerspective(bool bNew) } } -void B3dTransformationSet::SetViewportRectangle(Rectangle& rRect, Rectangle& rVisible) +void B3dTransformationSet::SetViewportRectangle(Rectangle const & rRect, Rectangle const & rVisible) { if(rRect != maViewportRectangle || rVisible != maVisibleRectangle) { diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx index 78069a54fb53..2a7ad54983eb 100644 --- a/tools/source/generic/fract.cxx +++ b/tools/source/generic/fract.cxx @@ -362,7 +362,7 @@ bool operator > ( const Fraction& rVal1, const Fraction& rVal2 ) return rVal1.mpImpl->value > rVal2.mpImpl->value; } -SvStream& ReadFraction( SvStream& rIStream, Fraction& rFract ) +SvStream& ReadFraction( SvStream& rIStream, Fraction const & rFract ) { sal_Int32 num(0), den(0); rIStream.ReadInt32( num ); diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 6d70f8af0760..25baea04fb9f 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -212,7 +212,7 @@ void ImplPolygon::ImplSetSize( sal_uInt16 nNewSize, bool bResize ) mnPoints = nNewSize; } -void ImplPolygon::ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon* pInitPoly ) +void ImplPolygon::ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon const * pInitPoly ) { //Can't fit this in :-(, throw ? if (mnPoints + nSpace > USHRT_MAX) @@ -1134,8 +1134,8 @@ public: Vector2D& operator-=( const Vector2D& rVec ) { mfX -= rVec.mfX; mfY -= rVec.mfY; return *this; } double Scalar( const Vector2D& rVec ) const { return mfX * rVec.mfX + mfY * rVec.mfY ; } Vector2D& Normalize(); - bool IsPositive( Vector2D& rVec ) const { return ( mfX * rVec.mfY - mfY * rVec.mfX ) >= 0.0; } - bool IsNegative( Vector2D& rVec ) const { return !IsPositive( rVec ); } + bool IsPositive( Vector2D const & rVec ) const { return ( mfX * rVec.mfY - mfY * rVec.mfX ) >= 0.0; } + bool IsNegative( Vector2D const & rVec ) const { return !IsPositive( rVec ); } }; Vector2D& Vector2D::Normalize() { diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx index ac32e372f8ef..47a78d3882ad 100644 --- a/tools/source/memtools/multisel.cxx +++ b/tools/source/memtools/multisel.cxx @@ -769,7 +769,7 @@ bool StringRangeEnumerator::getRangesFromString( const OUString& i_rPageRange, sal_Int32 i_nMinNumber, sal_Int32 i_nMaxNumber, sal_Int32 i_nLogicalOffset, - std::set< sal_Int32 >* i_pPossibleValues + std::set< sal_Int32 > const * i_pPossibleValues ) { o_rPageVector.clear(); diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index 7c57c1b4f3fe..7a2091601e5c 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -89,7 +89,7 @@ UniqueIndexImpl::Index UniqueIndexImpl::NextIndex(Index aIndex) const return it->first; } -UniqueIndexImpl::Index UniqueIndexImpl::GetIndexOf(void* p) const +UniqueIndexImpl::Index UniqueIndexImpl::GetIndexOf(void const * p) const { for( std::map<Index, void*>::const_iterator it = maMap.begin(); it != maMap.end(); ++it ) if( it->second == p ) diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index 078ad5bfbcf4..8385e280e7fc 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -101,7 +101,7 @@ class InternalResMgr void * LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId, void **pResHandle ); public: - static void FreeGlobalRes( void *, void * ); + static void FreeGlobalRes( void const *, void * ); }; class ResMgrContainer @@ -616,7 +616,7 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId, return nullptr; } -void InternalResMgr::FreeGlobalRes( void * pResHandle, void * pResource ) +void InternalResMgr::FreeGlobalRes( void const * pResHandle, void * pResource ) { if ( !pResHandle ) // Free allocated resource @@ -1115,30 +1115,30 @@ RSHEADER_TYPE* ResMgr::CreateBlock( const ResId& rId ) return pHeader; } -sal_Int16 ResMgr::GetShort( void * pShort ) +sal_Int16 ResMgr::GetShort( void const * pShort ) { - return ((*(static_cast<sal_uInt8*>(pShort) + 0) << 8) | - (*(static_cast<sal_uInt8*>(pShort) + 1) << 0) ); + return ((*(static_cast<const sal_uInt8*>(pShort) + 0) << 8) | + (*(static_cast<const sal_uInt8*>(pShort) + 1) << 0) ); } -sal_Int32 ResMgr::GetLong( void * pLong ) +sal_Int32 ResMgr::GetLong( void const * pLong ) { - return ((*(static_cast<sal_uInt8*>(pLong) + 0) << 24) | - (*(static_cast<sal_uInt8*>(pLong) + 1) << 16) | - (*(static_cast<sal_uInt8*>(pLong) + 2) << 8) | - (*(static_cast<sal_uInt8*>(pLong) + 3) << 0) ); + return ((*(static_cast<const sal_uInt8*>(pLong) + 0) << 24) | + (*(static_cast<const sal_uInt8*>(pLong) + 1) << 16) | + (*(static_cast<const sal_uInt8*>(pLong) + 2) << 8) | + (*(static_cast<const sal_uInt8*>(pLong) + 3) << 0) ); } -sal_uInt64 ResMgr::GetUInt64( void* pDatum ) +sal_uInt64 ResMgr::GetUInt64( void const * pDatum ) { - return ((sal_uInt64(*(static_cast<sal_uInt8*>(pDatum) + 0)) << 56) | - (sal_uInt64(*(static_cast<sal_uInt8*>(pDatum) + 1)) << 48) | - (sal_uInt64(*(static_cast<sal_uInt8*>(pDatum) + 2)) << 40) | - (sal_uInt64(*(static_cast<sal_uInt8*>(pDatum) + 3)) << 32) | - (sal_uInt64(*(static_cast<sal_uInt8*>(pDatum) + 4)) << 24) | - (sal_uInt64(*(static_cast<sal_uInt8*>(pDatum) + 5)) << 16) | - (sal_uInt64(*(static_cast<sal_uInt8*>(pDatum) + 6)) << 8) | - (sal_uInt64(*(static_cast<sal_uInt8*>(pDatum) + 7)) << 0) ); + return ((sal_uInt64(*(static_cast<const sal_uInt8*>(pDatum) + 0)) << 56) | + (sal_uInt64(*(static_cast<const sal_uInt8*>(pDatum) + 1)) << 48) | + (sal_uInt64(*(static_cast<const sal_uInt8*>(pDatum) + 2)) << 40) | + (sal_uInt64(*(static_cast<const sal_uInt8*>(pDatum) + 3)) << 32) | + (sal_uInt64(*(static_cast<const sal_uInt8*>(pDatum) + 4)) << 24) | + (sal_uInt64(*(static_cast<const sal_uInt8*>(pDatum) + 5)) << 16) | + (sal_uInt64(*(static_cast<const sal_uInt8*>(pDatum) + 6)) << 8) | + (sal_uInt64(*(static_cast<const sal_uInt8*>(pDatum) + 7)) << 0) ); } sal_uInt32 ResMgr::GetStringWithoutHook( OUString& rStr, const sal_uInt8* pStr ) diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx index 1091e40c32d9..4c3eb5209751 100644 --- a/tools/source/ref/errinf.cxx +++ b/tools/source/ref/errinf.cxx @@ -51,7 +51,7 @@ class DynamicErrorInfo_Impl sal_uInt16 nMask; void RegisterEDcr(DynamicErrorInfo *); - static void UnRegisterEDcr(DynamicErrorInfo *); + static void UnRegisterEDcr(DynamicErrorInfo const *); static ErrorInfo *GetDynamicErrorInfo(sal_uIntPtr lId); friend class DynamicErrorInfo; @@ -83,7 +83,7 @@ void DynamicErrorInfo_Impl::RegisterEDcr(DynamicErrorInfo *pDcr) rData.nNextDcr=0; } -void DynamicErrorInfo_Impl::UnRegisterEDcr(DynamicErrorInfo *pDcr) +void DynamicErrorInfo_Impl::UnRegisterEDcr(DynamicErrorInfo const *pDcr) { DynamicErrorInfo **ppDcr = TheEDcrData::get().ppDcr; sal_uIntPtr lIdx = (((sal_uIntPtr)(*pDcr) & ERRCODE_DYNAMIC_MASK) >> ERRCODE_DYNAMIC_SHIFT) - 1; diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index 8ba0b21c7b0a..f92a9f217e8e 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -160,7 +160,7 @@ bool SvGlobalName::operator == ( const SvGlobalName & rObj ) const return pImp == rObj.pImp; } -void SvGlobalName::MakeFromMemory( void * pData ) +void SvGlobalName::MakeFromMemory( void const * pData ) { memcpy( &pImp->szData, pData, sizeof( pImp->szData ) ); } diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index c47b7ebd5b2b..e26237e69606 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -145,7 +145,7 @@ bool lockFile( sal_Size nStart, sal_Size nEnd, SvFileStream* pStream ) return true; } -void unlockFile( sal_Size nStart, sal_Size nEnd, SvFileStream* pStream ) +void unlockFile( sal_Size nStart, sal_Size nEnd, SvFileStream const * pStream ) { osl::MutexGuard aGuard( LockMutex::get() ); std::vector<InternalStreamLock> &rLockList = LockList::get(); diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index 839ef4cf35f8..a20c0d6bfcb8 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -391,7 +391,7 @@ void ZCodec::InitDecompress(SvStream & inStream) mpInBuf = new sal_uInt8[ mnInBufSize ]; } -void ZCodec::UpdateCRC ( sal_uInt8* pSource, long nDatSize) +void ZCodec::UpdateCRC ( sal_uInt8 const * pSource, long nDatSize) { mnCRC = rtl_crc32( mnCRC, pSource, nDatSize ); } |