C++11 compatibility fixes.

This commit is contained in:
rakshasa
2014-05-13 23:36:37 +09:00
parent e42ec54920
commit 3b39f37f49
77 changed files with 886 additions and 803 deletions
+11 -6
View File
@@ -74,6 +74,11 @@
namespace core {
const int Manager::create_start;
const int Manager::create_tied;
const int Manager::create_quiet;
const int Manager::create_raw_data;
void
Manager::push_log(const char* msg) {
m_log_important->lock_and_push_log(msg, strlen(msg), 0);
@@ -113,7 +118,7 @@ Manager::set_hashing_view(View* v) {
throw torrent::internal_error("Manager::set_hashing_view(...) received NULL or is already set.");
m_hashingView = v;
m_hashingView->signal_changed().push_back(std::tr1::bind(&Manager::receive_hashing_changed, this));
m_hashingView->signal_changed().push_back(std::bind(&Manager::receive_hashing_changed, this));
}
torrent::ThrottlePair
@@ -133,7 +138,7 @@ Manager::get_throttle(const std::string& name) {
void
Manager::set_address_throttle(uint32_t begin, uint32_t end, torrent::ThrottlePair throttles) {
m_addressThrottles.set_merge(begin, end, throttles);
torrent::connection_manager()->address_throttle() = tr1::bind(&core::Manager::get_address_throttle, control->core(), tr1::placeholders::_1);
torrent::connection_manager()->address_throttle() = std::bind(&core::Manager::get_address_throttle, control->core(), std::placeholders::_1);
}
torrent::ThrottlePair
@@ -144,8 +149,8 @@ Manager::get_address_throttle(const sockaddr* addr) {
// Most of this should be possible to move out.
void
Manager::initialize_second() {
torrent::Http::slot_factory() = std::tr1::bind(&CurlStack::new_object, m_httpStack);
m_httpQueue->set_slot_factory(std::tr1::bind(&CurlStack::new_object, m_httpStack));
torrent::Http::slot_factory() = std::bind(&CurlStack::new_object, m_httpStack);
m_httpQueue->set_slot_factory(std::bind(&CurlStack::new_object, m_httpStack));
CurlStack::global_init();
}
@@ -330,7 +335,7 @@ Manager::try_create_download(const std::string& uri, int flags, const command_li
f->set_start(flags & create_start);
f->set_print_log(!(flags & create_quiet));
f->slot_finished(std::tr1::bind(&rak::call_delete_func<core::DownloadFactory>, f));
f->slot_finished(std::bind(&rak::call_delete_func<core::DownloadFactory>, f));
if (flags & create_raw_data)
f->load_raw_data(uri);
@@ -354,7 +359,7 @@ Manager::try_create_download_from_meta_download(torrent::Object* bencode, const
f->set_start(meta.get_key_value("start"));
f->set_print_log(meta.get_key_value("print_log"));
f->slot_finished(std::tr1::bind(&rak::call_delete_func<core::DownloadFactory>, f));
f->slot_finished(std::bind(&rak::call_delete_func<core::DownloadFactory>, f));
// Bit of a waste to create the bencode repesentation here
// only to have the DownloadFactory decode it.