From 26b1a9154e05bac1ab1f1f4c0e946043b7ee662a Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 24 May 2022 15:28:02 -0500 Subject: [PATCH] fix: silence unexpected key warnings in torrent file parser (#3133) --- libtransmission/open-files.cc | 2 +- libtransmission/torrent-metainfo.cc | 75 ++++++++++++++++++++++++----- 2 files changed, 65 insertions(+), 12 deletions(-) diff --git a/libtransmission/open-files.cc b/libtransmission/open-files.cc index 58b78ed0a..d369804eb 100644 --- a/libtransmission/open-files.cc +++ b/libtransmission/open-files.cc @@ -253,7 +253,7 @@ void tr_open_files::closeAll() void tr_open_files::closeTorrent(tr_torrent_id_t tor_id) { - return pool_.erase_if([&tor_id](Key const& key, Val const&) { return key.first == tor_id; }); + return pool_.erase_if([&tor_id](Key const& key, Val const& /*unused*/) { return key.first == tor_id; }); } void tr_open_files::closeFile(tr_torrent_id_t tor_id, tr_file_index_t file_num) diff --git a/libtransmission/torrent-metainfo.cc b/libtransmission/torrent-metainfo.cc index 171067142..31896c3df 100644 --- a/libtransmission/torrent-metainfo.cc +++ b/libtransmission/torrent-metainfo.cc @@ -324,7 +324,7 @@ struct MetainfoHandler final : public transmission::benc::BasicHandler