From 18544581e6402393383e43282b14f67a60fe0cce Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 21 Mar 2017 15:15:02 -0700 Subject: [PATCH] remove warnings about implicit float cast --- interface/src/ui/AvatarInputs.cpp | 4 ++-- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/ui/AvatarInputs.cpp b/interface/src/ui/AvatarInputs.cpp index 944be4bf9e..63e7dcdad9 100644 --- a/interface/src/ui/AvatarInputs.cpp +++ b/interface/src/ui/AvatarInputs.cpp @@ -46,7 +46,7 @@ AvatarInputs::AvatarInputs(QQuickItem* parent) : QQuickItem(parent) { #define AI_UPDATE_FLOAT(name, src, epsilon) \ { \ float val = src; \ - if (fabs(_##name - val) >= epsilon) { \ + if (fabsf(_##name - val) >= epsilon) { \ _##name = val; \ emit name##Changed(); \ } \ @@ -82,7 +82,7 @@ void AvatarInputs::update() { if (audioLevel > 1.0f) { audioLevel = 1.0; } - AI_UPDATE_FLOAT(audioLevel, audioLevel, 0.01); + AI_UPDATE_FLOAT(audioLevel, audioLevel, 0.01f); AI_UPDATE(audioClipping, ((audioIO->getTimeSinceLastClip() > 0.0f) && (audioIO->getTimeSinceLastClip() < 1.0f))); AI_UPDATE(audioMuted, audioIO->isMuted()); diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 31284b2f69..050635a063 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -1038,7 +1038,7 @@ void EntityTreeRenderer::playEntityCollisionSound(EntityItemPointer entity, cons // Shift the pitch down by ln(1 + (size / COLLISION_SIZE_FOR_STANDARD_PITCH)) / ln(2) const float COLLISION_SIZE_FOR_STANDARD_PITCH = 0.2f; - const float stretchFactor = log(1.0f + (minAACube.getLargestDimension() / COLLISION_SIZE_FOR_STANDARD_PITCH)) / log(2); + const float stretchFactor = logf(1.0f + (minAACube.getLargestDimension() / COLLISION_SIZE_FOR_STANDARD_PITCH)) / logf(2.0f); AudioInjector::playSound(collisionSound, volume, stretchFactor, collision.contactPoint); }