diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2019-01-14 10:35:25 -0800 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-01-16 11:40:23 -0800 |
commit | 967be2a4e82b1a125b26bb72a60318a4fb2b50c4 (patch) | |
tree | 8a24954b54d1546dc8049a17e485adb0a605f74f /host/utils/latency/responder.cpp | |
parent | aafe4e8b742a0e21d3818f21f34e3c8613132530 (diff) | |
download | uhd-967be2a4e82b1a125b26bb72a60318a4fb2b50c4.tar.gz uhd-967be2a4e82b1a125b26bb72a60318a4fb2b50c4.tar.bz2 uhd-967be2a4e82b1a125b26bb72a60318a4fb2b50c4.zip |
uhd: mpm: apply clang-format to all files
Applying formatting changes to all .cpp and .hpp files in the following
directories:
```
find host/examples/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
find host/tests/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
find host/utils/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
find mpm/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
```
Also formatted host/include/, except Cpp03 was used as a the language
standard instead of Cpp11.
```
sed -i 's/ Cpp11/ Cpp03/g' .clang-format
find host/include/ -iname *.hpp -o -iname *.cpp | \
xargs clang-format -i -style=file
```
Formatting style was designated by the .clang-format file.
Diffstat (limited to 'host/utils/latency/responder.cpp')
-rw-r--r-- | host/utils/latency/responder.cpp | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/host/utils/latency/responder.cpp b/host/utils/latency/responder.cpp index 6216f15e6..fd47ad085 100644 --- a/host/utils/latency/responder.cpp +++ b/host/utils/latency/responder.cpp @@ -5,16 +5,15 @@ // SPDX-License-Identifier: GPL-3.0-or-later // -#include <boost/program_options.hpp> #include <uhd/utils/safe_main.hpp> #include <Responder.hpp> +#include <boost/program_options.hpp> namespace po = boost::program_options; static Responder::Options prog; -po::options_description -get_program_options_description() +po::options_description get_program_options_description() { po::options_description desc("Allowed options"); // clang-format off @@ -71,41 +70,40 @@ get_program_options_description() return desc; } -void -read_program_options(po::variables_map vm) +void read_program_options(po::variables_map vm) { // read out given options prog.realtime = (vm.count("no-realtime") == 0); prog.delay_step = std::abs(prog.delay_step); - if (prog.delay_min > prog.delay_max) - { + if (prog.delay_min > prog.delay_max) { prog.delay_step *= -1; } - prog.allow_late_bursts = (vm.count("allow-late") > 0); + prog.allow_late_bursts = (vm.count("allow-late") > 0); prog.test_iterations_is_sample_count = (vm.count("test-duration") > 0); - prog.invert = ((vm.count("invert") > 0) ? -1.0f : 1.0f); - prog.output_value = ((vm.count("invert-output") > 0) ? -1.0f : 1.0f); - prog.skip_eob = (vm.count("skip-eob") > 0); - prog.no_delay = (vm.count("no-delay") > 0); - prog.adjust_simulation_rate = (vm.count("adjust-simulation-rate") > 0); + prog.invert = ((vm.count("invert") > 0) ? -1.0f : 1.0f); + prog.output_value = ((vm.count("invert-output") > 0) ? -1.0f : 1.0f); + prog.skip_eob = (vm.count("skip-eob") > 0); + prog.no_delay = (vm.count("no-delay") > 0); + prog.adjust_simulation_rate = (vm.count("adjust-simulation-rate") > 0); prog.optimize_simulation_rate = (vm.count("optimize-simulation-rate") > 0); - prog.no_stats_file = (vm.count("no-stats-file") > 0); - prog.log_file = (vm.count("log-file") > 0); - prog.batch_mode = (vm.count("batch-mode") > 0); - prog.skip_if_results_exist = (vm.count("skip-if-exists") > 0); - prog.skip_send = (vm.count("disable-send") > 0); - prog.combine_eob = (vm.count("combine-eob") > 0); - prog.pause = (vm.count("pause") > 0); - prog.ignore_simulation_check = vm.count("ignore-simulation-check"); + prog.no_stats_file = (vm.count("no-stats-file") > 0); + prog.log_file = (vm.count("log-file") > 0); + prog.batch_mode = (vm.count("batch-mode") > 0); + prog.skip_if_results_exist = (vm.count("skip-if-exists") > 0); + prog.skip_send = (vm.count("disable-send") > 0); + prog.combine_eob = (vm.count("combine-eob") > 0); + prog.pause = (vm.count("pause") > 0); + prog.ignore_simulation_check = vm.count("ignore-simulation-check"); } /* * This is the MAIN function! * UHD_SAFE_MAIN catches all errors and prints them to stderr. */ -int UHD_SAFE_MAIN(int argc, char *argv[]){ +int UHD_SAFE_MAIN(int argc, char* argv[]) +{ po::options_description desc = get_program_options_description(); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); @@ -113,13 +111,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ read_program_options(vm); // Print help message instead of executing Responder. - if (vm.count("help")){ + if (vm.count("help")) { cout << boost::format("UHD Latency Test %s") % desc; return Responder::RETCODE_OK; } - //create a new instance of Responder and run it! + // create a new instance of Responder and run it! boost::shared_ptr<Responder> my_responder(new Responder(prog)); return my_responder->run(); } - |