Skip to content

Commit

Permalink
App: Apply clang format (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Nov 21, 2024
1 parent fcea934 commit 5771c94
Show file tree
Hide file tree
Showing 44 changed files with 12,135 additions and 8,747 deletions.
19 changes: 9 additions & 10 deletions src/App/Color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ using namespace App;

// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
Color::Color(float red, float green, float blue, float alpha)
: r(red)
, g(green)
, b(blue)
, a(alpha)
{
}
: r(red)
, g(green)
, b(blue)
, a(alpha)
{}

Color::Color(uint32_t rgba)
: Color{}
: Color {}
{
setPackedValue(rgba);
}
Expand Down Expand Up @@ -159,7 +158,7 @@ bool Color::fromHexString(const std::string& hex)
if (hex.size() == 7) {
std::stringstream ss(hex);
unsigned int rgb;
char ch{};
char ch {};

ss >> ch >> std::hex >> rgb;
int rc = (rgb >> 16) & 0xff;
Expand All @@ -176,13 +175,13 @@ bool Color::fromHexString(const std::string& hex)
if (hex.size() == 9) {
std::stringstream ss(hex);
unsigned int rgba;
char ch{};
char ch {};

ss >> ch >> std::hex >> rgba;
int rc = (rgba >> 24) & 0xff;
int gc = (rgba >> 16) & 0xff;
int bc = (rgba >> 8) & 0xff;
int ac = rgba & 0xff;
int ac = rgba & 0xff;

r = rc / 255.0F;
g = gc / 255.0F;
Expand Down
8 changes: 4 additions & 4 deletions src/App/Color.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct color_traits
}
static color_type makeColor(int red, int green, int blue, int alpha = 255)
{
return color_type{red, green, blue, alpha};
return color_type {red, green, blue, alpha};
}

private:
Expand Down Expand Up @@ -146,7 +146,7 @@ class AppExport Color
template<typename T>
static uint32_t asPackedRGBA(const T& color)
{
color_traits<T> ct{color};
color_traits<T> ct {color};
return (ct.red() << 24) | (ct.green() << 16) | (ct.blue() << 8) | ct.alpha();
}

Expand All @@ -162,7 +162,7 @@ class AppExport Color
template<typename T>
static uint32_t asPackedRGB(const T& color)
{
color_traits<T> ct{color};
color_traits<T> ct {color};
return (ct.red() << 24) | (ct.green() << 16) | (ct.blue() << 8);
}

Expand All @@ -179,7 +179,7 @@ class AppExport Color
template<typename T>
void setValue(const T& q)
{
color_traits<T> ct{q};
color_traits<T> ct {q};
set(ct.redF(), ct.greenF(), ct.blueF());
}
/**
Expand Down
Loading

0 comments on commit 5771c94

Please sign in to comment.