diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 90c4b6222..c3bd3d507 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -320,7 +320,7 @@ int peer_index(libtorrent::tcp::endpoint addr, std::vector::const_iterator i = std::find_if(peers.begin() - , peers.end(), bind(&peer_info::ip, _1) == addr); + , peers.end(), boost::bind(&peer_info::ip, _1) == addr); if (i == peers.end()) return -1; return i - peers.begin(); @@ -716,7 +716,7 @@ void handle_alert(libtorrent::session& ses, libtorrent::alert* a bencode(std::back_inserter(out), *p->resume_data); save_file(combine_path(h.save_path(), h.name() + ".resume"), out); if (std::find_if(handles.begin(), handles.end() - , bind(&handles_t::value_type::second, _1) == h) == handles.end()) + , boost::bind(&handles_t::value_type::second, _1) == h) == handles.end()) ses.remove_torrent(h); } } @@ -724,7 +724,7 @@ void handle_alert(libtorrent::session& ses, libtorrent::alert* a { torrent_handle h = p->handle; if (std::find_if(handles.begin(), handles.end() - , bind(&handles_t::value_type::second, _1) == h) == handles.end()) + , boost::bind(&handles_t::value_type::second, _1) == h) == handles.end()) ses.remove_torrent(h); } } @@ -940,7 +940,7 @@ int main(int argc, char* argv[]) case 'O': settings.allow_reordered_disk_operations = false; --i; break; case 'P': { - char* port = strchr(arg, ':'); + char* port = (char*) strchr(arg, ':'); if (port == 0) { fprintf(stderr, "invalid proxy hostname, no port found\n"); @@ -1495,8 +1495,8 @@ int main(int argc, char* argv[]) { h.get_download_queue(queue); - std::sort(queue.begin(), queue.end(), bind(&partial_piece_info::piece_index, _1) - < bind(&partial_piece_info::piece_index, _2)); + std::sort(queue.begin(), queue.end(), boost::bind(&partial_piece_info::piece_index, _1) + < boost::bind(&partial_piece_info::piece_index, _2)); std::vector pieces; ses.get_cache_info(h.info_hash(), pieces); @@ -1506,7 +1506,7 @@ int main(int argc, char* argv[]) { cached_piece_info* cp = 0; std::vector::iterator cpi = std::find_if(pieces.begin(), pieces.end() - , bind(&cached_piece_info::piece, _1) == i->piece_index); + , boost::bind(&cached_piece_info::piece, _1) == i->piece_index); if (cpi != pieces.end()) cp = &*cpi; snprintf(str, sizeof(str), "%5d: [", i->piece_index); diff --git a/src/policy.cpp b/src/policy.cpp index ee77b5790..1d559a1cf 100644 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -289,7 +289,7 @@ namespace libtorrent // find the block with the fewest requests to it std::vector::iterator i = std::min_element( busy_pieces.begin(), busy_pieces.end() - , bind(&piece_picker::num_peers, boost::cref(p), _1) < + , boost::bind(&piece_picker::num_peers, boost::cref(p), _1) < bind(&piece_picker::num_peers, boost::cref(p), _2)); #ifdef TORRENT_DEBUG piece_picker::downloading_piece st; diff --git a/src/session_impl.cpp b/src/session_impl.cpp index c182610a7..d86d8b91d 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1647,7 +1647,7 @@ namespace aux { shared_ptr c(new socket_type(m_io_service)); c->instantiate(m_io_service); listener->async_accept(*c->get() - , bind(&session_impl::on_accept_connection, this, c + , boost::bind(&session_impl::on_accept_connection, this, c , boost::weak_ptr(listener), _1)); } @@ -1878,10 +1878,10 @@ namespace aux { if (!p->is_choked() && !p->ignore_unchoke_slots()) --m_num_unchoked; // connection_map::iterator i = std::lower_bound(m_connections.begin(), m_connections.end() -// , p, bind(&boost::intrusive_ptr::get, _1) < p); +// , p, boost::bind(&boost::intrusive_ptr::get, _1) < p); // if (i->get() != p) i == m_connections.end(); connection_map::iterator i = std::find_if(m_connections.begin(), m_connections.end() - , bind(&boost::intrusive_ptr::get, _1) == p); + , boost::bind(&boost::intrusive_ptr::get, _1) == p); if (i != m_connections.end()) m_connections.erase(i); } @@ -2618,11 +2618,11 @@ namespace aux { if (!handled_by_extension) { std::sort(downloaders.begin(), downloaders.end() - , bind(&torrent::sequence_number, _1) < bind(&torrent::sequence_number, _2)); + , boost::bind(&torrent::sequence_number, _1) < boost::bind(&torrent::sequence_number, _2)); std::sort(seeds.begin(), seeds.end() - , bind(&torrent::seed_rank, _1, boost::ref(m_settings)) - > bind(&torrent::seed_rank, _2, boost::ref(m_settings))); + , boost::bind(&torrent::seed_rank, _1, boost::ref(m_settings)) + > boost::bind(&torrent::seed_rank, _2, boost::ref(m_settings))); } if (settings().auto_manage_prefer_seeds) @@ -2791,7 +2791,7 @@ namespace aux { { m_allowed_upload_slots = 0; std::sort(peers.begin(), peers.end() - , bind(&peer_connection::upload_rate_compare, _1, _2)); + , boost::bind(&peer_connection::upload_rate_compare, _1, _2)); #ifdef TORRENT_DEBUG for (std::vector::const_iterator i = peers.begin() @@ -2838,7 +2838,7 @@ namespace aux { // if we're using the bittyrant choker, sort peers by their return // on investment. i.e. download rate / upload rate std::sort(peers.begin(), peers.end() - , bind(&peer_connection::bittyrant_unchoke_compare, _1, _2)); + , boost::bind(&peer_connection::bittyrant_unchoke_compare, _1, _2)); } else { @@ -2847,7 +2847,7 @@ namespace aux { // the download rate will be 0, and the peers we have sent the least to should // be unchoked std::sort(peers.begin(), peers.end() - , bind(&peer_connection::unchoke_compare, _1, _2)); + , boost::bind(&peer_connection::unchoke_compare, _1, _2)); } // auto unchoke @@ -3568,7 +3568,7 @@ namespace aux { snprintf(port, sizeof(port), "%d", node.second); tcp::resolver::query q(node.first, port); m_host_resolver.async_resolve(q, - bind(&session_impl::on_dht_router_name_lookup, this, _1, _2)); + boost::bind(&session_impl::on_dht_router_name_lookup, this, _1, _2)); } void session_impl::on_dht_router_name_lookup(error_code const& e @@ -3763,7 +3763,7 @@ namespace aux { m_lsd = new lsd(m_io_service , m_listen_interface.address() - , bind(&session_impl::on_lsd_peer, this, _1, _2)); + , boost::bind(&session_impl::on_lsd_peer, this, _1, _2)); if (m_settings.broadcast_lsd) m_lsd->use_broadcast(true); }