binaryurp/source/bridge.cxx | 15 ++++++------- binaryurp/source/bridge.hxx | 4 +-- binaryurp/source/incomingreply.hxx | 5 ++-- binaryurp/source/incomingrequest.cxx | 13 ++++++----- binaryurp/source/incomingrequest.hxx | 10 ++++---- binaryurp/source/outgoingrequest.hxx | 5 ++-- binaryurp/source/proxy.cxx | 7 +++--- binaryurp/source/proxy.hxx | 4 +-- binaryurp/source/unmarshal.cxx | 5 ++-- binaryurp/source/unmarshal.hxx | 2 - binaryurp/source/writer.cxx | 23 ++++++++++---------- binaryurp/source/writer.hxx | 15 ++++++------- bridges/inc/cppinterfaceproxy.hxx | 2 - bridges/inc/unointerfaceproxy.hxx | 2 - bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx | 5 ++-- bridges/source/cpp_uno/shared/unointerfaceproxy.cxx | 5 ++-- bridges/source/jni_uno/jni_base.h | 5 ++-- bridges/source/jni_uno/jni_uno2java.cxx | 7 +++--- bridges/source/jni_uno/nativethreadpool.cxx | 5 ++-- 19 files changed, 75 insertions(+), 64 deletions(-)
New commits: commit b36b225c6a2e73a6a8b7d353e69981a21d4bac77 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Sat May 21 13:15:18 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 21 17:30:08 2022 +0200 clang-tidy modernize-pass-by-value in binaryurp Change-Id: I1570ed8ace3e1684ad228efbd8b13d2fe9b0f2af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134706 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx index d06e7d29f31a..db6866ec1641 100644 --- a/binaryurp/source/bridge.cxx +++ b/binaryurp/source/bridge.cxx @@ -24,6 +24,7 @@ #include <cstddef> #include <limits> #include <memory> +#include <utility> #include <vector> #include <com/sun/star/bridge/InvalidProtocolChangeException.hpp> @@ -129,7 +130,7 @@ AttachThread::~AttachThread() { class PopOutgoingRequest { public: PopOutgoingRequest( - OutgoingRequests & requests, rtl::ByteSequence const & tid, + OutgoingRequests & requests, rtl::ByteSequence tid, OutgoingRequest const & request); ~PopOutgoingRequest(); @@ -146,9 +147,9 @@ private: }; PopOutgoingRequest::PopOutgoingRequest( - OutgoingRequests & requests, rtl::ByteSequence const & tid, + OutgoingRequests & requests, rtl::ByteSequence tid, OutgoingRequest const & request): - requests_(requests), tid_(tid), cleared_(false) + requests_(requests), tid_(std::move(tid)), cleared_(false) { requests_.push(tid_, request); } @@ -172,11 +173,11 @@ struct Bridge::SubStub { }; Bridge::Bridge( - rtl::Reference< BridgeFactory > const & factory, OUString const & name, + rtl::Reference< BridgeFactory > const & factory, OUString name, css::uno::Reference< css::connection::XConnection > const & connection, - css::uno::Reference< css::bridge::XInstanceProvider > const & provider): - factory_(factory), name_(name), connection_(connection), - provider_(provider), + css::uno::Reference< css::bridge::XInstanceProvider > provider): + factory_(factory), name_(std::move(name)), connection_(connection), + provider_(std::move(provider)), binaryUno_(UNO_LB_UNO), cppToBinaryMapping_(CPPU_CURRENT_LANGUAGE_BINDING_NAME, UNO_LB_UNO), binaryToCppMapping_(UNO_LB_UNO, CPPU_CURRENT_LANGUAGE_BINDING_NAME), diff --git a/binaryurp/source/bridge.hxx b/binaryurp/source/bridge.hxx index 2b5731b40497..9da6640fa126 100644 --- a/binaryurp/source/bridge.hxx +++ b/binaryurp/source/bridge.hxx @@ -71,11 +71,11 @@ class Bridge: public: Bridge( rtl::Reference< BridgeFactory > const & factory, - OUString const & name, + OUString name, com::sun::star::uno::Reference< com::sun::star::connection::XConnection > const & connection, com::sun::star::uno::Reference< - com::sun::star::bridge::XInstanceProvider > const & provider); + com::sun::star::bridge::XInstanceProvider > provider); void start(); diff --git a/binaryurp/source/incomingreply.hxx b/binaryurp/source/incomingreply.hxx index 420c5169adde..c2f5353fff4c 100644 --- a/binaryurp/source/incomingreply.hxx +++ b/binaryurp/source/incomingreply.hxx @@ -21,6 +21,7 @@ #include <sal/config.h> +#include <utility> #include <vector> #include "binaryany.hxx" @@ -33,9 +34,9 @@ private: IncomingReply& operator=(const IncomingReply&) = delete; public: IncomingReply( - bool theException, BinaryAny const & theReturnValue, + bool theException, BinaryAny theReturnValue, std::vector< BinaryAny >&& theOutArguments): - exception(theException), returnValue(theReturnValue), + exception(theException), returnValue(std::move(theReturnValue)), outArguments(std::move(theOutArguments)) {} diff --git a/binaryurp/source/incomingrequest.cxx b/binaryurp/source/incomingrequest.cxx index d75a61e46245..6f4107693b73 100644 --- a/binaryurp/source/incomingrequest.cxx +++ b/binaryurp/source/incomingrequest.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <cassert> +#include <utility> #include <vector> #include <com/sun/star/bridge/XInstanceProvider.hpp> @@ -43,14 +44,14 @@ namespace binaryurp { IncomingRequest::IncomingRequest( - rtl::Reference< Bridge > const & bridge, rtl::ByteSequence const & tid, - OUString const & oid, css::uno::UnoInterfaceReference const & object, - css::uno::TypeDescription const & type, sal_uInt16 functionId, + rtl::Reference< Bridge > const & bridge, rtl::ByteSequence tid, + OUString oid, css::uno::UnoInterfaceReference object, + css::uno::TypeDescription type, sal_uInt16 functionId, bool synchronous, css::uno::TypeDescription const & member, bool setter, std::vector< BinaryAny >&& inArguments, bool currentContextMode, - css::uno::UnoInterfaceReference const & currentContext): - bridge_(bridge), tid_(tid), oid_(oid), object_(object), type_(type), - member_(member), currentContext_(currentContext), + css::uno::UnoInterfaceReference currentContext): + bridge_(bridge), tid_(std::move(tid)), oid_(std::move(oid)), object_(std::move(object)), type_(std::move(type)), + member_(member), currentContext_(std::move(currentContext)), inArguments_(std::move(inArguments)), functionId_(functionId), synchronous_(synchronous), setter_(setter), currentContextMode_(currentContextMode) { diff --git a/binaryurp/source/incomingrequest.hxx b/binaryurp/source/incomingrequest.hxx index 0423a04b6728..faff4f5a5c0c 100644 --- a/binaryurp/source/incomingrequest.hxx +++ b/binaryurp/source/incomingrequest.hxx @@ -43,14 +43,14 @@ private: IncomingRequest& operator=(const IncomingRequest&) = delete; public: IncomingRequest( - rtl::Reference< Bridge > const & bridge, rtl::ByteSequence const & tid, - OUString const & oid, - com::sun::star::uno::UnoInterfaceReference const & object, - com::sun::star::uno::TypeDescription const & type, + rtl::Reference< Bridge > const & bridge, rtl::ByteSequence tid, + OUString oid, + com::sun::star::uno::UnoInterfaceReference object, + com::sun::star::uno::TypeDescription type, sal_uInt16 functionId, bool synchronous, com::sun::star::uno::TypeDescription const & member, bool setter, std::vector< BinaryAny >&& inArguments, bool currentContextMode, - com::sun::star::uno::UnoInterfaceReference const & currentContext); + com::sun::star::uno::UnoInterfaceReference currentContext); ~IncomingRequest(); diff --git a/binaryurp/source/outgoingrequest.hxx b/binaryurp/source/outgoingrequest.hxx index eb2c8a7e5212..efa673eac781 100644 --- a/binaryurp/source/outgoingrequest.hxx +++ b/binaryurp/source/outgoingrequest.hxx @@ -22,6 +22,7 @@ #include <sal/config.h> #include <typelib/typedescription.hxx> +#include <utility> namespace binaryurp { @@ -29,9 +30,9 @@ struct OutgoingRequest { enum Kind { KIND_NORMAL, KIND_REQUEST_CHANGE, KIND_COMMIT_CHANGE }; OutgoingRequest( - Kind theKind, com::sun::star::uno::TypeDescription const & theMember, + Kind theKind, com::sun::star::uno::TypeDescription theMember, bool theSetter): - member(theMember), kind(theKind), setter(theSetter) + member(std::move(theMember)), kind(theKind), setter(theSetter) {} com::sun::star::uno::TypeDescription member; diff --git a/binaryurp/source/proxy.cxx b/binaryurp/source/proxy.cxx index 7602800cb34e..49705e06aa89 100644 --- a/binaryurp/source/proxy.cxx +++ b/binaryurp/source/proxy.cxx @@ -21,6 +21,7 @@ #include <cassert> #include <exception> +#include <utility> #include <vector> #include <cppuhelper/exc_hlp.hxx> @@ -64,9 +65,9 @@ extern "C" void proxy_dispatchInterface( } Proxy::Proxy( - rtl::Reference< Bridge > const & bridge, OUString const & oid, - css::uno::TypeDescription const & type): - bridge_(bridge), oid_(oid), type_(type), references_(1) + rtl::Reference< Bridge > const & bridge, OUString oid, + css::uno::TypeDescription type): + bridge_(bridge), oid_(std::move(oid)), type_(std::move(type)), references_(1) { assert(bridge.is()); acquire = &proxy_acquireInterface; diff --git a/binaryurp/source/proxy.hxx b/binaryurp/source/proxy.hxx index cf9e1262a8c3..4e1fa3656ecc 100644 --- a/binaryurp/source/proxy.hxx +++ b/binaryurp/source/proxy.hxx @@ -39,8 +39,8 @@ namespace binaryurp { class Proxy: public uno_Interface { public: Proxy( - rtl::Reference< Bridge > const & bridge, OUString const & oid, - com::sun::star::uno::TypeDescription const & type); + rtl::Reference< Bridge > const & bridge, OUString oid, + com::sun::star::uno::TypeDescription type); const OUString& getOid() const { return oid_;} diff --git a/binaryurp/source/unmarshal.cxx b/binaryurp/source/unmarshal.cxx index 4263edf8c91c..7d943d37b704 100644 --- a/binaryurp/source/unmarshal.cxx +++ b/binaryurp/source/unmarshal.cxx @@ -22,6 +22,7 @@ #include <cassert> #include <cstdlib> #include <new> +#include <utility> #include <vector> #include <com/sun/star/io/IOException.hpp> @@ -90,9 +91,9 @@ std::vector< BinaryAny >::iterator copyMemberValues( } Unmarshal::Unmarshal( - rtl::Reference< Bridge > const & bridge, ReaderState & state, + rtl::Reference< Bridge > bridge, ReaderState & state, css::uno::Sequence< sal_Int8 > const & buffer): - bridge_(bridge), state_(state), buffer_(buffer) + bridge_(std::move(bridge)), state_(state), buffer_(buffer) { data_ = reinterpret_cast< sal_uInt8 const * >(buffer_.getConstArray()); end_ = data_ + buffer_.getLength(); diff --git a/binaryurp/source/unmarshal.hxx b/binaryurp/source/unmarshal.hxx index c5b91eebb07a..1972c30d0e74 100644 --- a/binaryurp/source/unmarshal.hxx +++ b/binaryurp/source/unmarshal.hxx @@ -40,7 +40,7 @@ namespace binaryurp { class Unmarshal { public: Unmarshal( - rtl::Reference< Bridge > const & bridge, ReaderState & state, + rtl::Reference< Bridge > bridge, ReaderState & state, com::sun::star::uno::Sequence< sal_Int8 > const & buffer); ~Unmarshal(); diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx index 7749ce30c17d..539d8a2c532f 100644 --- a/binaryurp/source/writer.cxx +++ b/binaryurp/source/writer.cxx @@ -24,6 +24,7 @@ #include <cstring> #include <exception> #include <limits> +#include <utility> #include <vector> #include <com/sun/star/connection/XConnection.hpp> @@ -50,24 +51,24 @@ Writer::Item::Item() {} Writer::Item::Item( - rtl::ByteSequence const & theTid, OUString const & theOid, - css::uno::TypeDescription const & theType, - css::uno::TypeDescription const & theMember, + rtl::ByteSequence theTid, OUString theOid, + css::uno::TypeDescription theType, + css::uno::TypeDescription theMember, std::vector< BinaryAny >&& inArguments, - css::uno::UnoInterfaceReference const & theCurrentContext): - tid(theTid), oid(theOid), type(theType), member(theMember), - currentContext(theCurrentContext), arguments(std::move(inArguments)), + css::uno::UnoInterfaceReference theCurrentContext): + tid(std::move(theTid)), oid(std::move(theOid)), type(std::move(theType)), member(std::move(theMember)), + currentContext(std::move(theCurrentContext)), arguments(std::move(inArguments)), request(true), setter(false), exception(false), setCurrentContextMode(false) {} Writer::Item::Item( - rtl::ByteSequence const & theTid, - css::uno::TypeDescription const & theMember, bool theSetter, - bool theException, BinaryAny const & theReturnValue, + rtl::ByteSequence theTid, + css::uno::TypeDescription theMember, bool theSetter, + bool theException, BinaryAny theReturnValue, std::vector< BinaryAny >&& outArguments, bool theSetCurrentContextMode): - tid(theTid), member(theMember), - returnValue(theReturnValue), arguments(std::move(outArguments)), + tid(std::move(theTid)), member(std::move(theMember)), + returnValue(std::move(theReturnValue)), arguments(std::move(outArguments)), request(false), setter(theSetter), exception(theException), setCurrentContextMode(theSetCurrentContextMode) {} diff --git a/binaryurp/source/writer.hxx b/binaryurp/source/writer.hxx index ca3f8cccfec3..e2061502a015 100644 --- a/binaryurp/source/writer.hxx +++ b/binaryurp/source/writer.hxx @@ -104,18 +104,17 @@ private: // Request: Item( - rtl::ByteSequence const & theTid, OUString const & theOid, - com::sun::star::uno::TypeDescription const & theType, - com::sun::star::uno::TypeDescription const & theMember, + rtl::ByteSequence theTid, OUString theOid, + com::sun::star::uno::TypeDescription theType, + com::sun::star::uno::TypeDescription theMember, std::vector< BinaryAny >&& inArguments, - com::sun::star::uno::UnoInterfaceReference const & - theCurrentContext); + com::sun::star::uno::UnoInterfaceReference theCurrentContext); // Reply: Item( - rtl::ByteSequence const & theTid, - com::sun::star::uno::TypeDescription const & theMember, - bool theSetter, bool theException, BinaryAny const & theReturnValue, + rtl::ByteSequence theTid, + com::sun::star::uno::TypeDescription theMember, + bool theSetter, bool theException, BinaryAny theReturnValue, std::vector< BinaryAny >&& outArguments, bool theSetCurrentContextMode); commit 80fab1529a5680fcad4075e4363924cfb2f7213a Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Sat May 21 13:09:58 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 21 17:29:53 2022 +0200 clang-tidy modernize-pass-by-value in bridges Change-Id: I6c52316e46117aacb22a2adcb75841aed834041f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134705 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/bridges/inc/cppinterfaceproxy.hxx b/bridges/inc/cppinterfaceproxy.hxx index 73175d842df1..5b5c85dc7dd5 100644 --- a/bridges/inc/cppinterfaceproxy.hxx +++ b/bridges/inc/cppinterfaceproxy.hxx @@ -72,7 +72,7 @@ private: CppInterfaceProxy( Bridge * pBridge_, uno_Interface * pUnoI_, typelib_InterfaceTypeDescription * pTypeDescr_, - OUString const & rOId_); + OUString aOId_); ~CppInterfaceProxy(); diff --git a/bridges/inc/unointerfaceproxy.hxx b/bridges/inc/unointerfaceproxy.hxx index b00d6ad61366..d20a7c3549fa 100644 --- a/bridges/inc/unointerfaceproxy.hxx +++ b/bridges/inc/unointerfaceproxy.hxx @@ -76,7 +76,7 @@ private: UnoInterfaceProxy( Bridge * pBridge_, com::sun::star::uno::XInterface * pCppI_, typelib_InterfaceTypeDescription * pTypeDescr_, - OUString const & rOId_); + OUString aOId_); ~UnoInterfaceProxy(); diff --git a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx index e4ee7800a385..dad1ad8f7ac6 100644 --- a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx +++ b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx @@ -20,6 +20,7 @@ #include <cppinterfaceproxy.hxx> #include <bridge.hxx> +#include <utility> #include <vtablefactory.hxx> #include <com/sun/star/uno/XInterface.hpp> @@ -102,12 +103,12 @@ void CppInterfaceProxy::releaseProxy() CppInterfaceProxy::CppInterfaceProxy( bridges::cpp_uno::shared::Bridge * pBridge_, uno_Interface * pUnoI_, - typelib_InterfaceTypeDescription * pTypeDescr_, OUString const & rOId_) + typelib_InterfaceTypeDescription * pTypeDescr_, OUString aOId_) : nRef( 1 ) , pBridge( pBridge_ ) , pUnoI( pUnoI_ ) , pTypeDescr( pTypeDescr_ ) - , oid( rOId_ ) + , oid(std::move( aOId_ )) { pBridge->acquire(); ::typelib_typedescription_acquire( &pTypeDescr->aBase ); diff --git a/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx b/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx index 91578e9999d1..3c03c1cffc0f 100644 --- a/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx +++ b/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx @@ -22,6 +22,7 @@ #include <bridge.hxx> #include <com/sun/star/uno/XInterface.hpp> +#include <utility> #include <typelib/typedescription.h> #include <uno/dispatcher.h> @@ -93,12 +94,12 @@ UnoInterfaceProxy * UnoInterfaceProxy::create( UnoInterfaceProxy::UnoInterfaceProxy( bridges::cpp_uno::shared::Bridge * pBridge_, com::sun::star::uno::XInterface * pCppI_, - typelib_InterfaceTypeDescription * pTypeDescr_, OUString const & rOId_) + typelib_InterfaceTypeDescription * pTypeDescr_, OUString aOId_) : nRef( 1 ) , pBridge( pBridge_ ) , pCppI( pCppI_ ) , pTypeDescr( pTypeDescr_ ) - , oid( rOId_ ) + , oid(std::move( aOId_ )) { pBridge->acquire(); ::typelib_typedescription_acquire(&pTypeDescr->aBase); diff --git a/bridges/source/jni_uno/jni_base.h b/bridges/source/jni_uno/jni_base.h index 696ddd365533..0d02261adb2a 100644 --- a/bridges/source/jni_uno/jni_base.h +++ b/bridges/source/jni_uno/jni_base.h @@ -31,6 +31,7 @@ #include <rtl/alloc.h> #include <rtl/ustring.hxx> #include <sal/log.hxx> +#include <utility> #include <uno/environment.h> #include <typelib/typedescription.h> @@ -45,8 +46,8 @@ struct BridgeRuntimeError { OUString m_message; - explicit BridgeRuntimeError( OUString const & message ) - : m_message( message ) + explicit BridgeRuntimeError( OUString message ) + : m_message(std::move( message )) {} }; diff --git a/bridges/source/jni_uno/jni_uno2java.cxx b/bridges/source/jni_uno/jni_uno2java.cxx index b8b69789a2ce..8fd38ec31b15 100644 --- a/bridges/source/jni_uno/jni_uno2java.cxx +++ b/bridges/source/jni_uno/jni_uno2java.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/uno/RuntimeException.hpp> #include <rtl/ustrbuf.hxx> +#include <utility> #include "jni_bridge.h" #include "jniunoenvironmentdata.hxx" @@ -401,7 +402,7 @@ struct UNO_proxy : public uno_Interface // ctor inline UNO_proxy( JNI_context const & jni, Bridge const * bridge, - jobject javaI, jstring jo_oid, OUString const & oid, + jobject javaI, jstring jo_oid, OUString oid, JNI_interface_type_info const * info ); }; @@ -409,10 +410,10 @@ struct UNO_proxy : public uno_Interface inline UNO_proxy::UNO_proxy( JNI_context const & jni, Bridge const * bridge, - jobject javaI, jstring jo_oid, OUString const & oid, + jobject javaI, jstring jo_oid, OUString oid, JNI_interface_type_info const * info ) : m_ref( 1 ), - m_oid( oid ), + m_oid(std::move( oid )), m_type_info( info ) { JNI_info const * jni_info = bridge->getJniInfo(); diff --git a/bridges/source/jni_uno/nativethreadpool.cxx b/bridges/source/jni_uno/nativethreadpool.cxx index 4fe4a0a2fb8d..1d14c47bb0ad 100644 --- a/bridges/source/jni_uno/nativethreadpool.cxx +++ b/bridges/source/jni_uno/nativethreadpool.cxx @@ -29,6 +29,7 @@ #include <jni.h> #include <new> +#include <utility> /* The native implementation part of * jurt/com/sun/star/lib/uno/environments/remote/NativeThreadPool.java. @@ -37,9 +38,9 @@ namespace { struct Pool { - Pool(rtl::Reference< jvmaccess::VirtualMachine > const & theVirtualMachine, + Pool(rtl::Reference< jvmaccess::VirtualMachine > theVirtualMachine, jmethodID theExecute, uno_ThreadPool thePool): - virtualMachine(theVirtualMachine), execute(theExecute), pool(thePool) {} + virtualMachine(std::move(theVirtualMachine)), execute(theExecute), pool(thePool) {} rtl::Reference< jvmaccess::VirtualMachine > virtualMachine; jmethodID execute;