fix msvc build issues

This commit is contained in:
Arvid Norberg 2015-04-26 01:45:23 +00:00
parent 2fb1a0f3c7
commit a0e6b52a3f
5 changed files with 21 additions and 12 deletions

View File

@ -254,10 +254,10 @@ namespace libtorrent {
// 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.
TORRENT_DEPRECATED
virtual bool discardable() const TORRENT_DEPRECATED { return true; }
virtual bool discardable() const { return true; }
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.
virtual std::auto_ptr<alert> clone() const = 0;

View File

@ -351,15 +351,15 @@ namespace libtorrent
TORRENT_DEPRECATED
iterator file_at_offset(boost::int64_t offset) const;
TORRENT_DEPRECATED
iterator begin() const TORRENT_DEPRECATED { return m_files.begin(); }
iterator begin() const { return m_files.begin(); }
TORRENT_DEPRECATED
iterator end() const TORRENT_DEPRECATED { return m_files.end(); }
iterator end() const { return m_files.end(); }
TORRENT_DEPRECATED
reverse_iterator rbegin() const TORRENT_DEPRECATED { return m_files.rbegin(); }
reverse_iterator rbegin() const { return m_files.rbegin(); }
TORRENT_DEPRECATED
reverse_iterator rend() const TORRENT_DEPRECATED { return m_files.rend(); }
reverse_iterator rend() const { return m_files.rend(); }
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 < int(m_files.size()));

View File

@ -988,7 +988,7 @@ namespace libtorrent
int num_connect_candidates() const { return m_peer_list ? m_peer_list->num_connect_candidates() : 0; }
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
{ return *m_torrent_file; }

View File

@ -187,7 +187,7 @@ namespace libtorrent
#ifndef TORRENT_NO_DEPRECATE
// deprecated in 1.0
TORRENT_DEPRECATED
bool will_announce(time_point now) const TORRENT_DEPRECATED
bool will_announce(time_point now) const
{
return now <= next_announce
&& (fails < fail_limit || fail_limit == 0)

View File

@ -2212,9 +2212,12 @@ namespace libtorrent
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->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;
}
@ -2282,9 +2285,12 @@ namespace libtorrent
#endif
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->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
@ -2325,9 +2331,12 @@ namespace libtorrent
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->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