diff options
author | Johnathan Corgan <jcorgan@corganenterprises.com> | 2010-04-26 23:14:12 -0700 |
---|---|---|
committer | Johnathan Corgan <jcorgan@corganenterprises.com> | 2010-04-26 23:14:12 -0700 |
commit | c6ad778bda302a9abfe3f1a905d1a80ee34c60a6 (patch) | |
tree | 26cd9a62b04dc6aa9f55ff5355ff4aef45cfd762 /omnithread/omni_time.cc | |
parent | ac2b84b93cad94f9a8830eeb5e62dace997c9a47 (diff) |
Remove omnithreads library.
Diffstat (limited to 'omnithread/omni_time.cc')
-rw-r--r-- | omnithread/omni_time.cc | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/omnithread/omni_time.cc b/omnithread/omni_time.cc deleted file mode 100644 index 4920a68399..0000000000 --- a/omnithread/omni_time.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007,2008 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <gnuradio/omni_time.h> -#include <gnuradio/omnithread.h> -#include <math.h> -#include <assert.h> - - -omni_time::omni_time(double real_secs) -{ - double floor_secs = floor(real_secs); - d_secs = (long) floor_secs; - d_nsecs = (long) ((real_secs - floor_secs) * 1e9); // always positive -} - -omni_time -omni_time::time(const omni_time &delta_t) -{ - unsigned long abs_sec, abs_nsec; - unsigned long rel_sec = delta_t.d_secs; - unsigned long rel_nsec = delta_t.d_nsecs; - - omni_thread::get_time(&abs_sec, &abs_nsec, rel_sec, rel_nsec); - return omni_time(abs_sec, abs_nsec); -} - - -omni_time -operator+(const omni_time &x, const omni_time &y) -{ - omni_time r(x.d_secs + y.d_secs, x.d_nsecs + y.d_nsecs); - while (r.d_nsecs >= 1000000000){ - r.d_nsecs -= 1000000000; - r.d_secs++; - } - return r; -} - -omni_time -operator-(const omni_time &x, const omni_time &y) -{ - // assert(!(x < y)); - - omni_time r(x.d_secs - y.d_secs, x.d_nsecs - y.d_nsecs); - while (r.d_nsecs < 0){ - r.d_nsecs += 1000000000; - r.d_secs--; - } - return r; -} - -omni_time -operator+(const omni_time &x, double y) -{ - return x + omni_time(y); -} - -omni_time -operator-(const omni_time &x, double y) -{ - return x - omni_time(y); -} |