Fix clang-tidy. (#469)

This commit is contained in:
Arthur Sonzogni
2022-08-28 21:30:01 +02:00
committed by GitHub
parent 1e381fcad6
commit 8226c5aea7
7 changed files with 19 additions and 18 deletions

View File

@@ -132,7 +132,7 @@ Color::Color(uint8_t red, uint8_t green, uint8_t blue)
/// @ingroup screen
// static
Color Color::RGB(uint8_t red, uint8_t green, uint8_t blue) {
return Color(red, green, blue);
return {red, green, blue};
}
/// @brief Build a Color from its HSV representation.
@@ -145,7 +145,7 @@ Color Color::RGB(uint8_t red, uint8_t green, uint8_t blue) {
// static
Color Color::HSV(uint8_t h, uint8_t s, uint8_t v) {
if (s == 0) {
return Color(v, v, v);
return {0,0,0};
}
uint8_t region = h / 43; // NOLINT
@@ -164,8 +164,7 @@ Color Color::HSV(uint8_t h, uint8_t s, uint8_t v) {
case 5: return Color(v,p,q); // NOLINT
} // NOLINT
// clang-format on
return Color(0, 0, 0);
return {0, 0, 0};
}
// static
@@ -236,7 +235,7 @@ Color operator""_rgb(unsigned long long int combined) {
auto const red = static_cast<uint8_t>(combined >> 16U);
auto const green = static_cast<uint8_t>(combined >> 8U);
auto const blue = static_cast<uint8_t>(combined);
return Color(red, green, blue);
return {red, green, blue};
}
} // namespace literals

View File

@@ -378,13 +378,13 @@ Dimensions Dimension::Full() {
// static
/// Create a screen with the given dimension along the x-axis and y-axis.
Screen Screen::Create(Dimensions width, Dimensions height) {
return Screen(width.dimx, height.dimy);
return {width.dimx, height.dimy};
}
// static
/// Create a screen with the given dimension.
Screen Screen::Create(Dimensions dimension) {
return Screen(dimension.dimx, dimension.dimy);
return {dimension.dimx, dimension.dimy};
}
Screen::Screen(int dimx, int dimy)