From 4aa896f604d1bbfad071efd42afb819ee2cb0224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 1 Feb 2025 13:54:47 +0100 Subject: [PATCH] Shaders: use the more common code style for assertion-only arguments. --- .../Shaders/Implementation/lineMiterLimit.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Shaders/Implementation/lineMiterLimit.h b/src/Magnum/Shaders/Implementation/lineMiterLimit.h index 7db326c18..7ce223aa1 100644 --- a/src/Magnum/Shaders/Implementation/lineMiterLimit.h +++ b/src/Magnum/Shaders/Implementation/lineMiterLimit.h @@ -32,21 +32,23 @@ namespace Magnum { namespace Shaders { namespace Implementation { -inline Float lineMiterLengthLimit(const char* const name, const Float limit) { - #if defined(CORRADE_NO_ASSERT) || defined(CORRADE_STANDARD_ASSERT) - static_cast(name); +inline Float lineMiterLengthLimit(const char* + #if !defined(CORRADE_NO_ASSERT) && !defined(CORRADE_STANDARD_ASSERT) + const name #endif +, const Float limit) { CORRADE_ASSERT(limit >= 1.0f && !Math::isInf(limit), name << "expected a finite value greater than or equal to 1, got" << limit, {}); /* Calculate the half-angle from the length and return a cosine of it */ return Math::cos(2.0f*Math::asin(1.0f/limit)); } -inline Float lineMiterAngleLimit(const char* const name, const Rad limit) { - using namespace Math::Literals; - #if defined(CORRADE_NO_ASSERT) || defined(CORRADE_STANDARD_ASSERT) - static_cast(name); +inline Float lineMiterAngleLimit(const char* + #if !defined(CORRADE_NO_ASSERT) && !defined(CORRADE_STANDARD_ASSERT) + const name #endif +, const Rad limit) { + using namespace Math::Literals; CORRADE_ASSERT(limit > 0.0_radf && limit <= Rad{Constants::pi()}, name << "expected a value greater than 0° and less than or equal to 180°, got" << Float(Deg(limit)) << Debug::nospace << "°", {}); /* Return a cosine of the angle */