fix warnings

This commit is contained in:
arvidn 2019-04-09 23:56:31 +02:00 committed by Arvid Norberg
parent 4441655bab
commit a845afe6d9
9 changed files with 14 additions and 13 deletions

View File

@ -83,7 +83,7 @@ struct alloca_destructor
v = ::libtorrent::span<t>(TORRENT_ALLOCA_tmp, TORRENT_ALLOCA_size); \ v = ::libtorrent::span<t>(TORRENT_ALLOCA_tmp, TORRENT_ALLOCA_size); \
::libtorrent::aux::uninitialized_default_construct(v.begin(), v.end()); \ ::libtorrent::aux::uninitialized_default_construct(v.begin(), v.end()); \
} \ } \
::libtorrent::aux::alloca_destructor<t> v##_destructor{v}; ::libtorrent::aux::alloca_destructor<t> v##_destructor{v}
#elif defined TORRENT_BSD #elif defined TORRENT_BSD
@ -94,7 +94,7 @@ struct alloca_destructor
v = ::libtorrent::span<t>(TORRENT_ALLOCA_tmp, TORRENT_ALLOCA_size); \ v = ::libtorrent::span<t>(TORRENT_ALLOCA_tmp, TORRENT_ALLOCA_size); \
::libtorrent::aux::uninitialized_default_construct(v.begin(), v.end()); \ ::libtorrent::aux::uninitialized_default_construct(v.begin(), v.end()); \
} \ } \
::libtorrent::aux::alloca_destructor<t> v##_destructor{v}; ::libtorrent::aux::alloca_destructor<t> v##_destructor{v}
#else #else
@ -105,7 +105,7 @@ struct alloca_destructor
v = ::libtorrent::span<t>(TORRENT_ALLOCA_tmp, TORRENT_ALLOCA_size); \ v = ::libtorrent::span<t>(TORRENT_ALLOCA_tmp, TORRENT_ALLOCA_size); \
::libtorrent::aux::uninitialized_default_construct(v.begin(), v.end()); \ ::libtorrent::aux::uninitialized_default_construct(v.begin(), v.end()); \
} \ } \
::libtorrent::aux::alloca_destructor<t> v##_destructor{v}; ::libtorrent::aux::alloca_destructor<t> v##_destructor{v}
#endif #endif

View File

@ -895,7 +895,7 @@ namespace {
case o::partfile_write: return -1; case o::partfile_write: return -1;
case o::hostname_lookup: return -1; case o::hostname_lookup: return -1;
case o::symlink: return -1; case o::symlink: return -1;
}; }
return -1; return -1;
} }
#ifdef __GNUC__ #ifdef __GNUC__

View File

@ -74,7 +74,7 @@ void torrent_wait(bool& done, aux::session_impl& ses)
{ {
blocking_call(); blocking_call();
std::unique_lock<std::mutex> l(ses.mut); std::unique_lock<std::mutex> l(ses.mut);
while (!done) { ses.cond.wait(l); }; while (!done) { ses.cond.wait(l); }
} }
} } // namespace aux namespace libtorrent } } // namespace aux namespace libtorrent

View File

@ -381,7 +381,7 @@ constexpr int CLOSE_FILE_INTERVAL = 0;
return int_settings[s - settings_pack::int_type_base].name; return int_settings[s - settings_pack::int_type_base].name;
case settings_pack::bool_type_base: case settings_pack::bool_type_base:
return bool_settings[s - settings_pack::bool_type_base].name; return bool_settings[s - settings_pack::bool_type_base].name;
}; }
return ""; return "";
} }

View File

@ -57,7 +57,7 @@ namespace aux {
CASE(utp_stream) CASE(utp_stream)
return true; return true;
default: return false; default: return false;
}; }
#undef CASE #undef CASE
#else #else
TORRENT_UNUSED(s); TORRENT_UNUSED(s);

View File

@ -6569,7 +6569,7 @@ bool is_downloading_state(int const st)
CASE(http_stream) CASE(http_stream)
CASE(utp_stream) CASE(utp_stream)
default: break; default: break;
}; }
} }
#undef CASE #undef CASE
#endif #endif
@ -6752,7 +6752,7 @@ bool is_downloading_state(int const st)
case SSL(socks5_stream) case SSL(socks5_stream)
case SSL(http_stream) case SSL(http_stream)
case SSL(utp_stream) case SSL(utp_stream)
}; }
#undef SSL #undef SSL

View File

@ -698,7 +698,7 @@ namespace libtorrent {
std::lock_guard<std::mutex> l(holder_mutex); std::lock_guard<std::mutex> l(holder_mutex);
holder[cursor++] = r; holder[cursor++] = r;
cursor = cursor % holder.end_index();; cursor = cursor % holder.end_index();
return *r; return *r;
} }

View File

@ -234,9 +234,9 @@ namespace libtorrent {
ipv4_peer& ipv4_peer::operator=(ipv4_peer const& p) = default; ipv4_peer& ipv4_peer::operator=(ipv4_peer const& p) = default;
#if TORRENT_USE_I2P #if TORRENT_USE_I2P
i2p_peer::i2p_peer(string_view dest, bool connectable i2p_peer::i2p_peer(string_view dest, bool connectable_
, peer_source_flags_t const src) , peer_source_flags_t const src)
: torrent_peer(0, connectable, src) : torrent_peer(0, connectable_, src)
, destination(dest) , destination(dest)
{ {
is_v6_addr = false; is_v6_addr = false;

View File

@ -390,7 +390,8 @@ TORRENT_TEST(not_initialized)
TORRENT_TEST(self_assign) TORRENT_TEST(self_assign)
{ {
bitfield test1(123, false); bitfield test1(123, false);
test1 = test1; bitfield* self_ptr = &test1;
test1 = *self_ptr;
TEST_EQUAL(test1.size(), 123); TEST_EQUAL(test1.size(), 123);
TEST_EQUAL(test1.count(), 0); TEST_EQUAL(test1.count(), 0);
} }