cppu/source/helper/purpenv/Proxy.hxx                |    2 -
 cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx |    5 ++-
 cppu/source/threadpool/thread.cxx                   |    9 +++---
 cppu/source/threadpool/thread.hxx                   |    4 +-
 cppu/source/threadpool/threadpool.cxx               |    3 +-
 cppu/source/threadpool/threadpool.hxx               |    2 -
 cppu/source/uno/IdentityMapping.cxx                 |    7 ++---
 cppu/source/uno/lbenv.cxx                           |    7 ++---
 cppu/source/uno/lbmap.cxx                           |   27 ++++++++++----------
 9 files changed, 36 insertions(+), 30 deletions(-)

New commits:
commit e0559fb4c97208f39fedebdf7e4fcd084a165318
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue May 17 13:57:08 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue May 17 17:36:36 2022 +0200

    clang-tidy modernize-pass-by-value in cppu
    
    Change-Id: I7f6432b9609d175ff7e21ff2e73991275eea60b2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134473
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/cppu/source/helper/purpenv/Proxy.hxx 
b/cppu/source/helper/purpenv/Proxy.hxx
index 953abbf3b449..02c65a23a198 100644
--- a/cppu/source/helper/purpenv/Proxy.hxx
+++ b/cppu/source/helper/purpenv/Proxy.hxx
@@ -47,7 +47,7 @@ class Proxy : public uno_Interface
     void                              * m_pProbeContext;
 
 public:
-    explicit Proxy(css::uno::Mapping                    const & to_from,
+    explicit Proxy(css::uno::Mapping                        to_from,
                    uno_Environment                        * pTo,
                    uno_Environment                        * pFrom,
                    uno_Interface                          * pUnoI,
diff --git a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx 
b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
index f62241fe13d6..db4820fc9a45 100644
--- a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
+++ b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
@@ -23,6 +23,7 @@
 #include <sal/log.hxx>
 #include <uno/dispatcher.h>
 #include <typelib/typedescription.hxx>
+#include <utility>
 
 using namespace com::sun::star;
 
@@ -188,7 +189,7 @@ static void s_acquireAndRegister_v(va_list * pParam)
 }
 }
 
-Proxy::Proxy(uno::Mapping                  const & to_from,
+Proxy::Proxy(uno::Mapping                          to_from,
              uno_Environment                     * pTo,
              uno_Environment                     * pFrom,
              uno_Interface                       * pUnoI,
@@ -201,7 +202,7 @@ Proxy::Proxy(uno::Mapping                  const & to_from,
           m_from         (pFrom),
           m_to           (pTo),
           m_from_to      (pFrom, pTo),
-          m_to_from      (to_from),
+          m_to_from      (std::move(to_from)),
           m_pUnoI        (pUnoI),
           m_pTypeDescr   (pTypeDescr),
           m_aOId         (rOId),
diff --git a/cppu/source/threadpool/thread.cxx 
b/cppu/source/threadpool/thread.cxx
index c0c3bc9ae61d..56e52838be85 100644
--- a/cppu/source/threadpool/thread.cxx
+++ b/cppu/source/threadpool/thread.cxx
@@ -24,6 +24,7 @@
 #include <osl/diagnose.h>
 #include <uno/threadpool.h>
 #include <sal/log.hxx>
+#include <utility>
 
 #include "thread.hxx"
 #include "jobqueue.hxx"
@@ -90,13 +91,13 @@ namespace cppu_threadpool {
     }
 
 
-    ORequestThread::ORequestThread( ThreadPoolHolder const &aThreadPool,
+    ORequestThread::ORequestThread( ThreadPoolHolder aThreadPool,
                                     JobQueue *pQueue,
-                                    const ByteSequence &aThreadId,
+                                    ByteSequence aThreadId,
                                     bool bAsynchron )
-        : m_aThreadPool( aThreadPool )
+        : m_aThreadPool(std::move( aThreadPool ))
         , m_pQueue( pQueue )
-        , m_aThreadId( aThreadId )
+        , m_aThreadId(std::move( aThreadId ))
         , m_bAsynchron( bAsynchron )
     {}
 
diff --git a/cppu/source/threadpool/thread.hxx 
b/cppu/source/threadpool/thread.hxx
index 9873c214737e..5d03de88e103 100644
--- a/cppu/source/threadpool/thread.hxx
+++ b/cppu/source/threadpool/thread.hxx
@@ -35,9 +35,9 @@ namespace cppu_threadpool {
         public salhelper::SimpleReferenceObject, public osl::Thread
     {
     public:
-        ORequestThread( ThreadPoolHolder const &aThreadPool,
+        ORequestThread( ThreadPoolHolder aThreadPool,
                         JobQueue * ,
-                        const ::rtl::ByteSequence &aThreadId,
+                        ::rtl::ByteSequence aThreadId,
                         bool bAsynchron );
         virtual ~ORequestThread() override;
 
diff --git a/cppu/source/threadpool/threadpool.cxx 
b/cppu/source/threadpool/threadpool.cxx
index 512ddb095cd2..897bebed9ac4 100644
--- a/cppu/source/threadpool/threadpool.cxx
+++ b/cppu/source/threadpool/threadpool.cxx
@@ -22,6 +22,7 @@
 #include <cassert>
 #include <chrono>
 #include <algorithm>
+#include <utility>
 #include <unordered_map>
 
 #include <osl/diagnose.h>
@@ -39,7 +40,7 @@ using namespace ::rtl;
 namespace cppu_threadpool
 {
     WaitingThread::WaitingThread(
-        rtl::Reference<ORequestThread> const & theThread): thread(theThread)
+        rtl::Reference<ORequestThread> theThread): thread(std::move(theThread))
     {}
 
     DisposedCallerAdminHolder const & DisposedCallerAdmin::getInstance()
diff --git a/cppu/source/threadpool/threadpool.hxx 
b/cppu/source/threadpool/threadpool.hxx
index 15d092a21062..afcae7a7e351 100644
--- a/cppu/source/threadpool/threadpool.hxx
+++ b/cppu/source/threadpool/threadpool.hxx
@@ -69,7 +69,7 @@ namespace cppu_threadpool {
         rtl::Reference< ORequestThread > thread;
 
         explicit WaitingThread(
-            rtl::Reference<ORequestThread> const & theThread);
+            rtl::Reference<ORequestThread> theThread);
     };
 
     typedef std::deque< struct ::cppu_threadpool::WaitingThread * > 
WaitingThreadDeque;
diff --git a/cppu/source/uno/IdentityMapping.cxx 
b/cppu/source/uno/IdentityMapping.cxx
index c6dab40cefe8..32ec32c073d3 100644
--- a/cppu/source/uno/IdentityMapping.cxx
+++ b/cppu/source/uno/IdentityMapping.cxx
@@ -22,6 +22,7 @@
 #include <typelib/typedescription.h>
 #include <uno/mapping.h>
 #include <uno/environment.hxx>
+#include <utility>
 
 #include <osl/interlck.h>
 
@@ -35,7 +36,7 @@ struct IdentityMapping : public uno_Mapping
     sal_Int32        m_nRef;
     uno::Environment m_env;
 
-    explicit IdentityMapping(uno::Environment const & rEnv);
+    explicit IdentityMapping(uno::Environment aEnv);
 };
 
 }
@@ -86,9 +87,9 @@ static void s_mapInterface(uno_Mapping                       
* pMapping,
 }
 
 
-IdentityMapping::IdentityMapping(uno::Environment const & rEnv)
+IdentityMapping::IdentityMapping(uno::Environment aEnv)
     : m_nRef(0),
-      m_env(rEnv)
+      m_env(std::move(aEnv))
 {
     uno_Mapping::acquire        = s_acquire;
     uno_Mapping::release        = s_release;
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index f19d8e725e4f..dd29951a6276 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -42,6 +42,7 @@
 
 #include <string_view>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 #include <stdio.h>
 
@@ -78,7 +79,7 @@ struct ObjectEntry
     sal_Int32 nRef;
     bool mixedObject;
 
-    explicit ObjectEntry( const OUString & rOId_ );
+    explicit ObjectEntry( OUString aOId_ );
 
     void append(
         uno_DefaultEnvironment * pEnv,
@@ -147,8 +148,8 @@ struct uno_DefaultEnvironment : public uno_ExtEnvironment
 };
 
 
-ObjectEntry::ObjectEntry( OUString const & rOId_ )
-    : oid( rOId_ ),
+ObjectEntry::ObjectEntry( OUString aOId_ )
+    : oid(std::move( aOId_ )),
       nRef( 0 ),
       mixedObject( false )
 {
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index 102ef135ef1a..b056193de7b3 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -27,6 +27,7 @@
 #include <mutex>
 #include <set>
 #include <unordered_map>
+#include <utility>
 
 #include <rtl/ustring.hxx>
 #include <rtl/ustrbuf.hxx>
@@ -125,11 +126,11 @@ struct MappingEntry
 
     MappingEntry(
         uno_Mapping * pMapping_, uno_freeMappingFunc freeMapping_,
-        const OUString & rMappingName_ )
+        OUString aMappingName_ )
         : nRef( 1 )
         , pMapping( pMapping_ )
         , freeMapping( freeMapping_ )
-        , aMappingName( rMappingName_ )
+        , aMappingName(std::move( aMappingName_ ))
         {}
 };
 
@@ -192,9 +193,9 @@ struct uno_Mediate_Mapping : public uno_Mapping
     OUString    aAddPurpose;
 
     uno_Mediate_Mapping(
-        const Environment & rFrom_, const Environment & rTo_,
-        const Mapping & rFrom2Uno_, const Mapping & rUno2To_,
-        const OUString & rAddPurpose );
+        Environment aFrom_, Environment aTo_,
+        Mapping aFrom2Uno_, Mapping aUno2To_,
+        OUString aAddPurpose );
 };
 
 }
@@ -265,15 +266,15 @@ static void mediate_mapInterface(
 }
 
 uno_Mediate_Mapping::uno_Mediate_Mapping(
-    const Environment & rFrom_, const Environment & rTo_,
-    const Mapping & rFrom2Uno_, const Mapping & rUno2To_,
-    const OUString & rAddPurpose_ )
+    Environment aFrom_, Environment aTo_,
+    Mapping aFrom2Uno_, Mapping aUno2To_,
+    OUString aAddPurpose_ )
     : nRef( 1 )
-    , aFrom( rFrom_ )
-    , aTo( rTo_ )
-    , aFrom2Uno( rFrom2Uno_ )
-    , aUno2To( rUno2To_ )
-    , aAddPurpose( rAddPurpose_ )
+    , aFrom(std::move( aFrom_ ))
+    , aTo(std::move( aTo_ ))
+    , aFrom2Uno(std::move( aFrom2Uno_ ))
+    , aUno2To(std::move( aUno2To_ ))
+    , aAddPurpose(std::move( aAddPurpose_ ))
 {
     uno_Mapping::acquire        = mediate_acquire;
     uno_Mapping::release        = mediate_release;

Reply via email to