added required operator on time_duration
This commit is contained in:
parent
7d7a764f26
commit
f05b06d4e5
|
@ -51,7 +51,8 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (!defined (__MACH__) && !defined (_WIN32) && (!defined(_POSIX_MONOTONIC_CLOCK) || _POSIX_MONOTONIC_CLOCK < 0)) || defined (TORRENT_USE_BOOST_DATE_TIME)
|
#if (!defined (__MACH__) && !defined (_WIN32) && (!defined(_POSIX_MONOTONIC_CLOCK) \
|
||||||
|
|| _POSIX_MONOTONIC_CLOCK < 0)) || defined (TORRENT_USE_BOOST_DATE_TIME)
|
||||||
|
|
||||||
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
||||||
|
|
||||||
|
@ -99,8 +100,12 @@ namespace libtorrent
|
||||||
inline bool is_negative(time_duration dt) { return dt.diff < 0; }
|
inline bool is_negative(time_duration dt) { return dt.diff < 0; }
|
||||||
inline bool operator<(time_duration lhs, time_duration rhs)
|
inline bool operator<(time_duration lhs, time_duration rhs)
|
||||||
{ return lhs.diff < rhs.diff; }
|
{ return lhs.diff < rhs.diff; }
|
||||||
|
inline bool operator<=(time_duration lhs, time_duration rhs)
|
||||||
|
{ return lhs.diff <= rhs.diff; }
|
||||||
inline bool operator>(time_duration lhs, time_duration rhs)
|
inline bool operator>(time_duration lhs, time_duration rhs)
|
||||||
{ return lhs.diff > rhs.diff; }
|
{ return lhs.diff > rhs.diff; }
|
||||||
|
inline bool operator>=(time_duration lhs, time_duration rhs)
|
||||||
|
{ return lhs.diff >= rhs.diff; }
|
||||||
|
|
||||||
// libtorrent time type
|
// libtorrent time type
|
||||||
struct ptime
|
struct ptime
|
||||||
|
|
|
@ -1905,10 +1905,7 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
float factor = 0.6666666666667f;
|
float factor = 0.6666666666667f;
|
||||||
|
|
||||||
if (m_remote_dl_rate == 0)
|
if (m_remote_dl_rate == 0) factor = 0.0f;
|
||||||
{
|
|
||||||
factor = 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_remote_dl_rate =
|
m_remote_dl_rate =
|
||||||
(m_remote_dl_rate * factor) +
|
(m_remote_dl_rate * factor) +
|
||||||
|
|
Loading…
Reference in New Issue