From 3f03b671bb3f0512e2fb7569b111747181989aaa Mon Sep 17 00:00:00 2001
From: patrick96
Date: Tue, 23 Feb 2021 09:53:54 +0100
Subject: [PATCH] fix(color): Rename type() function to get_type
In gcc5, this caused compilation errors because the type enum has the
same name.
---
include/utils/color.hpp | 2 +-
src/utils/color.cpp | 2 +-
tests/unit_tests/utils/color.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/utils/color.hpp b/include/utils/color.hpp
index 21741539..c27e679e 100644
--- a/include/utils/color.hpp
+++ b/include/utils/color.hpp
@@ -22,7 +22,7 @@ class rgba {
bool operator==(const rgba& other) const;
uint32_t value() const;
- type type() const;
+ type get_type() const;
double alpha_d() const;
double red_d() const;
diff --git a/src/utils/color.cpp b/src/utils/color.cpp
index b1b92ee1..66168130 100644
--- a/src/utils/color.cpp
+++ b/src/utils/color.cpp
@@ -106,7 +106,7 @@ uint32_t rgba::value() const {
return this->m_value;
}
-enum rgba::type rgba::type() const {
+enum rgba::type rgba::get_type() const {
return m_type;
}
diff --git a/tests/unit_tests/utils/color.cpp b/tests/unit_tests/utils/color.cpp
index 1699a532..7b62969c 100644
--- a/tests/unit_tests/utils/color.cpp
+++ b/tests/unit_tests/utils/color.cpp
@@ -12,7 +12,7 @@ TEST(Rgba, constructor) {
EXPECT_FALSE(rgba("#-abc").has_color());
EXPECT_FALSE(rgba("#xyz").has_color());
- EXPECT_EQ(rgba::type::ALPHA_ONLY, rgba{"#12"}.type());
+ EXPECT_EQ(rgba::type::ALPHA_ONLY, rgba{"#12"}.get_type());
EXPECT_EQ(0xff000000, rgba{"#ff"}.value());