From 2bf25fbdf563aaac44b663240bfeb1412773cf32 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 8 Feb 2022 12:50:09 -0600 Subject: [PATCH] refactor: fix a pair of win32 msvc warnings in libtransmission (#2588) --- libtransmission/log.cc | 8 +++++++- libtransmission/verify.cc | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libtransmission/log.cc b/libtransmission/log.cc index 57cccbb11..353f9a7be 100644 --- a/libtransmission/log.cc +++ b/libtransmission/log.cc @@ -195,7 +195,13 @@ void tr_logAddDeep(char const* file, int line, char const* name, char const* fmt **** ***/ -void tr_logAddMessage(char const* file, int line, tr_log_level level, char const* name, char const* fmt, ...) +void tr_logAddMessage( + [[maybe_unused]] char const* file, + [[maybe_unused]] int line, + [[maybe_unused]] tr_log_level level, + [[maybe_unused]] char const* name, + char const* fmt, + ...) { int const err = errno; /* message logging shouldn't affect errno */ char buf[1024]; diff --git a/libtransmission/verify.cc b/libtransmission/verify.cc index 8241e61ee..9064e64d1 100644 --- a/libtransmission/verify.cc +++ b/libtransmission/verify.cc @@ -38,7 +38,7 @@ static bool verifyTorrent(tr_torrent* tor, bool const* stopFlag) time_t lastSleptAt = 0; uint32_t piecePos = 0; tr_file_index_t fileIndex = 0; - tr_file_index_t prevFileIndex = ~0; + tr_file_index_t prevFileIndex = ~fileIndex; tr_piece_index_t piece = 0; auto buffer = std::vector(1024 * 256); auto sha = tr_sha1_init();