1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Avoided some pedantic GCC warnings.

This commit is contained in:
jules 2013-11-03 19:16:52 +00:00
parent 664a585d19
commit 12a8dd3092
65 changed files with 595 additions and 614 deletions

View file

@ -138,11 +138,9 @@ void b2CollidePolygonAndCircle(
else
{
b2Vec2 faceCenter = 0.5f * (v1 + v2);
float32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]);
if (separation > radius)
{
if (b2Dot (cLocal - faceCenter, normals[vertIndex1]) > radius)
return;
}
manifold->pointCount = 1;
manifold->type = b2Manifold::e_faceA;

View file

@ -244,7 +244,7 @@ struct b2Simplex
{
case 0:
b2Assert(false);
return 0.0;
return 0.0f;
case 1:
return 0.0f;

View file

@ -26,7 +26,7 @@
struct b2Color
{
b2Color() {}
b2Color(float32 r, float32 g, float32 b) : r(r), g(g), b(b) {}
b2Color(float32 red, float32 green, float32 blue) : r(red), g(green), b(blue) {}
void Set(float32 ri, float32 gi, float32 bi) { r = ri; g = gi; b = bi; }
float32 r, g, b;
};

View file

@ -67,7 +67,7 @@ struct b2Vec2
b2Vec2() {}
/// Construct using coordinates.
b2Vec2(float32 x, float32 y) : x(x), y(y) {}
b2Vec2(float32 xCoord, float32 yCoord) : x(xCoord), y(yCoord) {}
/// Set this vector to all zeros.
void SetZero() { x = 0.0f; y = 0.0f; }
@ -158,7 +158,7 @@ struct b2Vec3
b2Vec3() {}
/// Construct using coordinates.
b2Vec3(float32 x, float32 y, float32 z) : x(x), y(y), z(z) {}
b2Vec3(float32 xCoord, float32 yCoord, float32 zCoord) : x(xCoord), y(yCoord), z(zCoord) {}
/// Set this vector to all zeros.
void SetZero() { x = 0.0f; y = 0.0f; z = 0.0f; }

View file

@ -108,7 +108,7 @@ b2PrismaticJoint::b2PrismaticJoint(const b2PrismaticJointDef* def)
m_referenceAngle = def->referenceAngle;
m_impulse.SetZero();
m_motorMass = 0.0;
m_motorMass = 0.0f;
m_motorImpulse = 0.0f;
m_lowerTranslation = def->lowerTranslation;

View file

@ -55,7 +55,7 @@ b2WheelJoint::b2WheelJoint(const b2WheelJointDef* def)
m_mass = 0.0f;
m_impulse = 0.0f;
m_motorMass = 0.0;
m_motorMass = 0.0f;
m_motorImpulse = 0.0f;
m_springMass = 0.0f;
m_springImpulse = 0.0f;
@ -141,14 +141,14 @@ void b2WheelJoint::InitVelocityConstraints(const b2SolverData& data)
float32 omega = 2.0f * b2_pi * m_frequencyHz;
// Damping coefficient
float32 d = 2.0f * m_springMass * m_dampingRatio * omega;
float32 damp = 2.0f * m_springMass * m_dampingRatio * omega;
// Spring stiffness
float32 k = m_springMass * omega * omega;
// magic formulas
float32 h = data.step.dt;
m_gamma = h * (d + h * k);
m_gamma = h * (damp + h * k);
if (m_gamma > 0.0f)
{
m_gamma = 1.0f / m_gamma;

View file

@ -307,7 +307,7 @@ void b2Island::Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& g
// Solve position constraints
timer.Reset();
bool positionSolved = false;
for (int32 i = 0; i < step.positionIterations; ++i)
for (int32 j = 0; j < step.positionIterations; ++j)
{
bool contactsOkay = contactSolver.SolvePositionConstraints();