fix msvc build issues
This commit is contained in:
parent
2fb1a0f3c7
commit
a0e6b52a3f
|
@ -254,10 +254,10 @@ namespace libtorrent {
|
||||||
// when the alert queue is full. There are a few alerts which may not be discared,
|
// when the alert queue is full. There are a few alerts which may not be discared,
|
||||||
// since they would break the user contract, such as save_resume_data_alert.
|
// since they would break the user contract, such as save_resume_data_alert.
|
||||||
TORRENT_DEPRECATED
|
TORRENT_DEPRECATED
|
||||||
virtual bool discardable() const TORRENT_DEPRECATED { return true; }
|
virtual bool discardable() const { return true; }
|
||||||
|
|
||||||
TORRENT_DEPRECATED
|
TORRENT_DEPRECATED
|
||||||
severity_t severity() const TORRENT_DEPRECATED { return warning; }
|
severity_t severity() const { return warning; }
|
||||||
|
|
||||||
// returns a pointer to a copy of the alert.
|
// returns a pointer to a copy of the alert.
|
||||||
virtual std::auto_ptr<alert> clone() const = 0;
|
virtual std::auto_ptr<alert> clone() const = 0;
|
||||||
|
|
|
@ -351,15 +351,15 @@ namespace libtorrent
|
||||||
TORRENT_DEPRECATED
|
TORRENT_DEPRECATED
|
||||||
iterator file_at_offset(boost::int64_t offset) const;
|
iterator file_at_offset(boost::int64_t offset) const;
|
||||||
TORRENT_DEPRECATED
|
TORRENT_DEPRECATED
|
||||||
iterator begin() const TORRENT_DEPRECATED { return m_files.begin(); }
|
iterator begin() const { return m_files.begin(); }
|
||||||
TORRENT_DEPRECATED
|
TORRENT_DEPRECATED
|
||||||
iterator end() const TORRENT_DEPRECATED { return m_files.end(); }
|
iterator end() const { return m_files.end(); }
|
||||||
TORRENT_DEPRECATED
|
TORRENT_DEPRECATED
|
||||||
reverse_iterator rbegin() const TORRENT_DEPRECATED { return m_files.rbegin(); }
|
reverse_iterator rbegin() const { return m_files.rbegin(); }
|
||||||
TORRENT_DEPRECATED
|
TORRENT_DEPRECATED
|
||||||
reverse_iterator rend() const TORRENT_DEPRECATED { return m_files.rend(); }
|
reverse_iterator rend() const { return m_files.rend(); }
|
||||||
TORRENT_DEPRECATED
|
TORRENT_DEPRECATED
|
||||||
internal_file_entry const& internal_at(int index) const TORRENT_DEPRECATED
|
internal_file_entry const& internal_at(int index) const
|
||||||
{
|
{
|
||||||
TORRENT_ASSERT(index >= 0);
|
TORRENT_ASSERT(index >= 0);
|
||||||
TORRENT_ASSERT(index < int(m_files.size()));
|
TORRENT_ASSERT(index < int(m_files.size()));
|
||||||
|
|
|
@ -988,7 +988,7 @@ namespace libtorrent
|
||||||
int num_connect_candidates() const { return m_peer_list ? m_peer_list->num_connect_candidates() : 0; }
|
int num_connect_candidates() const { return m_peer_list ? m_peer_list->num_connect_candidates() : 0; }
|
||||||
|
|
||||||
piece_manager& storage();
|
piece_manager& storage();
|
||||||
bool has_storage() const { return m_storage; }
|
bool has_storage() const { return m_storage.get() != NULL; }
|
||||||
|
|
||||||
torrent_info const& torrent_file() const
|
torrent_info const& torrent_file() const
|
||||||
{ return *m_torrent_file; }
|
{ return *m_torrent_file; }
|
||||||
|
|
|
@ -187,7 +187,7 @@ namespace libtorrent
|
||||||
#ifndef TORRENT_NO_DEPRECATE
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
// deprecated in 1.0
|
// deprecated in 1.0
|
||||||
TORRENT_DEPRECATED
|
TORRENT_DEPRECATED
|
||||||
bool will_announce(time_point now) const TORRENT_DEPRECATED
|
bool will_announce(time_point now) const
|
||||||
{
|
{
|
||||||
return now <= next_announce
|
return now <= next_announce
|
||||||
&& (fails < fail_limit || fail_limit == 0)
|
&& (fails < fail_limit || fail_limit == 0)
|
||||||
|
|
|
@ -2212,9 +2212,12 @@ namespace libtorrent
|
||||||
|
|
||||||
if (t->alerts().should_post<invalid_request_alert>())
|
if (t->alerts().should_post<invalid_request_alert>())
|
||||||
{
|
{
|
||||||
|
// msvc 12 appears to deduce the rvalue reference template
|
||||||
|
// incorrectly for bool temporaries. So, create a dummy instance
|
||||||
|
bool peer_interested = bool(m_peer_interested);
|
||||||
t->alerts().emplace_alert<invalid_request_alert>(
|
t->alerts().emplace_alert<invalid_request_alert>(
|
||||||
t->get_handle(), m_remote, m_peer_id, r
|
t->get_handle(), m_remote, m_peer_id, r
|
||||||
, t->has_piece_passed(r.piece), bool(m_peer_interested), true);
|
, t->has_piece_passed(r.piece), peer_interested, true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2282,9 +2285,12 @@ namespace libtorrent
|
||||||
#endif
|
#endif
|
||||||
if (t->alerts().should_post<invalid_request_alert>())
|
if (t->alerts().should_post<invalid_request_alert>())
|
||||||
{
|
{
|
||||||
|
// msvc 12 appears to deduce the rvalue reference template
|
||||||
|
// incorrectly for bool temporaries. So, create a dummy instance
|
||||||
|
bool peer_interested = bool(m_peer_interested);
|
||||||
t->alerts().emplace_alert<invalid_request_alert>(
|
t->alerts().emplace_alert<invalid_request_alert>(
|
||||||
t->get_handle(), m_remote, m_peer_id, r
|
t->get_handle(), m_remote, m_peer_id, r
|
||||||
, t->has_piece_passed(r.piece), bool(m_peer_interested), false);
|
, t->has_piece_passed(r.piece), peer_interested, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// be lenient and pretend that the peer said it was interested
|
// be lenient and pretend that the peer said it was interested
|
||||||
|
@ -2325,9 +2331,12 @@ namespace libtorrent
|
||||||
|
|
||||||
if (t->alerts().should_post<invalid_request_alert>())
|
if (t->alerts().should_post<invalid_request_alert>())
|
||||||
{
|
{
|
||||||
|
// msvc 12 appears to deduce the rvalue reference template
|
||||||
|
// incorrectly for bool temporaries. So, create a dummy instance
|
||||||
|
bool peer_interested = bool(m_peer_interested);
|
||||||
t->alerts().emplace_alert<invalid_request_alert>(
|
t->alerts().emplace_alert<invalid_request_alert>(
|
||||||
t->get_handle(), m_remote, m_peer_id, r
|
t->get_handle(), m_remote, m_peer_id, r
|
||||||
, t->has_piece_passed(r.piece), bool(m_peer_interested), false);
|
, t->has_piece_passed(r.piece), peer_interested, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// every ten invalid request, remind the peer that it's choked
|
// every ten invalid request, remind the peer that it's choked
|
||||||
|
|
Loading…
Reference in New Issue