commit 07c47d3fc9ccf9f4fbd936a62f2d9f280ef8cd5c
parent 4f71509b3fa283cf7564fa31f64da9c03bf36c2e
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date: Wed, 9 Nov 2016 10:40:32 +0300
Code formatting
Diffstat:
10 files changed, 33 insertions(+), 39 deletions(-)
diff --git a/include/kfr/base/complex.hpp b/include/kfr/base/complex.hpp
@@ -67,8 +67,8 @@ struct complex
constexpr complex(const complex&) noexcept = default;
constexpr complex(complex&&) noexcept = default;
template <typename U>
- constexpr complex(const complex<U>& other) noexcept : re(static_cast<T>(other.re)),
- im(static_cast<T>(other.im))
+ constexpr complex(const complex<U>& other) noexcept
+ : re(static_cast<T>(other.re)), im(static_cast<T>(other.im))
{
}
template <typename U>
diff --git a/include/kfr/base/generators.hpp b/include/kfr/base/generators.hpp
@@ -99,7 +99,7 @@ protected:
template <typename T, size_t width = platform<T>::vector_width* bitness_const(1, 2)>
struct generator_linear : generator<T, width, generator_linear<T, width>>
{
- constexpr generator_linear(T start, T step) noexcept : step(step), vstep(step* width)
+ constexpr generator_linear(T start, T step) noexcept : step(step), vstep(step * width)
{
this->resync(start);
}
@@ -116,7 +116,7 @@ protected:
template <typename T, size_t width = platform<T>::vector_width* bitness_const(1, 2), KFR_ARCH_DEP>
struct generator_exp : generator<T, width, generator_exp<T, width>>
{
- generator_exp(T start, T step) noexcept : step(step), vstep(exp(make_vector(step* width))[0] - 1)
+ generator_exp(T start, T step) noexcept : step(step), vstep(exp(make_vector(step * width))[0] - 1)
{
this->resync(start);
}
@@ -133,7 +133,7 @@ protected:
template <typename T, size_t width = platform<T>::vector_width* bitness_const(1, 2), KFR_ARCH_DEP>
struct generator_exp2 : generator<T, width, generator_exp2<T, width>>
{
- generator_exp2(T start, T step) noexcept : step(step), vstep(exp2(make_vector(step* width))[0] - 1)
+ generator_exp2(T start, T step) noexcept : step(step), vstep(exp2(make_vector(step * width))[0] - 1)
{
this->resync(start);
}
diff --git a/include/kfr/base/random.hpp b/include/kfr/base/random.hpp
@@ -148,9 +148,8 @@ template <typename T>
struct expression_random_range : input_expression
{
using value_type = T;
- constexpr expression_random_range(const random_bit_generator& gen, T min, T max) noexcept : gen(gen),
- min(min),
- max(max)
+ constexpr expression_random_range(const random_bit_generator& gen, T min, T max) noexcept
+ : gen(gen), min(min), max(max)
{
}
diff --git a/include/kfr/base/simd_clang.hpp b/include/kfr/base/simd_clang.hpp
@@ -234,7 +234,7 @@ struct vec : public vec_t<T, N>
// element access
struct element;
- constexpr value_type operator[](size_t index) const& noexcept { return get(index); }
+ constexpr value_type operator[](size_t index) const & noexcept { return get(index); }
constexpr value_type operator[](size_t index) && noexcept { return get(index); }
constexpr element operator[](size_t index) & noexcept { return { *this, index }; }
diff --git a/include/kfr/base/vec.hpp b/include/kfr/base/vec.hpp
@@ -128,7 +128,7 @@ constexpr inline auto scale_impl(csizes_t<indices...> ind, csizes_t<counter...>
template <size_t groupsize, size_t... indices>
constexpr inline auto scale() noexcept
{
- return internal::scale_impl(csizes_t<indices...>(), csizeseq_t<sizeof...(indices)*groupsize>());
+ return internal::scale_impl(csizes_t<indices...>(), csizeseq_t<sizeof...(indices) * groupsize>());
}
template <typename T, size_t Nin, size_t N>
diff --git a/include/kfr/cometa/array.hpp b/include/kfr/cometa/array.hpp
@@ -55,8 +55,8 @@ public:
{
}
template <typename... Ts, CMT_ENABLE_IF(sizeof...(Ts), is_const<T>::value)>
- constexpr array_ref(const std::vector<remove_const<T>, Ts...>& vec) noexcept : m_data(vec.data()),
- m_size(vec.size())
+ constexpr array_ref(const std::vector<remove_const<T>, Ts...>& vec) noexcept
+ : m_data(vec.data()), m_size(vec.size())
{
}
template <typename... Ts>
@@ -64,8 +64,8 @@ public:
{
}
template <typename InputIter>
- constexpr array_ref(InputIter first, InputIter last) noexcept : m_data(std::addressof(*first)),
- m_size(std::distance(first, last))
+ constexpr array_ref(InputIter first, InputIter last) noexcept
+ : m_data(std::addressof(*first)), m_size(std::distance(first, last))
{
}
constexpr array_ref(T* data, size_type size) noexcept : m_data(data), m_size(size) {}
diff --git a/include/kfr/cometa/cstring.hpp b/include/kfr/cometa/cstring.hpp
@@ -100,8 +100,9 @@ CMT_INTRIN cstring<N1 - Nfrom + Nto> str_replace_impl(size_t pos, const cstring<
{
if (pos == size_t(-1))
stop_constexpr();
- return { { (indices < pos ? str[indices] : (indices < pos + Nto - 1) ? to[indices - pos]
- : str[indices - Nto + Nfrom])...,
+ return { { (indices < pos
+ ? str[indices]
+ : (indices < pos + Nto - 1) ? to[indices - pos] : str[indices - Nto + Nfrom])...,
0 } };
}
}
diff --git a/include/kfr/cometa/range.hpp b/include/kfr/cometa/range.hpp
@@ -17,9 +17,8 @@ struct range
using const_pointer = const T*;
using diff_type = decltype(std::declval<T>() - std::declval<T>());
- constexpr range(value_type begin, value_type end, diff_type step) noexcept : value_begin(begin),
- value_end(end),
- step(step)
+ constexpr range(value_type begin, value_type end, diff_type step) noexcept
+ : value_begin(begin), value_end(end), step(step)
{
}
diff --git a/include/kfr/data/sincos.hpp b/include/kfr/data/sincos.hpp
@@ -174,18 +174,20 @@ constexpr inline T sin_using_table_256(size_t k);
template <>
constexpr inline f32 sin_using_table_256<f32>(size_t k)
{
- return (k == 0 || k == 128) ? 0.f : (k == 64) ? 1.f : (k > 128)
- ? -sin_using_table_256<f32>(k - 128)
- : (k > 64) ? sin_using_table_256<f32>(128 - k)
- : data::c_sin_table_f32[k];
+ return (k == 0 || k == 128) ? 0.f
+ : (k == 64) ? 1.f
+ : (k > 128) ? -sin_using_table_256<f32>(k - 128)
+ : (k > 64) ? sin_using_table_256<f32>(128 - k)
+ : data::c_sin_table_f32[k];
}
template <>
constexpr inline f64 sin_using_table_256<f64>(size_t k)
{
- return (k == 0 || k == 128) ? 0.0 : (k == 64) ? 1.0 : (k > 128)
- ? -sin_using_table_256<f64>(k - 128)
- : (k > 64) ? sin_using_table_256<f64>(128 - k)
- : data::c_sin_table_f64[k];
+ return (k == 0 || k == 128) ? 0.0
+ : (k == 64) ? 1.0
+ : (k > 128) ? -sin_using_table_256<f64>(k - 128)
+ : (k > 64) ? sin_using_table_256<f64>(128 - k)
+ : data::c_sin_table_f64[k];
}
template <typename T>
diff --git a/include/kfr/dsp/biquad.hpp b/include/kfr/dsp/biquad.hpp
@@ -51,24 +51,17 @@ template <typename T>
struct biquad_params
{
template <typename U>
- constexpr biquad_params(const biquad_params<U>& bq) noexcept : a0(static_cast<T>(bq.a0)),
- a1(static_cast<T>(bq.a1)),
- a2(static_cast<T>(bq.a2)),
- b0(static_cast<T>(bq.b0)),
- b1(static_cast<T>(bq.b1)),
- b2(static_cast<T>(bq.b2))
+ constexpr biquad_params(const biquad_params<U>& bq) noexcept
+ : a0(static_cast<T>(bq.a0)), a1(static_cast<T>(bq.a1)), a2(static_cast<T>(bq.a2)),
+ b0(static_cast<T>(bq.b0)), b1(static_cast<T>(bq.b1)), b2(static_cast<T>(bq.b2))
{
}
constexpr static bool is_pod = true;
static_assert(std::is_floating_point<T>::value, "T must be a floating point type");
constexpr biquad_params() noexcept : a0(1), a1(0), a2(0), b0(1), b1(0), b2(0) {}
- constexpr biquad_params(T a0, T a1, T a2, T b0, T b1, T b2) noexcept : a0(a0),
- a1(a1),
- a2(a2),
- b0(b0),
- b1(b1),
- b2(b2)
+ constexpr biquad_params(T a0, T a1, T a2, T b0, T b1, T b2) noexcept
+ : a0(a0), a1(a1), a2(a2), b0(b0), b1(b1), b2(b2)
{
}
T a0;