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/tests/common/mock_zero_copy.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/tests/common/mock_zero_copy.cpp')
-rw-r--r-- | host/tests/common/mock_zero_copy.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/host/tests/common/mock_zero_copy.cpp b/host/tests/common/mock_zero_copy.cpp index bc49c3f10..0843a0274 100644 --- a/host/tests/common/mock_zero_copy.cpp +++ b/host/tests/common/mock_zero_copy.cpp @@ -10,18 +10,19 @@ using namespace uhd::transport; -mock_zero_copy::mock_zero_copy( - vrt::if_packet_info_t::link_type_t link_type, +mock_zero_copy::mock_zero_copy(vrt::if_packet_info_t::link_type_t link_type, size_t recv_frame_size, - size_t send_frame_size -) : _link_type(link_type) - , _recv_frame_size(recv_frame_size) - , _send_frame_size(send_frame_size) { + size_t send_frame_size) + : _link_type(link_type) + , _recv_frame_size(recv_frame_size) + , _send_frame_size(send_frame_size) +{ } -uhd::transport::managed_recv_buffer::sptr mock_zero_copy::get_recv_buff(double) { +uhd::transport::managed_recv_buffer::sptr mock_zero_copy::get_recv_buff(double) +{ if (_simulate_io_error) { - throw uhd::io_error("IO error exception"); //simulate an IO error + throw uhd::io_error("IO error exception"); // simulate an IO error } if (_rx_mems.empty()) { return uhd::transport::managed_recv_buffer::sptr(); // timeout @@ -38,20 +39,22 @@ uhd::transport::managed_recv_buffer::sptr mock_zero_copy::get_recv_buff(double) return mrb; } -uhd::transport::managed_send_buffer::sptr mock_zero_copy::get_send_buff(double) { +uhd::transport::managed_send_buffer::sptr mock_zero_copy::get_send_buff(double) +{ if (not _reuse_send_memory or _tx_mems.size() == 0) { - _tx_mems.push_back( - boost::shared_array<uint8_t>(new uint8_t[_send_frame_size])); + _tx_mems.push_back(boost::shared_array<uint8_t>(new uint8_t[_send_frame_size])); _tx_lens.push_back(_send_frame_size); } return _msb.get_new(_tx_mems.back(), &_tx_lens.back()); } -void mock_zero_copy::set_reuse_recv_memory(bool reuse_recv) { +void mock_zero_copy::set_reuse_recv_memory(bool reuse_recv) +{ _reuse_recv_memory = reuse_recv; } -void mock_zero_copy::set_reuse_send_memory(bool reuse_send) { +void mock_zero_copy::set_reuse_send_memory(bool reuse_send) +{ _reuse_send_memory = reuse_send; } |