diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-08-16 14:25:24 -0700 |
---|---|---|
committer | Brent Stapleton <bstapleton@g.hmc.edu> | 2018-08-20 16:56:43 -0700 |
commit | 8e3ea14c9406f3f3e5fe613bfe59906447a195e0 (patch) | |
tree | 9e7924432f7c3be99693faed5478a8b95c3ecb97 /host/examples/rx_samples_c.c | |
parent | 3b42e6f029f0d3de0f54d720964357aa0a32986f (diff) | |
download | uhd-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/rx_samples_c.c')
-rw-r--r-- | host/examples/rx_samples_c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/host/examples/rx_samples_c.c b/host/examples/rx_samples_c.c index b31450184..1cabafc9d 100644 --- a/host/examples/rx_samples_c.c +++ b/host/examples/rx_samples_c.c @@ -223,12 +223,12 @@ int main(int argc, char* argv[]) // Handle data fwrite(buff, sizeof(float) * 2, num_rx_samps, fp); if (verbose) { - time_t full_secs; + int64_t full_secs; double frac_secs; uhd_rx_metadata_time_spec(md, &full_secs, &frac_secs); fprintf(stderr, "Received packet: %zu samples, %.f full secs, %f frac secs\n", num_rx_samps, - difftime(full_secs, (time_t) 0), + difftime(full_secs, (int64_t) 0), frac_secs); } |