diff options
author | Philip Balister <philip@opensdr.com> | 2016-09-29 11:32:26 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-10-13 17:34:40 -0700 |
commit | 11bdf9e8a5342d54947d4aace0ce93f8808727d9 (patch) | |
tree | 0b72a5dbc958b2d93a80dd97462483f4a8f4c6c9 /host | |
parent | b33ff03050fe368c194c1400358c0bbde809da69 (diff) | |
download | uhd-11bdf9e8a5342d54947d4aace0ce93f8808727d9.tar.gz uhd-11bdf9e8a5342d54947d4aace0ce93f8808727d9.tar.bz2 uhd-11bdf9e8a5342d54947d4aace0ce93f8808727d9.zip |
Fix warning in rx_samples_c.c.
time_t is not guaranteed to be printable as in int type. Use
difftime to portably convert time_t to float and print result.
Signed-off-by: Philip Balister <philip@opensdr.com>
Diffstat (limited to 'host')
-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 0ecb89153..d269e29b7 100644 --- a/host/examples/rx_samples_c.c +++ b/host/examples/rx_samples_c.c @@ -233,9 +233,9 @@ int main(int argc, char* argv[]) time_t full_secs; double frac_secs; uhd_rx_metadata_time_spec(md, &full_secs, &frac_secs); - fprintf(stderr, "Received packet: %zu samples, %zu full secs, %f frac secs\n", + fprintf(stderr, "Received packet: %zu samples, %.f full secs, %f frac secs\n", num_rx_samps, - full_secs, + difftime(full_secs, (time_t) 0), frac_secs); } |