From ab651bb61c12e32df014f417ab806cd3574a6a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Nov 2013 21:00:52 +0100 Subject: [PATCH] Various minor cleanup. --- src/Math/Test/Matrix3Test.cpp | 5 ++--- src/Math/Test/Matrix4Test.cpp | 5 ++--- src/Math/Test/RectangularMatrixTest.cpp | 5 ++--- src/Math/Test/Vector2Test.cpp | 10 ++++------ src/Math/Test/Vector3Test.cpp | 10 ++++------ src/Math/Test/Vector4Test.cpp | 10 ++++------ src/Math/Test/VectorTest.cpp | 10 ++++------ src/Math/Vector3.h | 1 - src/Test/ColorTest.cpp | 4 ++-- 9 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/Math/Test/Matrix3Test.cpp b/src/Math/Test/Matrix3Test.cpp index 3349e6dcb..255927bfe 100644 --- a/src/Math/Test/Matrix3Test.cpp +++ b/src/Math/Test/Matrix3Test.cpp @@ -162,10 +162,9 @@ void Matrix3Test::constructConversion() { {4.5f, 4.0f, 7.0f}, {7.9f, -1.0f, 8.0f}); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Matrix3i b(a); - #else - Matrix3i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Matrix3i b(a); CORRADE_COMPARE(b, Matrix3i({3, 5, 8}, {4, 4, 7}, {7, -1, 8})); diff --git a/src/Math/Test/Matrix4Test.cpp b/src/Math/Test/Matrix4Test.cpp index 106f6d4ad..d363351fd 100644 --- a/src/Math/Test/Matrix4Test.cpp +++ b/src/Math/Test/Matrix4Test.cpp @@ -181,10 +181,9 @@ void Matrix4Test::constructConversion() { {1.0f, 2.0f, 3.0f, -1.0f}, {7.9f, -1.0f, 8.0f, -1.5f}); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Matrix4i b(a); - #else - Matrix4i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Matrix4i b(a); CORRADE_COMPARE(b, Matrix4i({3, 5, 8, -3}, {4, 4, 7, 2}, {1, 2, 3, -1}, diff --git a/src/Math/Test/RectangularMatrixTest.cpp b/src/Math/Test/RectangularMatrixTest.cpp index d77e97289..872c253ee 100644 --- a/src/Math/Test/RectangularMatrixTest.cpp +++ b/src/Math/Test/RectangularMatrixTest.cpp @@ -155,10 +155,9 @@ void RectangularMatrixTest::constructConversion() { constexpr Matrix2x2 a(Vector2( 1.3f, 2.7f), Vector2(-15.0f, 7.0f)); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Matrix2x2i b(a); - #else - Matrix2x2i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Matrix2x2i b(a); CORRADE_COMPARE(b, Matrix2x2i(Vector2i( 1, 2), Vector2i(-15, 7))); diff --git a/src/Math/Test/Vector2Test.cpp b/src/Math/Test/Vector2Test.cpp index 902bbf5fa..d36c8e935 100644 --- a/src/Math/Test/Vector2Test.cpp +++ b/src/Math/Test/Vector2Test.cpp @@ -111,10 +111,9 @@ void Vector2Test::constructDefault() { void Vector2Test::constructOneValue() { #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector2 a(3.0f); - #else - Vector2 a(3.0f); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector2 a(3.0f); CORRADE_COMPARE(a, Vector2(3.0f, 3.0f)); /* Implicit conversion is not allowed */ @@ -124,10 +123,9 @@ void Vector2Test::constructOneValue() { void Vector2Test::constructConversion() { constexpr Vector2 a(1.5f, 2.5f); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector2i b(a); - #else - Vector2i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector2i b(a); CORRADE_COMPARE(b, Vector2i(1, 2)); /* Implicit conversion is not allowed */ diff --git a/src/Math/Test/Vector3Test.cpp b/src/Math/Test/Vector3Test.cpp index 1ad831a5b..291a4cf08 100644 --- a/src/Math/Test/Vector3Test.cpp +++ b/src/Math/Test/Vector3Test.cpp @@ -111,10 +111,9 @@ void Vector3Test::constructDefault() { void Vector3Test::constructOneValue() { #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector3 a(-3.0f); - #else - Vector3 a(-3.0f); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector3 a(-3.0f); CORRADE_COMPARE(a, Vector3(-3.0f, -3.0f, -3.0f)); /* Implicit conversion is not allowed */ @@ -130,10 +129,9 @@ void Vector3Test::constructParts() { void Vector3Test::constructConversion() { constexpr Vector3 a(1.0f, 2.5f, -3.0f); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector3i b(a); - #else - Vector3i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector3i b(a); CORRADE_COMPARE(b, Vector3i(1, 2, -3)); /* Implicit conversion is not allowed */ diff --git a/src/Math/Test/Vector4Test.cpp b/src/Math/Test/Vector4Test.cpp index 1d9176c77..3759df1c1 100644 --- a/src/Math/Test/Vector4Test.cpp +++ b/src/Math/Test/Vector4Test.cpp @@ -108,10 +108,9 @@ void Vector4Test::constructDefault() { void Vector4Test::constructOneValue() { #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector4 a(4.3f); - #else - Vector4 a(4.3f); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector4 a(4.3f); CORRADE_COMPARE(a, Vector4(4.3f, 4.3f, 4.3f, 4.3f)); /* Implicit conversion is not allowed */ @@ -127,10 +126,9 @@ void Vector4Test::constructParts() { void Vector4Test::constructConversion() { constexpr Vector4 a(1.0f, -2.5f, 3.0f, 4.1f); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector4i b(a); - #else - Vector4i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector4i b(a); CORRADE_COMPARE(b, Vector4i(1, -2, 3, 4)); /* Implicit conversion is not allowed */ diff --git a/src/Math/Test/VectorTest.cpp b/src/Math/Test/VectorTest.cpp index cd9a8b8d6..a09684da3 100644 --- a/src/Math/Test/VectorTest.cpp +++ b/src/Math/Test/VectorTest.cpp @@ -175,10 +175,9 @@ void VectorTest::constructDefault() { void VectorTest::constructOneValue() { #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector4 a(7.25f); - #else - Vector4 a(7.25f); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector4 a(7.25f); CORRADE_COMPARE(a, Vector4(7.25f, 7.25f, 7.25f, 7.25f)); @@ -197,10 +196,9 @@ void VectorTest::constructOneComponent() { void VectorTest::constructConversion() { constexpr Vector4 a(1.3f, 2.7f, -15.0f, 7.0f); #ifndef CORRADE_GCC46_COMPATIBILITY - constexpr Vector4i b(a); - #else - Vector4i b(a); /* Not constexpr under GCC < 4.7 */ + constexpr /* Not constexpr under GCC < 4.7 */ #endif + Vector4i b(a); CORRADE_COMPARE(b, Vector4i(1, 2, -15, 7)); diff --git a/src/Math/Vector3.h b/src/Math/Vector3.h index ea1ff8411..eaa60390b 100644 --- a/src/Math/Vector3.h +++ b/src/Math/Vector3.h @@ -145,7 +145,6 @@ template class Vector3: public Vector<3, T> { /** @brief Copy constructor */ constexpr Vector3(const Vector<3, T>& other): Vector<3, T>(other) {} - /** * @brief X component * diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index 657802f65..d50751e41 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -51,8 +51,8 @@ class ColorTest: public TestSuite::Tester { void configuration(); }; -typedef Magnum::BasicColor3 Color3ub; -typedef Magnum::BasicColor4 Color4ub; +typedef BasicColor3 Color3ub; +typedef BasicColor4 Color4ub; ColorTest::ColorTest() { addTests({&ColorTest::fromHue,