mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
fix: cppcoreguidelines-special-member-functions warnings in libtransmission (#3575)
This commit is contained in:
@@ -18,6 +18,7 @@ Checks: >
|
||||
cppcoreguidelines-init-variables,
|
||||
cppcoreguidelines-prefer-member-initializer,
|
||||
cppcoreguidelines-slicing,
|
||||
cppcoreguidelines-special-member-functions,
|
||||
cppcoreguidelines-virtual-class-destructor,
|
||||
misc-*,
|
||||
-misc-no-recursion,
|
||||
|
||||
@@ -169,6 +169,11 @@ struct tr_announcer
|
||||
scheduleNextUpdate();
|
||||
}
|
||||
|
||||
tr_announcer(tr_announcer&&) = delete;
|
||||
tr_announcer(tr_announcer const&) = delete;
|
||||
tr_announcer& operator=(tr_announcer&&) = delete;
|
||||
tr_announcer& operator=(tr_announcer const&) = delete;
|
||||
|
||||
~tr_announcer()
|
||||
{
|
||||
event_free(upkeep_timer);
|
||||
|
||||
@@ -146,7 +146,12 @@ private:
|
||||
class Sha1Impl final : public tr_sha1
|
||||
{
|
||||
public:
|
||||
Sha1Impl() = default;
|
||||
Sha1Impl(Sha1Impl&&) = delete;
|
||||
Sha1Impl(Sha1Impl const&) = delete;
|
||||
~Sha1Impl() override = default;
|
||||
Sha1Impl& operator=(Sha1Impl&&) = delete;
|
||||
Sha1Impl& operator=(Sha1Impl const&) = delete;
|
||||
|
||||
void clear() override
|
||||
{
|
||||
@@ -170,7 +175,12 @@ private:
|
||||
class Sha256Impl final : public tr_sha256
|
||||
{
|
||||
public:
|
||||
Sha256Impl() = default;
|
||||
Sha256Impl(Sha256Impl&&) = delete;
|
||||
Sha256Impl(Sha256Impl const&) = delete;
|
||||
~Sha256Impl() override = default;
|
||||
Sha256Impl& operator=(Sha256Impl&&) = delete;
|
||||
Sha256Impl& operator=(Sha256Impl const&) = delete;
|
||||
|
||||
void clear() override
|
||||
{
|
||||
|
||||
@@ -119,6 +119,11 @@ struct tr_handshake
|
||||
{
|
||||
}
|
||||
|
||||
tr_handshake(tr_handshake&&) = delete;
|
||||
tr_handshake(tr_handshake const&) = delete;
|
||||
tr_handshake& operator=(tr_handshake&&) = delete;
|
||||
tr_handshake& operator=(tr_handshake const&) = delete;
|
||||
|
||||
~tr_handshake()
|
||||
{
|
||||
if (io != nullptr)
|
||||
|
||||
@@ -88,6 +88,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
tr_handshake_mediator_impl(tr_handshake_mediator_impl&&) = delete;
|
||||
tr_handshake_mediator_impl(tr_handshake_mediator_impl const&) = delete;
|
||||
tr_handshake_mediator_impl& operator=(tr_handshake_mediator_impl&&) = delete;
|
||||
tr_handshake_mediator_impl& operator=(tr_handshake_mediator_impl const&) = delete;
|
||||
|
||||
virtual ~tr_handshake_mediator_impl() = default;
|
||||
|
||||
[[nodiscard]] std::optional<torrent_info> torrentInfo(tr_sha1_digest_t const& info_hash) const override
|
||||
@@ -578,6 +583,11 @@ struct tr_peerMgr
|
||||
tr_timerAddMsec(*refill_upkeep_timer_, RefillUpkeepPeriodMsec);
|
||||
}
|
||||
|
||||
tr_peerMgr(tr_peerMgr&&) = delete;
|
||||
tr_peerMgr(tr_peerMgr const&) = delete;
|
||||
tr_peerMgr& operator=(tr_peerMgr&&) = delete;
|
||||
tr_peerMgr& operator=(tr_peerMgr const&) = delete;
|
||||
|
||||
[[nodiscard]] auto unique_lock() const
|
||||
{
|
||||
return session->unique_lock();
|
||||
@@ -824,6 +834,11 @@ std::vector<tr_block_span_t> tr_peerMgrGetNextRequests(tr_torrent* torrent, tr_p
|
||||
{
|
||||
}
|
||||
|
||||
MediatorImpl(MediatorImpl&&) = delete;
|
||||
MediatorImpl(MediatorImpl const&) = delete;
|
||||
MediatorImpl& operator=(MediatorImpl&&) = delete;
|
||||
MediatorImpl& operator=(MediatorImpl const&) = delete;
|
||||
|
||||
~MediatorImpl() override = default;
|
||||
|
||||
[[nodiscard]] bool clientCanRequestBlock(tr_block_index_t block) const override
|
||||
|
||||
@@ -300,6 +300,11 @@ public:
|
||||
updateDesiredRequestCount(this);
|
||||
}
|
||||
|
||||
tr_peerMsgsImpl(tr_peerMsgsImpl&&) = delete;
|
||||
tr_peerMsgsImpl(tr_peerMsgsImpl const&) = delete;
|
||||
tr_peerMsgsImpl& operator=(tr_peerMsgsImpl&&) = delete;
|
||||
tr_peerMsgsImpl& operator=(tr_peerMsgsImpl const&) = delete;
|
||||
|
||||
~tr_peerMsgsImpl() override
|
||||
{
|
||||
set_active(TR_UP, false);
|
||||
|
||||
@@ -1296,9 +1296,8 @@ uint16_t tr_sessionGetPeerPort(tr_session const* session)
|
||||
|
||||
uint16_t tr_sessionSetPeerPortRandom(tr_session* session)
|
||||
{
|
||||
tr_port p = getRandomPort(session);
|
||||
tr_port const p = getRandomPort(session);
|
||||
tr_sessionSetPeerPort(session, p.host());
|
||||
|
||||
return p.host();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,12 @@ tr_port_forwarding portFwdState(UpnpState upnp_state, bool is_mapped)
|
||||
|
||||
struct tr_upnp
|
||||
{
|
||||
tr_upnp() = default;
|
||||
tr_upnp(tr_upnp&&) = delete;
|
||||
tr_upnp(tr_upnp const&) = delete;
|
||||
tr_upnp& operator=(tr_upnp&&) = delete;
|
||||
tr_upnp& operator=(tr_upnp const&) = delete;
|
||||
|
||||
~tr_upnp()
|
||||
{
|
||||
TR_ASSERT(!isMapped);
|
||||
|
||||
@@ -144,6 +144,11 @@ struct MyHandler : public transmission::benc::Handler
|
||||
{
|
||||
}
|
||||
|
||||
MyHandler(MyHandler&&) = delete;
|
||||
MyHandler(MyHandler const&) = delete;
|
||||
MyHandler& operator=(MyHandler&&) = delete;
|
||||
MyHandler& operator=(MyHandler const&) = delete;
|
||||
|
||||
~MyHandler() override = default;
|
||||
|
||||
bool Int64(int64_t value, Context const& /*context*/) final
|
||||
|
||||
@@ -43,7 +43,9 @@ auto tr_watchdir_retry_max_interval = timeval{ 10, 0 };
|
||||
class tr_watchdir_retry
|
||||
{
|
||||
public:
|
||||
tr_watchdir_retry(tr_watchdir_retry&&) = delete;
|
||||
tr_watchdir_retry(tr_watchdir_retry const&) = delete;
|
||||
tr_watchdir_retry& operator=(tr_watchdir_retry&&) = delete;
|
||||
tr_watchdir_retry& operator=(tr_watchdir_retry const&) = delete;
|
||||
|
||||
tr_watchdir_retry(tr_watchdir_t handle_in, struct event_base* base, std::string_view name_in)
|
||||
@@ -139,6 +141,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
tr_watchdir(tr_watchdir&&) = delete;
|
||||
tr_watchdir(tr_watchdir const&) = delete;
|
||||
tr_watchdir& operator=(tr_watchdir&&) = delete;
|
||||
tr_watchdir& operator=(tr_watchdir const&) = delete;
|
||||
|
||||
~tr_watchdir()
|
||||
{
|
||||
if (backend_ != nullptr)
|
||||
@@ -147,9 +154,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
tr_watchdir(tr_watchdir const&) = delete;
|
||||
tr_watchdir& operator=(tr_watchdir const&) = delete;
|
||||
|
||||
[[nodiscard]] constexpr auto const& path() const noexcept
|
||||
{
|
||||
return path_;
|
||||
|
||||
@@ -139,6 +139,11 @@ public:
|
||||
curl_thread = std::make_unique<std::thread>(curlThreadFunc, this);
|
||||
}
|
||||
|
||||
Impl(Impl&&) = delete;
|
||||
Impl(Impl const&) = delete;
|
||||
Impl& operator=(Impl&&) = delete;
|
||||
Impl& operator=(Impl const&) = delete;
|
||||
|
||||
~Impl()
|
||||
{
|
||||
run_mode = RunMode::CloseNow;
|
||||
|
||||
@@ -169,6 +169,11 @@ public:
|
||||
startTimer();
|
||||
}
|
||||
|
||||
tr_webseed(tr_webseed&&) = delete;
|
||||
tr_webseed(tr_webseed const&) = delete;
|
||||
tr_webseed& operator=(tr_webseed&&) = delete;
|
||||
tr_webseed& operator=(tr_webseed const&) = delete;
|
||||
|
||||
~tr_webseed() override
|
||||
{
|
||||
// flag all the pending tasks as dead
|
||||
|
||||
Reference in New Issue
Block a user