refactor: fix a pair of win32 msvc warnings in libtransmission (#2588)

This commit is contained in:
Charles Kerr 2022-02-08 12:50:09 -06:00 committed by GitHub
parent ba14ffa74c
commit 2bf25fbdf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -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];

View File

@ -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<std::byte>(1024 * 256);
auto sha = tr_sha1_init();