From 576c60fd150bd0aaa383d342fcb178c4bcb113ba Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 18 Jan 2016 16:53:11 +0000 Subject: [PATCH] un-templated a couple of functions to prevent them being accidentally called with integral type arguments --- modules/juce_core/maths/juce_MathsFunctions.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/juce_core/maths/juce_MathsFunctions.h b/modules/juce_core/maths/juce_MathsFunctions.h index 9d9a142cc3..c961c02898 100644 --- a/modules/juce_core/maths/juce_MathsFunctions.h +++ b/modules/juce_core/maths/juce_MathsFunctions.h @@ -356,12 +356,16 @@ const float float_Pi = 3.14159265358979323846f; /** Converts an angle in degrees to radians. */ -template -FloatType degreesToRadians (FloatType degrees) noexcept { return degrees * static_cast (double_Pi / 180.0); } +inline float degreesToRadians (float degrees) noexcept { return degrees * (float_Pi / 180.0f); } + +/** Converts an angle in degrees to radians. */ +inline double degreesToRadians (double degrees) noexcept { return degrees * (double_Pi / 180.0); } /** Converts an angle in radians to degrees. */ -template -FloatType radiansToDegrees (FloatType radians) noexcept { return radians * static_cast (180.0 / double_Pi); } +inline float radiansToDegrees (float radians) noexcept { return radians * (180.0f / float_Pi); } + +/** Converts an angle in radians to degrees. */ +inline double radiansToDegrees (double radians) noexcept { return radians * (180.0 / double_Pi); } //==============================================================================