Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #16

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Source/friz/control/animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ class Animation : public AnimationType,
* @param sources List of animated value objects.
* @param id
*/
Animation (SourceList&& sources, int id = 0)
Animation (SourceList&& sources_, int id = 0)
: AnimationType { id }
, sources { std::move (sources) }
, sources { std::move (sources_) }
{
}

Expand Down
4 changes: 2 additions & 2 deletions Source/friz/control/animator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void Animator::gotoTime (juce::int64 timeInMs)
juce::ScopedLock lock { mutex };

// for (auto& animation : animations)
for (int i { 0 }; i < animations.size (); ++i)
for (size_t i { 0 }; i < animations.size (); ++i)
{
auto& animation { animations[i] };
if (animation.get () != nullptr)
Expand Down Expand Up @@ -185,7 +185,7 @@ bool Animator::updateTarget (int id, int valueIndex, float newTarget)
{
for (auto* animation : foundAnimations)
{
auto* value { animation->getValue (valueIndex) };
auto* value { animation->getValue (static_cast<size_t> (valueIndex)) };
if (value)
value->updateTarget (newTarget);
}
Expand Down
19 changes: 8 additions & 11 deletions Source/friz/control/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,15 @@ namespace friz
class Chain : public AnimationType
{
public:
Chain (int id = 0)
: AnimationType (id)
{
}
Chain (int id = 0) : AnimationType (id) {}

bool isFinished () override { return (currentEffect >= sequence.size ()); }
bool isFinished() override { return (currentEffect >= static_cast<int> (sequence.size())); }

bool isReady () const override
bool isReady() const override
{
for (const auto& effect : sequence)
{
if ((nullptr == effect) || (!effect->isReady ()))
if ((nullptr == effect) || (! effect->isReady()))
return false;
}
return true;
Expand All @@ -65,15 +62,15 @@ class Chain : public AnimationType
if (AnimationType::Status::finished == effect->gotoTime (timeInMs))
++currentEffect;

return isFinished () ? AnimationType::Status::finished
: AnimationType::Status::processing;
return isFinished() ? AnimationType::Status::finished
: AnimationType::Status::processing;
}
return AnimationType::Status::finished;
}

void cancel (bool moveToEndPosition) override
{
currentEffect = static_cast<int> (sequence.size () - 1);
currentEffect = static_cast<int> (sequence.size() - 1);
if (moveToEndPosition)
{
auto lastEffectPtr = getEffect (currentEffect);
Expand Down Expand Up @@ -103,7 +100,7 @@ class Chain : public AnimationType
AnimationType* getEffect (int index)
{
if (juce::isPositiveAndBelow (index, sequence.size ()))
return sequence[index].get ();
return sequence[static_cast<size_t> (index)].get ();

jassertfalse;
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Source/friz/control/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class FrameRateCalculator
/// @brief keep a running sum of intervals so we can just divide.
std::atomic<int> sum { 0 };
std::atomic<int> updateCount { 0 };
int index { 0 };
size_t index { 0 };
};

class Controller
Expand Down
12 changes: 6 additions & 6 deletions Source/friz/curves/animatedValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AnimatedValue
, endVal { endVal_ }
, currentVal { startVal_ } {

};
}

virtual ~AnimatedValue () = default;

Expand Down Expand Up @@ -120,9 +120,9 @@ class AnimatedValue
class ToleranceValue : public AnimatedValue
{
public:
ToleranceValue (float startVal, float endVal, float tolerance)
: AnimatedValue { startVal, endVal }
, tolerance { tolerance }
ToleranceValue (float startVal_, float endVal_, float tolerance_)
: AnimatedValue { startVal_, endVal_ }
, tolerance { tolerance_ }
{
}

Expand Down Expand Up @@ -193,8 +193,8 @@ class ToleranceValue : public AnimatedValue
class TimedValue : public AnimatedValue
{
public:
TimedValue (float startVal, float endVal, int duration_)
: AnimatedValue { startVal, endVal }
TimedValue (float startVal_, float endVal_, int duration_)
: AnimatedValue { startVal_, endVal_ }
, duration { duration_ }
{
}
Expand Down
8 changes: 4 additions & 4 deletions Source/friz/curves/constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
namespace friz
{

Constant::Constant (float value, int duration)
: TimedValue (value, value, duration)
Constant::Constant (float value, int duration_)
: TimedValue (value, value, duration_)
{
}

Constant::Constant (float /*startVal*/, float endVal_, int duration)
: Constant (endVal_, duration)
Constant::Constant (float /*startVal*/, float endVal_, int duration_)
: Constant (endVal_, duration_)
{
}

Expand Down
12 changes: 6 additions & 6 deletions Source/friz/curves/easing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
namespace friz
{

EasingCurve::EasingCurve (float startVal, float endVal, float tolerance, float slewRate_)
: ToleranceValue (startVal, endVal, tolerance)
EasingCurve::EasingCurve (float startVal_, float endVal_, float tolerance_, float slewRate_)
: ToleranceValue (startVal_, endVal_, tolerance_)
, slewRate (slewRate_)
{
}

EaseIn::EaseIn (float startVal, float endVal, float tolerance, float slewRate)
: EasingCurve (startVal, endVal, tolerance, slewRate)
EaseIn::EaseIn (float startVal_, float endVal_, float tolerance_, float slewRate_)
: EasingCurve (startVal_, endVal_, tolerance_, slewRate_)
{
jassert (slewRate < 1.f);
}
Expand All @@ -42,8 +42,8 @@ float EaseIn::generateNextValue ()
return currentVal + slewRate * (endVal - currentVal);
}

EaseOut::EaseOut (float startVal, float endVal, float tolerance, float slewRate)
: EasingCurve (startVal, endVal, tolerance, slewRate)
EaseOut::EaseOut (float startVal_, float endVal_, float tolerance_, float slewRate_)
: EasingCurve (startVal_, endVal_, tolerance_, slewRate_)
, currentRate { 0.01f }
{
jassert (slewRate > 1.f);
Expand Down
4 changes: 2 additions & 2 deletions Source/friz/curves/easing.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class EaseIn : public EasingCurve
class SmoothedValue : public EaseIn
{
public:
SmoothedValue (float startVal, float endVal, float tolerance, float slewRate)
: EaseIn (startVal, endVal, tolerance, slewRate)
SmoothedValue (float startVal_, float endVal_, float tolerance_, float slewRate_)
: EaseIn (startVal_, endVal_, tolerance_, slewRate_)
{
}

Expand Down
4 changes: 2 additions & 2 deletions Source/friz/curves/linear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
namespace friz
{

Linear::Linear (float startVal, float endVal, int duration)
: TimedValue (startVal, endVal, duration)
Linear::Linear (float startVal_, float endVal_, int duration_)
: TimedValue (startVal_, endVal_, duration_)
{
jassert (duration > 0);
}
Expand Down
8 changes: 4 additions & 4 deletions Source/friz/curves/parametric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ float easeInBounce (float x)
namespace friz
{

Parametric::Parametric (CurveType type, float startVal, float endVal, int duration)
: Parametric (startVal, endVal, duration, type)
Parametric::Parametric (CurveType type, float startVal_, float endVal_, int duration_)
: Parametric (startVal_, endVal_, duration_, type)
{
}

Parametric::Parametric (float startVal, float endVal, int duration, CurveType type)
: TimedValue (startVal, endVal, duration)
Parametric::Parametric (float startVal_, float endVal_, int duration_, CurveType type)
: TimedValue (startVal_, endVal_, duration_)
{
switch (type)
{
Expand Down
8 changes: 4 additions & 4 deletions Source/friz/curves/sinusoid.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class Sinusoid : public TimedValue
* @param endPhase end phase, typically 0..2pi.
* @param duration duration in milliseconds.
*/
Sinusoid (float startPhase_, float endPhase_, int duration)
: TimedValue (startPhase_, endPhase_, duration)
Sinusoid (float startPhase_, float endPhase_, int duration_)
: TimedValue (startPhase_, endPhase_, duration_)
, startPhase { startPhase_ }
, endPhase { endPhase_ }
{
Expand Down Expand Up @@ -88,9 +88,9 @@ class Sinusoid : public TimedValue
* @param duration duration in frames.
*/

Sinusoid (int startQuad, int endQuad, int duration)
Sinusoid (int startQuad, int endQuad, int duration_)
: Sinusoid (startQuad * juce::MathConstants<float>::halfPi,
endQuad * juce::MathConstants<float>::halfPi, duration)
endQuad * juce::MathConstants<float>::halfPi, duration_)
{
}

Expand Down
5 changes: 2 additions & 3 deletions Source/friz/curves/spring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@

namespace friz
{
Spring::Spring (float startVal, float endVal, float tolerance, float accel,
Spring::Spring (float startVal_, float endVal_, float tolerance_, float accel,
float damping_)
: ToleranceValue (startVal, endVal, tolerance)
, startAcceleration (accel)
: ToleranceValue (startVal_, endVal_, tolerance_)
, acceleration (accel)
, damping (damping_)
, velocity (0)
Expand Down
3 changes: 0 additions & 3 deletions Source/friz/curves/spring.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ class Spring : public ToleranceValue
float generateNextValue () override;

private:
/// The initial acceleration for this value.
float startAcceleration;

/// When we're in a damping state, the acceleration will change.
float acceleration;

Expand Down