aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/test_clock_synch.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-08-16 14:25:24 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-08-20 16:56:43 -0700
commit8e3ea14c9406f3f3e5fe613bfe59906447a195e0 (patch)
tree9e7924432f7c3be99693faed5478a8b95c3ecb97 /host/examples/test_clock_synch.cpp
parent3b42e6f029f0d3de0f54d720964357aa0a32986f (diff)
downloaduhd-8e3ea14c9406f3f3e5fe613bfe59906447a195e0.tar.gz
uhd-8e3ea14c9406f3f3e5fe613bfe59906447a195e0.tar.bz2
uhd-8e3ea14c9406f3f3e5fe613bfe59906447a195e0.zip
uhd: Remove usage of time_t (except when required)
The C/C++ standards don't define what time_t is, only that it is arithmetic (and real for C11, and integral for C++). It should not be used in portable software and is only used as the return value for some libc calls. A common definition for time_t is int64_t, so we'll switch to that permanently in our own APIs. System APIs will of course stick with time_t.
Diffstat (limited to 'host/examples/test_clock_synch.cpp')
-rw-r--r--host/examples/test_clock_synch.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/host/examples/test_clock_synch.cpp b/host/examples/test_clock_synch.cpp
index 38bc4980a..a0b67a95b 100644
--- a/host/examples/test_clock_synch.cpp
+++ b/host/examples/test_clock_synch.cpp
@@ -25,7 +25,7 @@ namespace po = boost::program_options;
using namespace uhd::usrp_clock;
using namespace uhd::usrp;
-void get_usrp_time(multi_usrp::sptr usrp, size_t mboard, std::vector<time_t> *times){
+void get_usrp_time(multi_usrp::sptr usrp, size_t mboard, std::vector<int64_t> *times){
(*times)[mboard] = usrp->get_time_now(mboard).get_full_secs();
}
@@ -94,7 +94,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//Get GPS time to initially set USRP devices
std::cout << std::endl << "Querying Clock for time and setting USRP times..." << std::endl << std::endl;
- time_t clock_time = clock->get_time();
+ int64_t clock_time = clock->get_time();
usrp->set_time_next_pps(uhd::time_spec_t(double(clock_time+1)));
srand((unsigned int)time(NULL));
@@ -106,7 +106,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::this_thread::sleep_for(std::chrono::milliseconds(wait_time));
//Get all times before output
- std::vector<time_t> usrp_times(usrp->get_num_mboards());
+ std::vector<int64_t> usrp_times(usrp->get_num_mboards());
boost::thread_group thread_group;
clock_time = clock->get_time();
for(size_t j = 0; j < usrp->get_num_mboards(); j++){