Browse Source

A few minor changes to keep the Clang analyser happy.

tags/2021-05-28
jules 12 years ago
parent
commit
1e4ba1b550
7 changed files with 13 additions and 14 deletions
  1. +1
    -1
      extras/Demo/Source/Demos/AnimationDemo.cpp
  2. +3
    -4
      extras/Demo/Source/Demos/WindowsDemo.cpp
  3. +3
    -3
      modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c
  4. +1
    -1
      modules/juce_box2d/box2d/Collision/b2Distance.cpp
  5. +2
    -2
      modules/juce_box2d/box2d/Dynamics/Contacts/b2ContactSolver.cpp
  6. +2
    -2
      modules/juce_box2d/box2d/Dynamics/b2ContactManager.cpp
  7. +1
    -1
      modules/juce_gui_basics/components/juce_Component.h

+ 1
- 1
extras/Demo/Source/Demos/AnimationDemo.cpp View File

@@ -252,8 +252,8 @@ private:
if (Random::getSystemRandom().nextInt (200) < 4)
{
BallComponent* ball = new BallComponent (ballGenerator->getBounds().getCentre().toFloat());
balls.add (ball);
addAndMakeVisible (ball);
balls.add (ball);
}
}


+ 3
- 4
extras/Demo/Source/Demos/WindowsDemo.cpp View File

@@ -251,8 +251,8 @@ private:
void closeAllWindows()
{
for (int i = windows.size(); --i >= 0;)
windows.getReference (i).deleteAndZero();
for (int i = 0; i < windows.size(); ++i)
windows.getReference(i).deleteAndZero();
windows.clear();
}
@@ -261,8 +261,7 @@ private:
{
String m;
m << "Dialog Windows can be used to quickly show a component, usually blocking mouse input to other windows."
<< newLine
m << "Dialog Windows can be used to quickly show a component, usually blocking mouse input to other windows." << newLine
<< newLine
<< "They can also be quickly closed with the escape key, try it now.";


+ 3
- 3
modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c View File

@@ -2629,7 +2629,7 @@ void update_metadata_(const FLAC__StreamEncoder *encoder)
b[3] = (FLAC__byte)xx; xx >>= 8;
b[2] = (FLAC__byte)xx; xx >>= 8;
b[1] = (FLAC__byte)xx; xx >>= 8;
b[0] = (FLAC__byte)xx; xx >>= 8;
b[0] = (FLAC__byte)xx; //xx >>= 8;
xx = encoder->private_->seek_table->points[i].stream_offset;
b[15] = (FLAC__byte)xx; xx >>= 8;
b[14] = (FLAC__byte)xx; xx >>= 8;
@@ -2638,10 +2638,10 @@ void update_metadata_(const FLAC__StreamEncoder *encoder)
b[11] = (FLAC__byte)xx; xx >>= 8;
b[10] = (FLAC__byte)xx; xx >>= 8;
b[9] = (FLAC__byte)xx; xx >>= 8;
b[8] = (FLAC__byte)xx; xx >>= 8;
b[8] = (FLAC__byte)xx; //xx >>= 8;
x = encoder->private_->seek_table->points[i].frame_samples;
b[17] = (FLAC__byte)x; x >>= 8;
b[16] = (FLAC__byte)x; x >>= 8;
b[16] = (FLAC__byte)x; //x >>= 8;
if(encoder->private_->write_callback(encoder, b, 18, 0, 0, encoder->private_->client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) {
encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR;
return;


+ 1
- 1
modules/juce_box2d/box2d/Collision/b2Distance.cpp View File

@@ -467,7 +467,7 @@ void b2Distance(b2DistanceOutput* output,
b2Vec2 closestPoint = simplex.GetClosestPoint();
float32 distanceSqr1 = closestPoint.LengthSquared();
float32 distanceSqr2 = distanceSqr1;
float32 distanceSqr2;// = distanceSqr1;
// Main iteration loop.
int32 iter = 0;


+ 2
- 2
modules/juce_box2d/box2d/Dynamics/Contacts/b2ContactSolver.cpp View File

@@ -477,7 +477,7 @@ void b2ContactSolver::SolveVelocityConstraints()
//
x.x = - cp1->normalMass * b.x;
x.y = 0.0f;
vn1 = 0.0f;
//vn1 = 0.0f;
vn2 = vc->K.ex.y * x.x + b.y;
if (x.x >= 0.0f && vn2 >= 0.0f)
@@ -520,7 +520,7 @@ void b2ContactSolver::SolveVelocityConstraints()
x.x = 0.0f;
x.y = - cp2->normalMass * b.y;
vn1 = vc->K.ey.x * x.y + b.x;
vn2 = 0.0f;
//vn2 = 0.0f;
if (x.y >= 0.0f && vn1 >= 0.0f)
{


+ 2
- 2
modules/juce_box2d/box2d/Dynamics/b2ContactManager.cpp View File

@@ -245,8 +245,8 @@ void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB)
// Contact creation may swap fixtures.
fixtureA = c->GetFixtureA();
fixtureB = c->GetFixtureB();
indexA = c->GetChildIndexA();
indexB = c->GetChildIndexB();
// indexA = c->GetChildIndexA();
// indexB = c->GetChildIndexB();
bodyA = fixtureA->GetBody();
bodyB = fixtureB->GetBody();


+ 1
- 1
modules/juce_gui_basics/components/juce_Component.h View File

@@ -2121,7 +2121,7 @@ public:
const ComponentType* operator->() const noexcept { return getComponent(); }
/** If the component is valid, this deletes it and sets this pointer to null. */
void deleteAndZero() { delete getComponent(); jassert (getComponent() == nullptr); }
void deleteAndZero() { delete getComponent(); }
bool operator== (ComponentType* component) const noexcept { return weakRef == component; }
bool operator!= (ComponentType* component) const noexcept { return weakRef != component; }


Loading…
Cancel
Save