From 8e3ea14c9406f3f3e5fe613bfe59906447a195e0 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 16 Aug 2018 14:25:24 -0700 Subject: 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. --- host/examples/sync_to_gps.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/examples/sync_to_gps.cpp') diff --git a/host/examples/sync_to_gps.cpp b/host/examples/sync_to_gps.cpp index 0b7f030bc..bb0f77f61 100644 --- a/host/examples/sync_to_gps.cpp +++ b/host/examples/sync_to_gps.cpp @@ -111,7 +111,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]) } //Set to GPS time - uhd::time_spec_t gps_time = uhd::time_spec_t(time_t(usrp->get_mboard_sensor("gps_time", mboard).to_int())); + uhd::time_spec_t gps_time = uhd::time_spec_t(int64_t(usrp->get_mboard_sensor("gps_time", mboard).to_int())); usrp->set_time_next_pps(gps_time+1.0, mboard); //Wait for it to apply @@ -121,7 +121,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]) std::this_thread::sleep_for(std::chrono::seconds(2)); //Check times - gps_time = uhd::time_spec_t(time_t(usrp->get_mboard_sensor("gps_time", mboard).to_int())); + gps_time = uhd::time_spec_t(int64_t(usrp->get_mboard_sensor("gps_time", mboard).to_int())); uhd::time_spec_t time_last_pps = usrp->get_time_last_pps(mboard); std::cout << "USRP time: " << (boost::format("%0.9f") % time_last_pps.get_real_secs()) << std::endl; std::cout << "GPSDO time: " << (boost::format("%0.9f") % gps_time.get_real_secs()) << std::endl; -- cgit v1.2.3