aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorMarcus Müller <marcus.mueller@ettus.com>2018-02-18 19:53:53 +0100
committerMartin Braun <martin.braun@ettus.com>2018-02-19 14:23:47 -0800
commit1651444b27a6c437ab8395f19fe4a6609b6e2895 (patch)
treec04c468c8ee99d9f8885a926ffc94a429e9d3f66 /host/examples
parent7a06c6f036cfe16e8e95eea7c70be14171c998d3 (diff)
downloaduhd-1651444b27a6c437ab8395f19fe4a6609b6e2895.tar.gz
uhd-1651444b27a6c437ab8395f19fe4a6609b6e2895.tar.bz2
uhd-1651444b27a6c437ab8395f19fe4a6609b6e2895.zip
examples: replace `boost::format%(a,b)` by `(boost::format%a%b)`
The former compiles to evaluating `a`, then throwing away the result, evaluating `b`, then using that to fill in the first placeholder in `format`. And that is wrong. Pointed to this by Clang++'s "unused result" warning.
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/twinrx_freq_hopping.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/host/examples/twinrx_freq_hopping.cpp b/host/examples/twinrx_freq_hopping.cpp
index 67a4d99f6..95affbf5b 100644
--- a/host/examples/twinrx_freq_hopping.cpp
+++ b/host/examples/twinrx_freq_hopping.cpp
@@ -153,7 +153,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
}
if (start_freq < rx_freq_range.start() or end_freq > rx_freq_range.stop()) {
throw uhd::runtime_error((boost::format("Start and stop frequencies must be between %d and %d MHz")
- % ((rx_freq_range.start() / 1e6), (rx_freq_range.stop() / 1e6))).str());
+ % (rx_freq_range.start() / 1e6) % (rx_freq_range.stop() / 1e6)).str());
}
if (start_freq > end_freq) {
throw uhd::runtime_error("Start frequency must be less than end frequency.");