aboutsummaryrefslogtreecommitdiffstats
path: root/api/direct_bt
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-05-25 21:06:35 +0200
committerSven Göthel <[email protected]>2024-05-25 21:06:35 +0200
commit4941d6ea8d7f945a5b345126c3d4f1b66b11dd78 (patch)
treec5600a7436e70c63c83194eac7ce69c0765ba101 /api/direct_bt
parentac8261e7c72532de8bb4e98569377b2c624c8cf9 (diff)
Fix or silent clang-tidy issues
Diffstat (limited to 'api/direct_bt')
-rw-r--r--api/direct_bt/ATTPDUTypes.hpp8
-rw-r--r--api/direct_bt/BTDeviceRegistry.hpp2
-rw-r--r--api/direct_bt/BTManager.hpp4
-rw-r--r--api/direct_bt/BTTypes1.hpp12
-rw-r--r--api/direct_bt/SMPKeyBin.hpp5
5 files changed, 15 insertions, 16 deletions
diff --git a/api/direct_bt/ATTPDUTypes.hpp b/api/direct_bt/ATTPDUTypes.hpp
index 8c9bd310..8a3e16f9 100644
--- a/api/direct_bt/ATTPDUTypes.hpp
+++ b/api/direct_bt/ATTPDUTypes.hpp
@@ -1103,7 +1103,7 @@ namespace direct_bt {
check_range();
}
- AttWriteRsp() noexcept
+ AttWriteRsp() noexcept // NOLINT(modernize-use-equals-default): Intended as-is
: AttPDUFixedMsg(Opcode::WRITE_RSP)
{
// check_range(); OK
@@ -1260,7 +1260,7 @@ namespace direct_bt {
check_range();
}
- AttExeWriteReq(const uint8_t flags) noexcept
+ AttExeWriteReq(const uint8_t flags) noexcept // NOLINT(modernize-use-equals-default): Intended as-is
: AttPDUFixedMsg(Opcode::EXECUTE_WRITE_REQ)
{
pdu.put_uint8(1, flags);
@@ -1293,7 +1293,7 @@ namespace direct_bt {
check_range();
}
- AttExeWriteRsp() noexcept
+ AttExeWriteRsp() noexcept // NOLINT(modernize-use-equals-default): Intended as-is
: AttPDUFixedMsg(Opcode::EXECUTE_WRITE_RSP)
{
// check_range(); OK
@@ -1395,7 +1395,7 @@ namespace direct_bt {
check_range();
}
- AttHandleValueCfm() noexcept
+ AttHandleValueCfm() noexcept // NOLINT(modernize-use-equals-default): Intended as-is
: AttPDUFixedMsg(Opcode::HANDLE_VALUE_CFM)
{
// check_range(); OK
diff --git a/api/direct_bt/BTDeviceRegistry.hpp b/api/direct_bt/BTDeviceRegistry.hpp
index 7f56a68e..1a95681d 100644
--- a/api/direct_bt/BTDeviceRegistry.hpp
+++ b/api/direct_bt/BTDeviceRegistry.hpp
@@ -97,7 +97,7 @@ namespace direct_bt {
BDAddressAndType addressAndType;
std::string name;
- DeviceID(BDAddressAndType a, std::string n) : addressAndType(std::move(a)), name(std::move(n)) {}
+ DeviceID(BDAddressAndType a, std::string n) : addressAndType(std::move(a)), name(std::move(n)) {} // NOLINT(performance-unnecessary-value-param): Wrong lint
DeviceID() : addressAndType(), name() {}
/**
diff --git a/api/direct_bt/BTManager.hpp b/api/direct_bt/BTManager.hpp
index 8ecd053f..ad3ac7f2 100644
--- a/api/direct_bt/BTManager.hpp
+++ b/api/direct_bt/BTManager.hpp
@@ -221,8 +221,8 @@ namespace direct_bt {
BDAddressAndType address_and_type;
HCIWhitelistConnectType ctype;
- WhitelistElem(uint16_t dev_id_, BDAddressAndType address_and_type_, HCIWhitelistConnectType ctype_)
- : dev_id(dev_id_), address_and_type(std::move(address_and_type_)), ctype(ctype_) { }
+ WhitelistElem(uint16_t dev_id_, const BDAddressAndType &address_and_type_, HCIWhitelistConnectType ctype_) // NOLINT(modernize-pass-by-value): Wrong lint and as intended
+ : dev_id(dev_id_), address_and_type(address_and_type_), ctype(ctype_) { }
};
jau::darray<std::shared_ptr<WhitelistElem>> whitelist;
diff --git a/api/direct_bt/BTTypes1.hpp b/api/direct_bt/BTTypes1.hpp
index 09ecb36f..e8e98a3d 100644
--- a/api/direct_bt/BTTypes1.hpp
+++ b/api/direct_bt/BTTypes1.hpp
@@ -116,8 +116,8 @@ namespace direct_bt {
std::string short_name;
protected:
- void setName(std::string v) noexcept { name = std::move(v); }
- void setShortName(std::string v) noexcept { short_name = std::move(v); }
+ void setName(const std::string &v) noexcept { name = v; }
+ void setShortName(const std::string &v) noexcept { short_name = v; }
public:
NameAndShortName() noexcept
@@ -214,11 +214,11 @@ namespace direct_bt {
std::string short_name;
public:
- AdapterInfo(const uint16_t dev_id_, BDAddressAndType addressAndType_,
+ AdapterInfo(const uint16_t dev_id_, const BDAddressAndType &addressAndType_, // NOLINT(modernize-pass-by-value): Wrong lint and as intended
const uint8_t version_, const uint16_t manufacturer_,
const AdapterSetting supported_setting_, const AdapterSetting current_setting_,
const uint32_t dev_class_, std::string name_, std::string short_name_) noexcept
- : dev_id(dev_id_), addressAndType( std::move(addressAndType_) ), version(version_),
+ : dev_id(dev_id_), addressAndType( addressAndType_ ), version(version_),
manufacturer(manufacturer_),
supported_setting(supported_setting_),
current_setting(current_setting_), dev_class(dev_class_),
@@ -269,8 +269,8 @@ namespace direct_bt {
current_setting = current_setting_;
}
void setDevClass(const uint32_t v) noexcept { dev_class = v; }
- void setName(std::string v) noexcept { name = std::move(v); }
- void setShortName(std::string v) noexcept { short_name = std::move(v); }
+ void setName(const std::string& v) noexcept { name = v; }
+ void setShortName(const std::string& v) noexcept { short_name = v; }
constexpr const AdapterSetting& get_supportedSetting() const noexcept { return supported_setting; }
diff --git a/api/direct_bt/SMPKeyBin.hpp b/api/direct_bt/SMPKeyBin.hpp
index 48ad8a47..a36ec71a 100644
--- a/api/direct_bt/SMPKeyBin.hpp
+++ b/api/direct_bt/SMPKeyBin.hpp
@@ -237,13 +237,12 @@ class SMPKeyBin {
static std::vector<SMPKeyBin> readAll(const std::string& dname, const bool verbose_);
static std::vector<SMPKeyBin> readAllForLocalAdapter(const BDAddressAndType& localAddress, const std::string& dname, const bool verbose_);
- SMPKeyBin(BTRole localRole_, BDAddressAndType localAddress_,
- BDAddressAndType remoteAddress_,
+ SMPKeyBin(BTRole localRole_, const BDAddressAndType &localAddress_, const BDAddressAndType &remoteAddress_, // NOLINT(modernize-pass-by-value): Wrong lint and as intended
const BTSecurityLevel sec_level_, const SMPIOCapability io_cap_)
: version(VERSION), size(0),
ts_creation_sec( jau::getWallClockSeconds() ),
localRole(localRole_),
- localAddress(std::move(localAddress_)), remoteAddress(std::move(remoteAddress_)),
+ localAddress(localAddress_), remoteAddress(remoteAddress_),
sec_level(sec_level_), io_cap(io_cap_),
keys_init(SMPKeyType::NONE), keys_resp(SMPKeyType::NONE),
ltk_init(), irk_init(), csrk_init(), lk_init(),