From 7579a9ec37ba476b0379af227b4c704d966e8158 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Nov 2012 10:20:16 +0000 Subject: code cleanup: double promotions --- intern/audaspace/FX/AUD_ButterworthFactory.cpp | 10 +++++----- intern/audaspace/FX/AUD_DelayReader.cpp | 4 ++-- intern/audaspace/FX/AUD_HighpassFactory.cpp | 4 ++-- intern/bsp/intern/BOP_CarveInterface.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'intern') diff --git a/intern/audaspace/FX/AUD_ButterworthFactory.cpp b/intern/audaspace/FX/AUD_ButterworthFactory.cpp index 5edca302ece..af1a5af97df 100644 --- a/intern/audaspace/FX/AUD_ButterworthFactory.cpp +++ b/intern/audaspace/FX/AUD_ButterworthFactory.cpp @@ -53,11 +53,11 @@ void AUD_ButterworthFactory::recalculateCoefficients(AUD_SampleRate rate, float omega = 2 * tan(m_frequency * M_PI / rate); float o2 = omega * omega; float o4 = o2 * o2; - float x1 = o2 + 2 * BWPB41 * omega + 4; - float x2 = o2 + 2 * BWPB42 * omega + 4; - float y1 = o2 - 2 * BWPB41 * omega + 4; - float y2 = o2 - 2 * BWPB42 * omega + 4; - float o228 = 2 * o2 - 8; + float x1 = o2 + 2.0f * (float)BWPB41 * omega + 4.0f; + float x2 = o2 + 2.0f * (float)BWPB42 * omega + 4.0f; + float y1 = o2 - 2.0f * (float)BWPB41 * omega + 4.0f; + float y2 = o2 - 2.0f * (float)BWPB42 * omega + 4.0f; + float o228 = 2.0f * o2 - 8.0f; float norm = x1 * x2; a.push_back(1); a.push_back((x1 + x2) * o228 / norm); diff --git a/intern/audaspace/FX/AUD_DelayReader.cpp b/intern/audaspace/FX/AUD_DelayReader.cpp index 903e043af01..0e9833cd07f 100644 --- a/intern/audaspace/FX/AUD_DelayReader.cpp +++ b/intern/audaspace/FX/AUD_DelayReader.cpp @@ -33,8 +33,8 @@ AUD_DelayReader::AUD_DelayReader(AUD_Reference reader, float delay) : AUD_EffectReader(reader), - m_delay(int(delay * reader->getSpecs().rate)), - m_remdelay(int(delay * reader->getSpecs().rate)) + m_delay(int((AUD_SampleRate)delay * reader->getSpecs().rate)), + m_remdelay(int((AUD_SampleRate)delay * reader->getSpecs().rate)) { } diff --git a/intern/audaspace/FX/AUD_HighpassFactory.cpp b/intern/audaspace/FX/AUD_HighpassFactory.cpp index 41070842596..b56be8942ff 100644 --- a/intern/audaspace/FX/AUD_HighpassFactory.cpp +++ b/intern/audaspace/FX/AUD_HighpassFactory.cpp @@ -48,8 +48,8 @@ void AUD_HighpassFactory::recalculateCoefficients(AUD_SampleRate rate, std::vector &b, std::vector &a) { - float w0 = 2 * M_PI * m_frequency / rate; - float alpha = sin(w0) / (2 * m_Q); + float w0 = 2.0 * M_PI * (AUD_SampleRate)m_frequency / rate; + float alpha = (float)(sin(w0) / (2.0 * (double)m_Q)); float norm = 1 + alpha; float c = cos(w0); a.push_back(1); diff --git a/intern/bsp/intern/BOP_CarveInterface.cpp b/intern/bsp/intern/BOP_CarveInterface.cpp index 93d15e6d5e6..49c999a1dd4 100644 --- a/intern/bsp/intern/BOP_CarveInterface.cpp +++ b/intern/bsp/intern/BOP_CarveInterface.cpp @@ -60,7 +60,7 @@ static bool isQuadPlanar(carve::geom3d::Vector &v1, carve::geom3d::Vector &v2, float production = carve::geom::dot(cross, vec3); float magnitude = 1e-5 * cross.length(); - return fabs(production) < magnitude; + return fabsf(production) < magnitude; } static bool isFacePlanar(CSG_IFace &face, std::vector &vertices) -- cgit v1.2.3