diff options
author | Martin Braun <martin.braun@ettus.com> | 2021-01-08 09:33:36 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-03-04 08:07:26 -0600 |
commit | 107a49c0c236940da7d3bd0f57da4bc1e2a34cb4 (patch) | |
tree | fdeaad56030a02948377c45838dab97beb7a5c84 /host/lib/convert | |
parent | 7d5e48032baa62cbe7467833b9e057900602f4b9 (diff) | |
download | uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.tar.gz uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.tar.bz2 uhd-107a49c0c236940da7d3bd0f57da4bc1e2a34cb4.zip |
host: Update code base using clang-tidy
The checks from the new clang-tidy file are applied to the source tree
using:
$ find . -name "*.cpp" | sort -u | xargs \
--max-procs 8 --max-args 1 clang-tidy --format-style=file \
--fix -p /path/to/compile_commands.json
Diffstat (limited to 'host/lib/convert')
-rw-r--r-- | host/lib/convert/convert_fc32_item32.cpp | 14 | ||||
-rw-r--r-- | host/lib/convert/convert_pack_sc12.cpp | 7 | ||||
-rw-r--r-- | host/lib/convert/convert_unpack_sc12.cpp | 7 | ||||
-rw-r--r-- | host/lib/convert/convert_with_tables.cpp | 21 | ||||
-rw-r--r-- | host/lib/convert/ssse3_pack_sc12.cpp | 7 | ||||
-rw-r--r-- | host/lib/convert/ssse3_unpack_sc12.cpp | 7 |
6 files changed, 36 insertions, 27 deletions
diff --git a/host/lib/convert/convert_fc32_item32.cpp b/host/lib/convert/convert_fc32_item32.cpp index 713f565f5..842485162 100644 --- a/host/lib/convert/convert_fc32_item32.cpp +++ b/host/lib/convert/convert_fc32_item32.cpp @@ -23,13 +23,14 @@ struct convert_fc32_item32_1_to_star_1 : public converter // NOP } - void set_scalar(const double scalar) + void set_scalar(const double scalar) override { _scalar = scalar; } - void operator()( - const input_type& inputs, const output_type& outputs, const size_t nsamps) + void operator()(const input_type& inputs, + const output_type& outputs, + const size_t nsamps) override { const item32_t* input = reinterpret_cast<const item32_t*>(inputs[0]); std::complex<type>* output = reinterpret_cast<std::complex<type>*>(outputs[0]); @@ -56,13 +57,14 @@ struct convert_star_1_to_fc32_item32_1 : public converter // NOP } - void set_scalar(const double scalar) + void set_scalar(const double scalar) override { _scalar = scalar; } - void operator()( - const input_type& inputs, const output_type& outputs, const size_t nsamps) + void operator()(const input_type& inputs, + const output_type& outputs, + const size_t nsamps) override { const std::complex<type>* input = reinterpret_cast<const std::complex<type>*>(inputs[0]); diff --git a/host/lib/convert/convert_pack_sc12.cpp b/host/lib/convert/convert_pack_sc12.cpp index ee28e00cd..5e4c00414 100644 --- a/host/lib/convert/convert_pack_sc12.cpp +++ b/host/lib/convert/convert_pack_sc12.cpp @@ -17,13 +17,14 @@ struct convert_star_1_to_sc12_item32_1 : public converter // NOP } - void set_scalar(const double scalar) + void set_scalar(const double scalar) override { _scalar = scalar; } - void operator()( - const input_type& inputs, const output_type& outputs, const size_t nsamps) + void operator()(const input_type& inputs, + const output_type& outputs, + const size_t nsamps) override { const std::complex<type>* input = reinterpret_cast<const std::complex<type>*>(inputs[0]); diff --git a/host/lib/convert/convert_unpack_sc12.cpp b/host/lib/convert/convert_unpack_sc12.cpp index 9ec43a5c3..6d8a48876 100644 --- a/host/lib/convert/convert_unpack_sc12.cpp +++ b/host/lib/convert/convert_unpack_sc12.cpp @@ -17,7 +17,7 @@ struct convert_sc12_item32_1_to_star_1 : public converter // NOP } - void set_scalar(const double scalar) + void set_scalar(const double scalar) override { const int unpack_growth = 16; _scalar = scalar / unpack_growth; @@ -31,8 +31,9 @@ struct convert_sc12_item32_1_to_star_1 : public converter * converter must be aware where it is supposed to start within 3 lines. * */ - void operator()( - const input_type& inputs, const output_type& outputs, const size_t nsamps) + void operator()(const input_type& inputs, + const output_type& outputs, + const size_t nsamps) override { /* * Looking at the line structure above we can identify 4 cases. diff --git a/host/lib/convert/convert_with_tables.cpp b/host/lib/convert/convert_with_tables.cpp index 86637171a..3df510092 100644 --- a/host/lib/convert/convert_with_tables.cpp +++ b/host/lib/convert/convert_with_tables.cpp @@ -26,7 +26,7 @@ class convert_sc16_1_to_sc8_item32_1 : public converter public: convert_sc16_1_to_sc8_item32_1(void) : _table(sc16_table_len) {} - void set_scalar(const double scalar) + void set_scalar(const double scalar) override { for (size_t i = 0; i < sc16_table_len; i++) { const int16_t val = uint16_t(i); @@ -34,8 +34,9 @@ public: } } - void operator()( - const input_type& inputs, const output_type& outputs, const size_t nsamps) + void operator()(const input_type& inputs, + const output_type& outputs, + const size_t nsamps) override { const sc16_t* input = reinterpret_cast<const sc16_t*>(inputs[0]); item32_t* output = reinterpret_cast<item32_t*>(outputs[0]); @@ -79,7 +80,7 @@ class convert_sc16_item32_1_to_fcxx_1 : public converter public: convert_sc16_item32_1_to_fcxx_1(void) : _table(sc16_table_len) {} - void set_scalar(const double scalar) + void set_scalar(const double scalar) override { for (size_t i = 0; i < sc16_table_len; i++) { const uint16_t val = tohost(uint16_t(i & 0xffff)); @@ -87,8 +88,9 @@ public: } } - void operator()( - const input_type& inputs, const output_type& outputs, const size_t nsamps) + void operator()(const input_type& inputs, + const output_type& outputs, + const size_t nsamps) override { const item32_t* input = reinterpret_cast<const item32_t*>(inputs[0]); std::complex<type>* output = reinterpret_cast<std::complex<type>*>(outputs[0]); @@ -123,7 +125,7 @@ public: return type(num * scalar); } - void set_scalar(const double scalar) + void set_scalar(const double scalar) override { for (size_t i = 0; i < sc16_table_len; i++) { const uint16_t val = tohost(uint16_t(i & 0xffff)); @@ -133,8 +135,9 @@ public: } } - void operator()( - const input_type& inputs, const output_type& outputs, const size_t nsamps) + void operator()(const input_type& inputs, + const output_type& outputs, + const size_t nsamps) override { const item32_t* input = reinterpret_cast<const item32_t*>(size_t(inputs[0]) & ~0x3); diff --git a/host/lib/convert/ssse3_pack_sc12.cpp b/host/lib/convert/ssse3_pack_sc12.cpp index 4ba14db3b..a8b415a2c 100644 --- a/host/lib/convert/ssse3_pack_sc12.cpp +++ b/host/lib/convert/ssse3_pack_sc12.cpp @@ -117,13 +117,14 @@ struct convert_star_1_to_sc12_item32_2 : public converter { convert_star_1_to_sc12_item32_2(void) : _scalar(0.0) {} - void set_scalar(const double scalar) + void set_scalar(const double scalar) override { _scalar = scalar; } - void operator()( - const input_type& inputs, const output_type& outputs, const size_t nsamps) + void operator()(const input_type& inputs, + const output_type& outputs, + const size_t nsamps) override { const std::complex<type>* input = reinterpret_cast<const std::complex<type>*>(inputs[0]); diff --git a/host/lib/convert/ssse3_unpack_sc12.cpp b/host/lib/convert/ssse3_unpack_sc12.cpp index 5494e0fd7..351e1d821 100644 --- a/host/lib/convert/ssse3_unpack_sc12.cpp +++ b/host/lib/convert/ssse3_unpack_sc12.cpp @@ -127,14 +127,15 @@ struct convert_sc12_item32_1_to_star_2 : public converter // NOP } - void set_scalar(const double scalar) + void set_scalar(const double scalar) override { const int unpack_growth = 16; _scalar = scalar / unpack_growth; } - void operator()( - const input_type& inputs, const output_type& outputs, const size_t nsamps) + void operator()(const input_type& inputs, + const output_type& outputs, + const size_t nsamps) override { const size_t head_samps = size_t(inputs[0]) & 0x3; size_t rewind = 0; |