aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/benchmark_rate.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-02-19 14:16:24 -0800
committerMartin Braun <martin.braun@ettus.com>2018-02-19 17:01:40 -0800
commit305d0e79e219b427c6425dab0715ed2132d928b8 (patch)
tree9962f0fd34c1d0488255785cf99243708dec4fb6 /host/examples/benchmark_rate.cpp
parent21b5f2c6aa88af5488b140da0ef7ed34cc14153f (diff)
downloaduhd-305d0e79e219b427c6425dab0715ed2132d928b8.tar.gz
uhd-305d0e79e219b427c6425dab0715ed2132d928b8.tar.bz2
uhd-305d0e79e219b427c6425dab0715ed2132d928b8.zip
examples: Fix some minor compiler warnings
All warnings reported by MSVC. Mostly related to narrowing conversions.
Diffstat (limited to 'host/examples/benchmark_rate.cpp')
-rw-r--r--host/examples/benchmark_rate.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/host/examples/benchmark_rate.cpp b/host/examples/benchmark_rate.cpp
index 0c16e5ecf..3b5816847 100644
--- a/host/examples/benchmark_rate.cpp
+++ b/host/examples/benchmark_rate.cpp
@@ -20,8 +20,8 @@
namespace po = boost::program_options;
-const double CLOCK_TIMEOUT = 1000; // 1000mS timeout for external clock locking
-const double INIT_DELAY = 0.05; // 50mS initial delay before transmit
+const int64_t CLOCK_TIMEOUT = 1000; // 1000mS timeout for external clock locking
+const float INIT_DELAY = 0.05; // 50mS initial delay before transmit
//typedef boost::atomic<bool> atomic_bool;
// We'll fake atomic bools for now, for more backward compat.
// This is just an example, after all.
@@ -72,7 +72,8 @@ void benchmark_rx_rate(
cmd.stream_now = (buffs.size() == 1);
rx_stream->issue_stream_cmd(cmd);
- const float burst_pkt_time = std::max(0.100, (2 * max_samps_per_packet/rate));
+ const float burst_pkt_time =
+ std::max<float>(0.100f, (2 * max_samps_per_packet/rate));
float recv_timeout = burst_pkt_time + INIT_DELAY;
bool stop_called = false;
@@ -353,7 +354,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if(ref != "internal") {
std::cout << "Now confirming lock on clock signals..." << std::endl;
bool is_locked = false;
- boost::system_time end_time = boost::get_system_time() + boost::posix_time::milliseconds(CLOCK_TIMEOUT);
+ boost::system_time end_time =
+ boost::get_system_time() +
+ boost::posix_time::milliseconds(CLOCK_TIMEOUT);
for (int i = 0; i < num_mboards; i++) {
if (ref == "mimo" and i == 0) continue;
while((is_locked = usrp->get_mboard_sensor("ref_locked",i).to_bool()) == false and