[Libreoffice-commits] core.git: include/tools svl/source tools/inc tools/source

Noel Grandin noel at peralex.com
Wed Jul 13 06:38:35 UTC 2016


 include/tools/b3dtrans.hxx          |    4 +--
 include/tools/fract.hxx             |    2 -
 include/tools/globname.hxx          |    2 -
 include/tools/multisel.hxx          |    2 -
 include/tools/rc.hxx                |    2 -
 include/tools/resmgr.hxx            |    6 ++---
 include/tools/unqidx.hxx            |    2 -
 include/tools/zcodec.hxx            |    2 -
 svl/source/items/globalnameitem.cxx |    2 -
 tools/inc/poly.h                    |    2 -
 tools/source/generic/b3dtrans.cxx   |    2 -
 tools/source/generic/fract.cxx      |    2 -
 tools/source/generic/poly.cxx       |    6 ++---
 tools/source/memtools/multisel.cxx  |    2 -
 tools/source/memtools/unqidx.cxx    |    2 -
 tools/source/rc/resmgr.cxx          |   38 ++++++++++++++++++------------------
 tools/source/ref/errinf.cxx         |    4 +--
 tools/source/ref/globname.cxx       |    2 -
 tools/source/stream/strmunx.cxx     |    2 -
 tools/source/zcodec/zcodec.cxx      |    2 -
 20 files changed, 44 insertions(+), 44 deletions(-)

New commits:
commit c9b4e298137ed7c3112de533d44ddf56b1ebca6d
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Jul 12 10:56:22 2016 +0200

    loplugin:constparams in tools
    
    Change-Id: Iea05efbb90a0a95fefd18ae9673095a31422f06c
    Reviewed-on: https://gerrit.libreoffice.org/27137
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/tools/b3dtrans.hxx b/include/tools/b3dtrans.hxx
index 6dabf50..8b47ba9 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 adecddf..65110d2 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 8c30b37..42928a8 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 2a8a656..6159145 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 372b70b..edb82ae 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 b6561ef..100ae4c 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 99c5655..2a83ed70 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 7cce2a4..d3c1779 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 e0239a5..46b3972 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 69d2de2..63c6b73 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 3d0d977..c6364b7 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 78069a5..2a7ad54 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 6d70f8a..25baea0 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 ac32e37..47a78d3 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 7c57c1b..7a20916 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 078ad5b..8385e28 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 1091e40..4c3eb52 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 8ba0b21..f92a9f2 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 c47b7eb..e26237e 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 839ef4c..a20c0d6 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 );
 }


More information about the Libreoffice-commits mailing list