diff options
author | Sven Gothel <[email protected]> | 2022-11-27 15:44:40 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-11-27 15:44:40 +0100 |
commit | 9d863d14db95d3c30f0b41b8ce3ed89275934f1d (patch) | |
tree | 6c27fd7cfea1359badd52b56d5f8a069891d26d3 /src/direct_bt | |
parent | 52c096d79131b7a3c4070534b1e6f4a8104d0737 (diff) |
clang-tidy: cover modernize-pass-by-value, handle modernize-use-equals-delete
Diffstat (limited to 'src/direct_bt')
-rw-r--r-- | src/direct_bt/BTGattServerHandler.cpp | 5 | ||||
-rw-r--r-- | src/direct_bt/L2CAPComm.cpp | 20 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/direct_bt/BTGattServerHandler.cpp b/src/direct_bt/BTGattServerHandler.cpp index b9c049f6..16851067 100644 --- a/src/direct_bt/BTGattServerHandler.cpp +++ b/src/direct_bt/BTGattServerHandler.cpp @@ -135,7 +135,7 @@ class DBGattServerHandler : public BTGattHandler::GattServerHandler { public: DBGattServerHandler(BTGattHandler& gh_, DBGattServerRef gsd) noexcept - : gh(gh_), gattServerData(gsd) {} + : gh(gh_), gattServerData(std::move(gsd)) {} ~DBGattServerHandler() override { close_impl(); } @@ -956,7 +956,8 @@ class FwdGattServerHandler : public BTGattHandler::GattServerHandler { public: FwdGattServerHandler(BTGattHandler& gh_, BTDeviceRef fwdServer_) noexcept - : gh(gh_), fwdServer(fwdServer_) { + : gh(gh_), fwdServer(std::move(fwdServer_)) + { fwd_gh = fwdServer->getGattHandler(); } diff --git a/src/direct_bt/L2CAPComm.cpp b/src/direct_bt/L2CAPComm.cpp index cb8bbc22..a0f9d90d 100644 --- a/src/direct_bt/L2CAPComm.cpp +++ b/src/direct_bt/L2CAPComm.cpp @@ -144,10 +144,10 @@ int L2CAPComm::l2cap_close_dev(int dd) noexcept return ::close(dd); } -L2CAPComm::L2CAPComm(const uint16_t adev_id_, const BDAddressAndType& localAddressAndType_, const L2CAP_PSM psm_, const L2CAP_CID cid_) noexcept +L2CAPComm::L2CAPComm(const uint16_t adev_id_, BDAddressAndType localAddressAndType_, const L2CAP_PSM psm_, const L2CAP_CID cid_) noexcept : env(L2CAPEnv::get()), adev_id(adev_id_), - localAddressAndType(localAddressAndType_), + localAddressAndType(std::move(localAddressAndType_)), psm(psm_), cid(cid_), socket_(-1), is_open_(false), interrupted_intern(false), is_interrupted_extern(/* Null Type */) @@ -250,16 +250,16 @@ BTSecurityLevel L2CAPComm::getBTSecurityLevelImpl(const BDAddressAndType& remote // ************************************************* // ************************************************* -L2CAPClient::L2CAPClient(const uint16_t adev_id_, const BDAddressAndType& adapterAddressAndType_, const L2CAP_PSM psm_, const L2CAP_CID cid_) noexcept -: L2CAPComm(adev_id_, adapterAddressAndType_, psm_, cid_), +L2CAPClient::L2CAPClient(const uint16_t adev_id_, BDAddressAndType adapterAddressAndType_, const L2CAP_PSM psm_, const L2CAP_CID cid_) noexcept +: L2CAPComm(adev_id_, std::move(adapterAddressAndType_), psm_, cid_), remoteAddressAndType(BDAddressAndType::ANY_BREDR_DEVICE), has_ioerror(false), tid_connect(0), tid_read(0) { } -L2CAPClient::L2CAPClient(const uint16_t adev_id_, const BDAddressAndType& adapterAddressAndType_, const L2CAP_PSM psm_, const L2CAP_CID cid_, - const BDAddressAndType& remoteAddressAndType_, int client_socket_) noexcept -: L2CAPComm(adev_id_, adapterAddressAndType_, psm_, cid_), - remoteAddressAndType(remoteAddressAndType_), +L2CAPClient::L2CAPClient(const uint16_t adev_id_, BDAddressAndType adapterAddressAndType_, const L2CAP_PSM psm_, const L2CAP_CID cid_, + BDAddressAndType remoteAddressAndType_, int client_socket_) noexcept +: L2CAPComm(adev_id_, std::move(adapterAddressAndType_), psm_, cid_), + remoteAddressAndType(std::move(remoteAddressAndType_)), has_ioerror(false), tid_connect(0), tid_read(0) { socket_ = client_socket_; @@ -723,8 +723,8 @@ std::string L2CAPClient::toString() const noexcept { // ************************************************* // ************************************************* -L2CAPServer::L2CAPServer(const uint16_t adev_id_, const BDAddressAndType& localAddressAndType_, const L2CAP_PSM psm_, const L2CAP_CID cid_) noexcept -: L2CAPComm(adev_id_, localAddressAndType_, psm_, cid_), tid_accept(0) +L2CAPServer::L2CAPServer(const uint16_t adev_id_, BDAddressAndType localAddressAndType_, const L2CAP_PSM psm_, const L2CAP_CID cid_) noexcept +: L2CAPComm(adev_id_, std::move(localAddressAndType_), psm_, cid_), tid_accept(0) { } bool L2CAPServer::open() noexcept { |