Skip to content

Commit 3b494c1

Browse files
committed
Clang format
1 parent 98f974b commit 3b494c1

File tree

19 files changed

+80
-72
lines changed

19 files changed

+80
-72
lines changed

src/base/anim/interpolated.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ template <typename Type> class Interpolated
230230
std::less<T>>;
231231
return !has_second ? this->values[0].value
232232
: std::min(this->values[0].value,
233-
this->values[1].value,
234-
Less{});
233+
this->values[1].value,
234+
Less{});
235235
}
236236

237237
template <typename T = Type> [[nodiscard]] T max() const
@@ -241,8 +241,8 @@ template <typename Type> class Interpolated
241241
std::less<T>>;
242242
return !has_second ? this->values[0].value
243243
: std::max(this->values[0].value,
244-
this->values[1].value,
245-
Less{});
244+
this->values[1].value,
245+
Less{});
246246
}
247247
};
248248

src/base/conv/parse.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ template <typename To> To parse(const std::string &string)
4343
[]<bool flag = false>()
4444
{
4545
static_assert(flag, "no conversion from string");
46-
}
47-
();
46+
}();
4847
}
4948

5049
}

src/base/conv/tostring.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ std::string toString(const From &value)
4747
[]<bool flag = false>()
4848
{
4949
static_assert(flag, "no string conversion");
50-
}
51-
();
50+
}();
5251
}
5352

5453
}

src/base/geom/circle.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ bool Circle::overlaps(const Circle &c) const
3434
{
3535
auto d = c.center - center;
3636
auto sumRadius = radius + c.radius;
37-
return Math::AddTolerance(d.sqrAbs())
38-
< sumRadius * sumRadius;
37+
return Math::AddTolerance(d.sqrAbs()) < sumRadius * sumRadius;
3938
}
4039

4140
Rect Circle::boundary() const

src/base/geom/line.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ struct Line
6161

6262
[[nodiscard]] double distance(const Point &point) const
6363
{
64-
if (isPoint())
65-
return (point - begin).abs();
64+
if (isPoint()) return (point - begin).abs();
6665

6766
auto projection = ((point - begin).dot(getDirection()))
6867
/ (length() * length());

src/base/geom/quadrilateral.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ConvexQuad
2222
double base0Length,
2323
double base1Length);
2424

25-
[[nodiscard]] double distance(const Point& point) const;
25+
[[nodiscard]] double distance(const Point &point) const;
2626
};
2727

2828
}

src/base/geom/triangle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Triangle
1515

1616
[[nodiscard]] double area() const;
1717

18-
[[nodiscard]] double distance(const Point& point) const;
18+
[[nodiscard]] double distance(const Point &point) const;
1919
};
2020

2121
}

src/base/math/interpolation.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ namespace Math
88

99
template <typename T>
1010
requires(!std::is_same_v<std::remove_cvref_t<T>, bool>)
11-
auto interpolate(const T &op0, const T &op1, double factor)
12-
-> decltype(op0 * (1.0 - factor) + op1 * factor)
11+
auto interpolate(const T &op0,
12+
const T &op1,
13+
double factor) -> decltype(op0 * (1.0 - factor) + op1 * factor)
1314
{
1415
if (factor <= 0.0) return op0;
1516
if (factor >= 1.0) return op1;

src/base/refl/auto_struct.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@ namespace Functors
535535
namespace Composite
536536
{
537537
template <class T, class U>
538-
constexpr inline auto operator>>(U &&arg, const T &)
539-
-> decltype(T::get(std::forward<U &&>(arg)))
538+
constexpr inline auto operator>>(U &&arg,
539+
const T &) -> decltype(T::get(std::forward<U &&>(arg)))
540540
{
541541
return T::get(std::forward<U &&>(arg));
542542
}

src/base/style/impl.tpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ template <class T> T Sheet<T>::getFullParams() const
1515

1616
template <class T> ParamRegistry<T>::ParamRegistry()
1717
{
18-
Refl::visit<T>([this]<class U,
19-
class =
20-
std::enable_if_t<std::is_constructible_v<Accessor, U>>>(
21-
U && accessor,
22-
const std::initializer_list<std::string_view> &thePath = {}) {
23-
std::string currentPath;
24-
for (auto sv : thePath) {
25-
if (!currentPath.empty()) currentPath += '.';
26-
currentPath += sv;
27-
}
18+
Refl::visit<T>(
19+
[this]<class U,
20+
class = std::enable_if_t<
21+
std::is_constructible_v<Accessor, U>>>(U &&accessor,
22+
const std::initializer_list<std::string_view> &thePath =
23+
{})
24+
{
25+
std::string currentPath;
26+
for (auto sv : thePath) {
27+
if (!currentPath.empty()) currentPath += '.';
28+
currentPath += sv;
29+
}
2830

29-
accessors.try_emplace(std::move(currentPath),
30-
std::forward<U>(accessor));
31-
});
31+
accessors.try_emplace(std::move(currentPath),
32+
std::forward<U>(accessor));
33+
});
3234
}
3335
}
3436

0 commit comments

Comments
 (0)