From 876d4150aa3da531ddd687b48afada6e43f79146 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 2 Mar 2020 15:25:13 -0800 Subject: uhd: Apply clang-format against all .cpp and .hpp files in host/ Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against. --- host/lib/convert/convert_pack_sc12.hpp | 64 +++++++++++++++------------------- 1 file changed, 29 insertions(+), 35 deletions(-) (limited to 'host/lib/convert/convert_pack_sc12.hpp') diff --git a/host/lib/convert/convert_pack_sc12.hpp b/host/lib/convert/convert_pack_sc12.hpp index 053236e6f..08ec98b10 100644 --- a/host/lib/convert/convert_pack_sc12.hpp +++ b/host/lib/convert/convert_pack_sc12.hpp @@ -5,9 +5,9 @@ // SPDX-License-Identifier: GPL-3.0-or-later // -#include -#include #include "convert_common.hpp" +#include +#include using namespace uhd::convert; @@ -26,9 +26,9 @@ struct item32_sc12_3x }; enum item32_sc12_3x_enable { - CONVERT12_LINE0 = 0x01, - CONVERT12_LINE1 = 0x02, - CONVERT12_LINE2 = 0x04, + CONVERT12_LINE0 = 0x01, + CONVERT12_LINE1 = 0x02, + CONVERT12_LINE2 = 0x04, CONVERT12_LINE_ALL = 0x07, }; @@ -48,10 +48,10 @@ enum item32_sc12_3x_enable { * 31 0 */ template -void pack(item32_sc12_3x &output, int enable, const int32_t iq[8]) +void pack(item32_sc12_3x& output, int enable, const int32_t iq[8]) { if (enable & CONVERT12_LINE0) - output.line0 = towire(iq[0] << 20 | iq[1] << 8 | iq[2] >> 4); + output.line0 = towire(iq[0] << 20 | iq[1] << 8 | iq[2] >> 4); if (enable & CONVERT12_LINE1) output.line1 = towire(iq[2] << 28 | iq[3] << 16 | iq[4] << 4 | iq[5] >> 8); if (enable & CONVERT12_LINE2) @@ -59,46 +59,40 @@ void pack(item32_sc12_3x &output, int enable, const int32_t iq[8]) } template -void convert_star_4_to_sc12_item32_3 -( - const std::complex &in0, - const std::complex &in1, - const std::complex &in2, - const std::complex &in3, +void convert_star_4_to_sc12_item32_3(const std::complex& in0, + const std::complex& in1, + const std::complex& in2, + const std::complex& in3, const int enable, - item32_sc12_3x &output, + item32_sc12_3x& output, const double scalar, - typename std::enable_if::value>::type* = NULL -) + typename std::enable_if::value>::type* = NULL) { - int32_t iq[8] { - int32_t(in0.real()*scalar) & 0xfff, - int32_t(in0.imag()*scalar) & 0xfff, - int32_t(in1.real()*scalar) & 0xfff, - int32_t(in1.imag()*scalar) & 0xfff, + int32_t iq[8]{ + int32_t(in0.real() * scalar) & 0xfff, + int32_t(in0.imag() * scalar) & 0xfff, + int32_t(in1.real() * scalar) & 0xfff, + int32_t(in1.imag() * scalar) & 0xfff, - int32_t(in2.real()*scalar) & 0xfff, - int32_t(in2.imag()*scalar) & 0xfff, - int32_t(in3.real()*scalar) & 0xfff, - int32_t(in3.imag()*scalar) & 0xfff, + int32_t(in2.real() * scalar) & 0xfff, + int32_t(in2.imag() * scalar) & 0xfff, + int32_t(in3.real() * scalar) & 0xfff, + int32_t(in3.imag() * scalar) & 0xfff, }; pack(output, enable, iq); } template -void convert_star_4_to_sc12_item32_3 -( - const std::complex &in0, - const std::complex &in1, - const std::complex &in2, - const std::complex &in3, +void convert_star_4_to_sc12_item32_3(const std::complex& in0, + const std::complex& in1, + const std::complex& in2, + const std::complex& in3, const int enable, - item32_sc12_3x &output, + item32_sc12_3x& output, const double, - typename std::enable_if::value>::type* = NULL -) + typename std::enable_if::value>::type* = NULL) { - int32_t iq[8] { + int32_t iq[8]{ int32_t(in0.real() >> 4) & 0xfff, int32_t(in0.imag() >> 4) & 0xfff, int32_t(in1.real() >> 4) & 0xfff, -- cgit v1.2.3