diff options
Diffstat (limited to 'host/lib/types')
| -rw-r--r-- | host/lib/types/time_spec.cpp | 23 | 
1 files changed, 9 insertions, 14 deletions
| diff --git a/host/lib/types/time_spec.cpp b/host/lib/types/time_spec.cpp index 403c3336c..c07ab8525 100644 --- a/host/lib/types/time_spec.cpp +++ b/host/lib/types/time_spec.cpp @@ -91,20 +91,6 @@ time_spec_t &time_spec_t::operator+=(double &rhs){      return *this;  } -time_spec_t time_spec_t::operator+(double &rhs){ -    double full_secs = std::trunc(rhs); -    time_spec_t toRet(this->get_full_secs() + full_secs, -         this->get_frac_secs() + rhs - full_secs); -    return toRet; -} - -time_spec_t time_spec_t::operator+(const time_spec_t &rhs){ -    time_spec_t toRet( -        this->get_full_secs() + rhs.get_full_secs(), -        this->get_frac_secs() + rhs.get_frac_secs()); -    return toRet; -} -  time_spec_t &time_spec_t::operator-=(const time_spec_t &rhs){      time_spec_init(          this->get_full_secs() - rhs.get_full_secs(), @@ -113,6 +99,15 @@ time_spec_t &time_spec_t::operator-=(const time_spec_t &rhs){      return *this;  } +time_spec_t &time_spec_t::operator-=(double &rhs) { +    double full_secs = std::trunc(rhs); +    time_spec_init( +        this->get_full_secs() - full_secs, +        this->get_frac_secs() - (rhs - full_secs) +    ); +    return *this; +} +  bool uhd::operator==(const time_spec_t &lhs, const time_spec_t &rhs){      return          lhs.get_full_secs() == rhs.get_full_secs() and | 
