forked from premiere/premiere-libtorrent
more vs10 build fixes
This commit is contained in:
parent
9c5d6ececa
commit
7ac4668948
|
@ -184,7 +184,7 @@ void test_reject_fast()
|
|||
allowed_fast.push_back(3);
|
||||
|
||||
std::for_each(allowed_fast.begin(), allowed_fast.end()
|
||||
, bind(&send_allow_fast, boost::ref(s), _1));
|
||||
, boost::bind(&send_allow_fast, boost::ref(s), _1));
|
||||
|
||||
while (!allowed_fast.empty())
|
||||
{
|
||||
|
@ -245,7 +245,7 @@ void test_respect_suggest()
|
|||
suggested.push_back(3);
|
||||
|
||||
std::for_each(suggested.begin(), suggested.end()
|
||||
, bind(&send_suggest_piece, boost::ref(s), _1));
|
||||
, boost::bind(&send_suggest_piece, boost::ref(s), _1));
|
||||
|
||||
send_unchoke(s);
|
||||
|
||||
|
|
|
@ -59,7 +59,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
using namespace libtorrent;
|
||||
using namespace boost::tuples;
|
||||
using boost::bind;
|
||||
|
||||
namespace libtorrent {
|
||||
TORRENT_EXPORT std::string sanitize_path(std::string const& p);
|
||||
|
@ -935,7 +934,7 @@ int test_main()
|
|||
char xml1[] = "<a>foo<b/>bar</a>";
|
||||
std::string out1;
|
||||
|
||||
xml_parse(xml1, xml1 + sizeof(xml1) - 1, bind(&parser_callback
|
||||
xml_parse(xml1, xml1 + sizeof(xml1) - 1, boost::bind(&parser_callback
|
||||
, boost::ref(out1), _1, _2, _3));
|
||||
std::cerr << out1 << std::endl;
|
||||
TEST_CHECK(out1 == "BaSfooEbSbarFa");
|
||||
|
@ -943,7 +942,7 @@ int test_main()
|
|||
char xml2[] = "<?xml version = \"1.0\"?><c x=\"1\" \t y=\"3\"/><d foo='bar'></d boo='foo'><!--comment-->";
|
||||
std::string out2;
|
||||
|
||||
xml_parse(xml2, xml2 + sizeof(xml2) - 1, bind(&parser_callback
|
||||
xml_parse(xml2, xml2 + sizeof(xml2) - 1, boost::bind(&parser_callback
|
||||
, boost::ref(out2), _1, _2, _3));
|
||||
std::cerr << out2 << std::endl;
|
||||
TEST_CHECK(out2 == "DxmlAversionV1.0EcAxV1AyV3BdAfooVbarFdAbooVfooCcomment");
|
||||
|
@ -951,7 +950,7 @@ int test_main()
|
|||
char xml3[] = "<a f=1>foo</a f='b>";
|
||||
std::string out3;
|
||||
|
||||
xml_parse(xml3, xml3 + sizeof(xml3) - 1, bind(&parser_callback
|
||||
xml_parse(xml3, xml3 + sizeof(xml3) - 1, boost::bind(&parser_callback
|
||||
, boost::ref(out3), _1, _2, _3));
|
||||
std::cerr << out3 << std::endl;
|
||||
TEST_CHECK(out3 == "BaPunquoted attribute valueSfooFaPmissing end quote on attribute");
|
||||
|
@ -959,7 +958,7 @@ int test_main()
|
|||
char xml4[] = "<a f>foo</a v >";
|
||||
std::string out4;
|
||||
|
||||
xml_parse(xml4, xml4 + sizeof(xml4) - 1, bind(&parser_callback
|
||||
xml_parse(xml4, xml4 + sizeof(xml4) - 1, boost::bind(&parser_callback
|
||||
, boost::ref(out4), _1, _2, _3));
|
||||
std::cerr << out4 << std::endl;
|
||||
TEST_CHECK(out4 == "BaPgarbage inside element bracketsSfooFaPgarbage inside element brackets");
|
||||
|
@ -969,7 +968,7 @@ int test_main()
|
|||
parse_state xml_s;
|
||||
xml_s.reset("urn:schemas-upnp-org:service:WANIPConnection:1");
|
||||
xml_parse((char*)upnp_xml, (char*)upnp_xml + sizeof(upnp_xml)
|
||||
, bind(&find_control_url, _1, _2, boost::ref(xml_s)));
|
||||
, boost::bind(&find_control_url, _1, _2, boost::ref(xml_s)));
|
||||
|
||||
std::cerr << "namespace " << xml_s.service_type << std::endl;
|
||||
std::cerr << "url_base: " << xml_s.url_base << std::endl;
|
||||
|
@ -981,7 +980,7 @@ int test_main()
|
|||
|
||||
xml_s.reset("urn:schemas-upnp-org:service:WANPPPConnection:1");
|
||||
xml_parse((char*)upnp_xml2, (char*)upnp_xml2 + sizeof(upnp_xml2)
|
||||
, bind(&find_control_url, _1, _2, boost::ref(xml_s)));
|
||||
, boost::bind(&find_control_url, _1, _2, boost::ref(xml_s)));
|
||||
|
||||
std::cerr << "namespace " << xml_s.service_type << std::endl;
|
||||
std::cerr << "url_base: " << xml_s.url_base << std::endl;
|
||||
|
@ -1117,16 +1116,16 @@ int test_main()
|
|||
std::cout << "returned: " << temp.size() << std::endl;
|
||||
TEST_EQUAL(temp.size(), 7);
|
||||
|
||||
std::sort(nodes.begin(), nodes.end(), bind(&compare_ref
|
||||
, bind(&node_entry::id, _1)
|
||||
, bind(&node_entry::id, _2), tmp));
|
||||
std::sort(nodes.begin(), nodes.end(), boost::bind(&compare_ref
|
||||
, boost::bind(&node_entry::id, _1)
|
||||
, boost::bind(&node_entry::id, _2), tmp));
|
||||
|
||||
int hits = 0;
|
||||
for (std::vector<node_entry>::iterator i = temp.begin()
|
||||
, end(temp.end()); i != end; ++i)
|
||||
{
|
||||
int hit = std::find_if(nodes.begin(), nodes.end()
|
||||
, bind(&node_entry::id, _1) == i->id) - nodes.begin();
|
||||
, boost::bind(&node_entry::id, _1) == i->id) - nodes.begin();
|
||||
// std::cerr << hit << std::endl;
|
||||
if (hit < int(temp.size())) ++hits;
|
||||
}
|
||||
|
@ -1137,16 +1136,16 @@ int test_main()
|
|||
std::cout << "returned: " << temp.size() << std::endl;
|
||||
TEST_EQUAL(temp.size(), (std::min)(15, int(nodes.size())));
|
||||
|
||||
std::sort(nodes.begin(), nodes.end(), bind(&compare_ref
|
||||
, bind(&node_entry::id, _1)
|
||||
, bind(&node_entry::id, _2), tmp));
|
||||
std::sort(nodes.begin(), nodes.end(), boost::bind(&compare_ref
|
||||
, boost::bind(&node_entry::id, _1)
|
||||
, boost::bind(&node_entry::id, _2), tmp));
|
||||
|
||||
hits = 0;
|
||||
for (std::vector<node_entry>::iterator i = temp.begin()
|
||||
, end(temp.end()); i != end; ++i)
|
||||
{
|
||||
int hit = std::find_if(nodes.begin(), nodes.end()
|
||||
, bind(&node_entry::id, _1) == i->id) - nodes.begin();
|
||||
, boost::bind(&node_entry::id, _1) == i->id) - nodes.begin();
|
||||
// std::cerr << hit << std::endl;
|
||||
if (hit < int(temp.size())) ++hits;
|
||||
}
|
||||
|
|
|
@ -526,7 +526,7 @@ void run_storage_tests(boost::intrusive_ptr<torrent_info> info
|
|||
// test move_storage with two files in the root directory
|
||||
TEST_CHECK(exists(combine_path(test_path, "temp_storage")));
|
||||
pm->async_move_storage(combine_path(test_path, "temp_storage2")
|
||||
, bind(on_move_storage, _1, _2, combine_path(test_path, "temp_storage2")));
|
||||
, boost::bind(on_move_storage, _1, _2, combine_path(test_path, "temp_storage2")));
|
||||
|
||||
test_sleep(2000);
|
||||
ios.reset();
|
||||
|
@ -540,7 +540,7 @@ void run_storage_tests(boost::intrusive_ptr<torrent_info> info
|
|||
}
|
||||
TEST_CHECK(exists(combine_path(test_path, "temp_storage2/part0")));
|
||||
|
||||
pm->async_move_storage(test_path, bind(on_move_storage, _1, _2, test_path));
|
||||
pm->async_move_storage(test_path, boost::bind(on_move_storage, _1, _2, test_path));
|
||||
|
||||
test_sleep(2000);
|
||||
ios.reset();
|
||||
|
@ -554,11 +554,11 @@ void run_storage_tests(boost::intrusive_ptr<torrent_info> info
|
|||
r.piece = 0;
|
||||
r.start = 0;
|
||||
r.length = block_size;
|
||||
pm->async_read(r, bind(&on_read_piece, _1, _2, piece0, block_size));
|
||||
pm->async_read(r, boost::bind(&on_read_piece, _1, _2, piece0, block_size));
|
||||
r.piece = 1;
|
||||
pm->async_read(r, bind(&on_read_piece, _1, _2, piece1, block_size));
|
||||
pm->async_read(r, boost::bind(&on_read_piece, _1, _2, piece1, block_size));
|
||||
r.piece = 2;
|
||||
pm->async_read(r, bind(&on_read_piece, _1, _2, piece2, block_size));
|
||||
pm->async_read(r, boost::bind(&on_read_piece, _1, _2, piece2, block_size));
|
||||
pm->async_release_files(none);
|
||||
|
||||
pm->async_rename_file(0, "temp_storage/test1.tmp", none);
|
||||
|
@ -712,7 +712,7 @@ void test_check_files(std::string const& test_path
|
|||
bool pieces[4] = {false, false, false, false};
|
||||
done = false;
|
||||
|
||||
pm->async_check_files(bind(&check_files_fill_array, _1, _2, pieces, &done));
|
||||
pm->async_check_files(boost::bind(&check_files_fill_array, _1, _2, pieces, &done));
|
||||
while (!done)
|
||||
{
|
||||
ios.reset();
|
||||
|
@ -1016,10 +1016,10 @@ int test_main()
|
|||
}
|
||||
}
|
||||
|
||||
std::for_each(test_paths.begin(), test_paths.end(), bind(&test_fastresume, _1));
|
||||
std::for_each(test_paths.begin(), test_paths.end(), bind(&test_rename_file_in_fastresume, _1));
|
||||
std::for_each(test_paths.begin(), test_paths.end(), bind(&run_test, _1, true));
|
||||
std::for_each(test_paths.begin(), test_paths.end(), bind(&run_test, _1, false));
|
||||
std::for_each(test_paths.begin(), test_paths.end(), boost::bind(&test_fastresume, _1));
|
||||
std::for_each(test_paths.begin(), test_paths.end(), boost::bind(&test_rename_file_in_fastresume, _1));
|
||||
std::for_each(test_paths.begin(), test_paths.end(), boost::bind(&run_test, _1, true));
|
||||
std::for_each(test_paths.begin(), test_paths.end(), boost::bind(&run_test, _1, false));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue