Skip to content

Commit 23908a4

Browse files
author
Philipp Otto
committed
Fix formatting in helper
1 parent 397a73e commit 23908a4

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

source/tools/glkernel-cli/helper.cpp

+31-27
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ void throwIfNot(bool condition, const std::string& msg)
1515

1616
std::pair<float, float> findMinMaxElements(const glkernel::tkernel<float> & kernel)
1717
{
18-
const auto minmax = std::minmax_element(kernel.cbegin(), kernel.cend());
19-
return std::make_pair(*minmax.first, *minmax.second);
18+
const auto minmax = std::minmax_element(kernel.cbegin(), kernel.cend());
19+
return std::make_pair(*minmax.first, *minmax.second);
2020
}
2121

2222
std::pair<float, float> findMinMaxElements(const glkernel::tkernel<glm::vec2> & kernel)
2323
{
24-
float min = std::numeric_limits<float>::max();
25-
float max = std::numeric_limits<float>::min();
26-
const auto end = kernel.cend();
27-
for (auto it = kernel.cbegin(); it != end; ++it)
28-
{
24+
float min = std::numeric_limits<float>::max();
25+
float max = std::numeric_limits<float>::min();
26+
const auto end = kernel.cend();
27+
for (auto it = kernel.cbegin(); it != end; ++it)
28+
{
2929
const auto x = it->x;
3030
const auto y = it->y;
3131

@@ -34,18 +34,18 @@ std::pair<float, float> findMinMaxElements(const glkernel::tkernel<glm::vec2> &
3434

3535
max = x > max ? x : max;
3636
max = y > max ? y : max;
37-
}
37+
}
3838

39-
return std::make_pair(min, max);
39+
return std::make_pair(min, max);
4040
}
4141

4242
std::pair<float, float> findMinMaxElements(const glkernel::tkernel<glm::vec3> & kernel)
4343
{
44-
float min = std::numeric_limits<float>::max();
45-
float max = std::numeric_limits<float>::min();
46-
const auto end = kernel.cend();
47-
for (auto it = kernel.cbegin(); it != end; ++it)
48-
{
44+
float min = std::numeric_limits<float>::max();
45+
float max = std::numeric_limits<float>::min();
46+
const auto end = kernel.cend();
47+
for (auto it = kernel.cbegin(); it != end; ++it)
48+
{
4949
const auto x = it->x;
5050
const auto y = it->y;
5151
const auto z = it->z;
@@ -57,18 +57,18 @@ std::pair<float, float> findMinMaxElements(const glkernel::tkernel<glm::vec3> &
5757
max = x > max ? x : max;
5858
max = y > max ? y : max;
5959
max = z > max ? z : max;
60-
}
60+
}
6161

62-
return std::make_pair(min, max);
62+
return std::make_pair(min, max);
6363
}
6464

6565
std::pair<float, float> findMinMaxElements(const glkernel::tkernel<glm::vec4> & kernel)
6666
{
67-
float min = std::numeric_limits<float>::max();
68-
float max = std::numeric_limits<float>::min();
69-
const auto end = kernel.cend();
70-
for (auto it = kernel.cbegin(); it != end; ++it)
71-
{
67+
float min = std::numeric_limits<float>::max();
68+
float max = std::numeric_limits<float>::min();
69+
const auto end = kernel.cend();
70+
for (auto it = kernel.cbegin(); it != end; ++it)
71+
{
7272
const auto x = it->x;
7373
const auto y = it->y;
7474
const auto z = it->z;
@@ -83,16 +83,18 @@ std::pair<float, float> findMinMaxElements(const glkernel::tkernel<glm::vec4> &
8383
max = y > max ? y : max;
8484
max = z > max ? z : max;
8585
max = w > max ? z : max;
86-
}
86+
}
8787

88-
return std::make_pair(min, max);
88+
return std::make_pair(min, max);
8989
}
9090

91-
bool canBeFloat(const cppexpose::Variant & v) {
91+
bool canBeFloat(const cppexpose::Variant & v)
92+
{
9293
return v.canConvert<float>();
9394
}
9495

95-
bool canBeVec2(const cppexpose::Variant & v) {
96+
bool canBeVec2(const cppexpose::Variant & v)
97+
{
9698
const auto arr = v.asArray();
9799

98100
if (!arr)
@@ -104,7 +106,8 @@ bool canBeVec2(const cppexpose::Variant & v) {
104106
return canBeFloat(arr->at(0)) && canBeFloat(arr->at(1));
105107
}
106108

107-
bool canBeVec3(const cppexpose::Variant & v) {
109+
bool canBeVec3(const cppexpose::Variant & v)
110+
{
108111
const auto arr = v.asArray();
109112

110113
if (!arr)
@@ -116,7 +119,8 @@ bool canBeVec3(const cppexpose::Variant & v) {
116119
return canBeFloat(arr->at(0)) && canBeFloat(arr->at(1)) && canBeFloat(arr->at(2));
117120
}
118121

119-
bool canBeVec4(const cppexpose::Variant & v) {
122+
bool canBeVec4(const cppexpose::Variant & v)
123+
{
120124
const auto arr = v.asArray();
121125

122126
if (!arr)

0 commit comments

Comments
 (0)