summaryrefslogtreecommitdiff
path: root/binaryurp
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-21 13:15:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-21 17:30:08 +0200
commitb36b225c6a2e73a6a8b7d353e69981a21d4bac77 (patch)
treeb0e32dde398741b491556f0b31b38f29e6c951c1 /binaryurp
parent80fab1529a5680fcad4075e4363924cfb2f7213a (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'binaryurp')
-rw-r--r--binaryurp/source/bridge.cxx15
-rw-r--r--binaryurp/source/bridge.hxx4
-rw-r--r--binaryurp/source/incomingreply.hxx5
-rw-r--r--binaryurp/source/incomingrequest.cxx13
-rw-r--r--binaryurp/source/incomingrequest.hxx10
-rw-r--r--binaryurp/source/outgoingrequest.hxx5
-rw-r--r--binaryurp/source/proxy.cxx7
-rw-r--r--binaryurp/source/proxy.hxx4
-rw-r--r--binaryurp/source/unmarshal.cxx5
-rw-r--r--binaryurp/source/unmarshal.hxx2
-rw-r--r--binaryurp/source/writer.cxx23
-rw-r--r--binaryurp/source/writer.hxx15
12 files changed, 57 insertions, 51 deletions
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);