fix compilation for android which uses boost::posix_time::ptime (TORRENT_USE_BOOST_DATE_TIME)

This commit is contained in:
Miguel Freitas 2014-12-06 11:17:47 -02:00
parent aeafa6ec15
commit 7bc233c1a7
3 changed files with 6 additions and 6 deletions

View File

@ -118,12 +118,12 @@ struct torrent_entry
struct dht_storage_item
{
// FIXME: optimize so bdecode is not needed all the time
dht_storage_item() : p(), sig_p(), sig_user(), local_add_time(0), confirmed(true), next_refresh_time(0) {}
dht_storage_item() : p(), sig_p(), sig_user(), local_add_time(0), confirmed(true), next_refresh_time() {}
dht_storage_item(std::string const &_p, lazy_entry const *_sig_p, lazy_entry const *_sig_user)
: p(_p), sig_p(_sig_p->string_value()), sig_user(_sig_user->string_value()),
local_add_time(0), confirmed(true), next_refresh_time(0) {}
local_add_time(0), confirmed(true), next_refresh_time() {}
dht_storage_item(std::string const &_p, std::string const &_sig_p, std::string const &_sig_user)
: p(_p), sig_p(_sig_p), sig_user(_sig_user), local_add_time(0), confirmed(true), next_refresh_time(0) {}
: p(_p), sig_p(_sig_p), sig_user(_sig_user), local_add_time(0), confirmed(true), next_refresh_time() {}
std::string p;
std::string sig_p;
std::string sig_user;

View File

@ -83,7 +83,7 @@ namespace libtorrent
struct TORRENT_EXPORT ptime
{
// hidden
ptime() {}
ptime() {time = 0;}
explicit ptime(boost::uint64_t t): time(t) {}
// these operators have the same semantics as signed 64 bit integers

View File

@ -338,7 +338,7 @@ namespace
ptime getNextRefreshTime(bool confirmed = true)
{
static ptime nextRefreshTime[2] = { ptime(0), ptime(0) };
static ptime nextRefreshTime[2] = { ptime(), ptime() };
nextRefreshTime[confirmed] = std::max(
nextRefreshTime[confirmed] + milliseconds(500),
// add +/-10% diffusion to next refresh time
@ -813,7 +813,7 @@ void node_impl::load_storage(entry const* e) {
return;
ptime const now = time_now();
time_duration const refresh_interval = std::max( DHT_REFRESH_CONFIRMED, e->dict().size() * milliseconds(500) );
time_duration const refresh_interval = std::max( DHT_REFRESH_CONFIRMED, milliseconds(e->dict().size() * 500) );
printf("node dht: loading storage... (%lu node_id keys)\n", e->dict().size());