Browse Source

A few minor whitespace cleanups.

tags/2021-05-28
jules 10 years ago
parent
commit
3e7d305094
19 changed files with 66 additions and 68 deletions
  1. +2
    -2
      modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp
  2. +5
    -5
      modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp
  3. +4
    -2
      modules/juce_browser_plugin_client/wrapper/juce_ActiveX_GlueCode.cpp
  4. +1
    -2
      modules/juce_core/containers/juce_Array.h
  5. +3
    -4
      modules/juce_core/containers/juce_NamedValueSet.cpp
  6. +3
    -3
      modules/juce_core/containers/juce_NamedValueSet.h
  7. +2
    -2
      modules/juce_core/memory/juce_WeakReference.h
  8. +1
    -1
      modules/juce_core/native/juce_android_Network.cpp
  9. +4
    -5
      modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp
  10. +13
    -14
      modules/juce_graphics/geometry/juce_AffineTransform.h
  11. +2
    -2
      modules/juce_gui_basics/components/juce_Component.h
  12. +5
    -6
      modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp
  13. +2
    -2
      modules/juce_gui_basics/layout/juce_ComponentAnimator.h
  14. +1
    -1
      modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp
  15. +1
    -1
      modules/juce_gui_basics/layout/juce_ComponentBuilder.h
  16. +1
    -1
      modules/juce_gui_basics/widgets/juce_ComboBox.h
  17. +9
    -8
      modules/juce_gui_basics/windows/juce_AlertWindow.cpp
  18. +6
    -6
      modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp
  19. +1
    -1
      modules/juce_gui_extra/misc/juce_ColourSelector.h

+ 2
- 2
modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp View File

@@ -165,13 +165,13 @@ bool LAMEEncoderAudioFormat::canHandleFile (const File&)
Array<int> LAMEEncoderAudioFormat::getPossibleSampleRates()
{
const int rates[] = { 32000, 44100, 48000, 0 };
return Array <int> (rates);
return Array<int> (rates);
}
Array<int> LAMEEncoderAudioFormat::getPossibleBitDepths()
{
const int depths[] = { 16, 0 };
return Array <int> (depths);
return Array<int> (depths);
}
bool LAMEEncoderAudioFormat::canDoStereo() { return true; }


+ 5
- 5
modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp View File

@@ -271,7 +271,7 @@ struct AAXClasses
{
if (component == nullptr)
{
if (JuceAAX_Processor* params = dynamic_cast <JuceAAX_Processor*> (GetEffectParameters()))
if (JuceAAX_Processor* params = dynamic_cast<JuceAAX_Processor*> (GetEffectParameters()))
component = new ContentWrapperComponent (*this, params->getPluginInstance());
else
jassertfalse;
@@ -481,7 +481,7 @@ struct AAXClasses
case JUCEAlgorithmIDs::pluginInstance:
{
const size_t numObjects = dataSize / sizeof (PluginInstanceInfo);
PluginInstanceInfo* const objects = static_cast <PluginInstanceInfo*> (data);
PluginInstanceInfo* const objects = static_cast<PluginInstanceInfo*> (data);
jassert (numObjects == 1); // not sure how to handle more than one..
@@ -496,7 +496,7 @@ struct AAXClasses
const_cast<JuceAAX_Processor*>(this)->preparePlugin();
const size_t numObjects = dataSize / sizeof (uint32_t);
uint32_t* const objects = static_cast <uint32_t*> (data);
uint32_t* const objects = static_cast<uint32_t*> (data);
for (size_t i = 0; i < numObjects; ++i)
new (objects + i) uint32_t (1);
@@ -730,7 +730,7 @@ struct AAXClasses
}
for (int i = numOuts; i < numIns; ++i)
channels[i] = const_cast <float*> (inputs[i]);
channels[i] = const_cast<float*> (inputs[i]);
process (channels, numIns, bufferSize, bypass, midiNodeIn, midiNodesOut);
}
@@ -756,7 +756,7 @@ struct AAXClasses
} while (v > 0);
return static_cast <AAX_CParamID> (t);
return static_cast<AAX_CParamID> (t);
}
private:


+ 4
- 2
modules/juce_browser_plugin_client/wrapper/juce_ActiveX_GlueCode.cpp View File

@@ -785,8 +785,10 @@ private:
//==============================================================================
String getActiveXBrowserURL (const BrowserPluginComponent* comp)
{
AXBrowserPluginHolderComponent* const ax = dynamic_cast <AXBrowserPluginHolderComponent*> (comp->getParentComponent());
return ax != nullptr ? ax->getBrowserURL() : String::empty;
if (AXBrowserPluginHolderComponent* ax = dynamic_cast<AXBrowserPluginHolderComponent*> (comp->getParentComponent()))
return ax->getBrowserURL();
return String();
}
//==============================================================================


+ 1
- 2
modules/juce_core/containers/juce_Array.h View File

@@ -65,8 +65,7 @@ private:
public:
//==============================================================================
/** Creates an empty array. */
Array() noexcept
: numUsed (0)
Array() noexcept : numUsed (0)
{
}


+ 3
- 4
modules/juce_core/containers/juce_NamedValueSet.cpp View File

@@ -88,9 +88,8 @@ NamedValueSet& NamedValueSet::operator= (NamedValueSet&& other) noexcept
}
#endif
NamedValueSet::~NamedValueSet()
NamedValueSet::~NamedValueSet() noexcept
{
clear();
}
void NamedValueSet::clear()
@@ -113,7 +112,7 @@ int NamedValueSet::size() const noexcept
return values.size();
}
const var& NamedValueSet::operator[] (const Identifier& name) const
const var& NamedValueSet::operator[] (const Identifier& name) const noexcept
{
if (const var* v = getVarPointer (name))
return *v;
@@ -170,7 +169,7 @@ bool NamedValueSet::set (Identifier name, const var& newValue)
return true;
}
bool NamedValueSet::contains (const Identifier& name) const
bool NamedValueSet::contains (const Identifier& name) const noexcept
{
return getVarPointer (name) != nullptr;
}


+ 3
- 3
modules/juce_core/containers/juce_NamedValueSet.h View File

@@ -54,7 +54,7 @@ public:
#endif
/** Destructor. */
~NamedValueSet();
~NamedValueSet() noexcept;
bool operator== (const NamedValueSet&) const;
bool operator!= (const NamedValueSet&) const;
@@ -67,7 +67,7 @@ public:
If the name isn't found, this will return a void variant.
@see getProperty
*/
const var& operator[] (const Identifier& name) const;
const var& operator[] (const Identifier& name) const noexcept;
/** Tries to return the named value, but if no such value is found, this will
instead return the supplied default value.
@@ -89,7 +89,7 @@ public:
#endif
/** Returns true if the set contains an item with the specified name. */
bool contains (const Identifier& name) const;
bool contains (const Identifier& name) const noexcept;
/** Removes a value from the set.
@returns true if a value was removed; false if there was no value


+ 2
- 2
modules/juce_core/memory/juce_WeakReference.h View File

@@ -158,7 +158,7 @@ public:
public:
Master() noexcept {}
~Master()
~Master() noexcept
{
// You must remember to call clear() in your source object's destructor! See the notes
// for the WeakReference class for an example of how to do this.
@@ -187,7 +187,7 @@ public:
to zero all the references to this object that may be out there. See the WeakReference
class notes for an example of how to do this.
*/
void clear()
void clear() noexcept
{
if (sharedPointer != nullptr)
sharedPointer->clearPointer();


+ 1
- 1
modules/juce_core/native/juce_android_Network.cpp View File

@@ -166,7 +166,7 @@ public:
int numBytes = stream.callIntMethod (HTTPStream.read, javaArray, (jint) bytesToRead);
if (numBytes > 0)
env->GetByteArrayRegion (javaArray, 0, numBytes, static_cast <jbyte*> (buffer));
env->GetByteArrayRegion (javaArray, 0, numBytes, static_cast<jbyte*> (buffer));
env->DeleteLocalRef (javaArray);
return numBytes;


+ 4
- 5
modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp View File

@@ -25,12 +25,11 @@
class ActionBroadcaster::ActionMessage : public MessageManager::MessageBase
{
public:
ActionMessage (const ActionBroadcaster* const broadcaster_,
const String& messageText,
ActionListener* const listener_) noexcept
: broadcaster (const_cast <ActionBroadcaster*> (broadcaster_)),
ActionMessage (const ActionBroadcaster* ab,
const String& messageText, ActionListener* l) noexcept
: broadcaster (const_cast<ActionBroadcaster*> (ab)),
message (messageText),
listener (listener_)
listener (l)
{}
void messageCallback() override


+ 13
- 14
modules/juce_graphics/geometry/juce_AffineTransform.h View File

@@ -83,8 +83,8 @@ public:
void transformPoint (ValueType& x, ValueType& y) const noexcept
{
const ValueType oldX = x;
x = static_cast <ValueType> (mat00 * oldX + mat01 * y + mat02);
y = static_cast <ValueType> (mat10 * oldX + mat11 * y + mat12);
x = static_cast<ValueType> (mat00 * oldX + mat01 * y + mat02);
y = static_cast<ValueType> (mat10 * oldX + mat11 * y + mat12);
}
/** Transforms two 2D coordinates using this matrix.
@@ -97,10 +97,10 @@ public:
ValueType& x2, ValueType& y2) const noexcept
{
const ValueType oldX1 = x1, oldX2 = x2;
x1 = static_cast <ValueType> (mat00 * oldX1 + mat01 * y1 + mat02);
y1 = static_cast <ValueType> (mat10 * oldX1 + mat11 * y1 + mat12);
x2 = static_cast <ValueType> (mat00 * oldX2 + mat01 * y2 + mat02);
y2 = static_cast <ValueType> (mat10 * oldX2 + mat11 * y2 + mat12);
x1 = static_cast<ValueType> (mat00 * oldX1 + mat01 * y1 + mat02);
y1 = static_cast<ValueType> (mat10 * oldX1 + mat11 * y1 + mat12);
x2 = static_cast<ValueType> (mat00 * oldX2 + mat01 * y2 + mat02);
y2 = static_cast<ValueType> (mat10 * oldX2 + mat11 * y2 + mat12);
}
/** Transforms three 2D coordinates using this matrix.
@@ -114,12 +114,12 @@ public:
ValueType& x3, ValueType& y3) const noexcept
{
const ValueType oldX1 = x1, oldX2 = x2, oldX3 = x3;
x1 = static_cast <ValueType> (mat00 * oldX1 + mat01 * y1 + mat02);
y1 = static_cast <ValueType> (mat10 * oldX1 + mat11 * y1 + mat12);
x2 = static_cast <ValueType> (mat00 * oldX2 + mat01 * y2 + mat02);
y2 = static_cast <ValueType> (mat10 * oldX2 + mat11 * y2 + mat12);
x3 = static_cast <ValueType> (mat00 * oldX3 + mat01 * y3 + mat02);
y3 = static_cast <ValueType> (mat10 * oldX3 + mat11 * y3 + mat12);
x1 = static_cast<ValueType> (mat00 * oldX1 + mat01 * y1 + mat02);
y1 = static_cast<ValueType> (mat10 * oldX1 + mat11 * y1 + mat12);
x2 = static_cast<ValueType> (mat00 * oldX2 + mat01 * y2 + mat02);
y2 = static_cast<ValueType> (mat10 * oldX2 + mat11 * y2 + mat12);
x3 = static_cast<ValueType> (mat00 * oldX3 + mat01 * y3 + mat02);
y3 = static_cast<ValueType> (mat10 * oldX3 + mat11 * y3 + mat12);
}
//==============================================================================
@@ -231,8 +231,7 @@ public:
float x10, float y10,
float x01, float y01) noexcept;
/** Returns the transform that will map three specified points onto three target points.
*/
/** Returns the transform that will map three specified points onto three target points. */
static AffineTransform fromTargetPoints (float sourceX1, float sourceY1, float targetX1, float targetY1,
float sourceX2, float sourceY2, float targetX2, float targetY2,
float sourceX3, float sourceY3, float targetX3, float targetY3) noexcept;


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

@@ -2308,9 +2308,9 @@ private:
bool mouseDownWasBlocked : 1;
bool isMoveCallbackPending : 1;
bool isResizeCallbackPending : 1;
#if JUCE_DEBUG
#if JUCE_DEBUG
bool isInsidePaintCall : 1;
#endif
#endif
};
union


+ 5
- 6
modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp View File

@@ -25,8 +25,7 @@
class ComponentAnimator::AnimationTask
{
public:
AnimationTask (Component* const comp)
: component (comp)
AnimationTask (Component* const comp) noexcept : component (comp)
{
}
@@ -34,7 +33,7 @@ public:
float finalAlpha,
int millisecondsToSpendMoving,
bool useProxyComponent,
double startSpeed_, double endSpeed_)
double startSpd, double endSpd)
{
msElapsed = 0;
msTotal = jmax (1, millisecondsToSpendMoving);
@@ -51,10 +50,10 @@ public:
bottom = component->getBottom();
alpha = component->getAlpha();
const double invTotalDistance = 4.0 / (startSpeed_ + endSpeed_ + 2.0);
startSpeed = jmax (0.0, startSpeed_ * invTotalDistance);
const double invTotalDistance = 4.0 / (startSpd + endSpd + 2.0);
startSpeed = jmax (0.0, startSpd * invTotalDistance);
midSpeed = invTotalDistance;
endSpeed = jmax (0.0, endSpeed_ * invTotalDistance);
endSpeed = jmax (0.0, endSpd * invTotalDistance);
if (useProxyComponent)
proxy = new ProxyComponent (*component);


+ 2
- 2
modules/juce_gui_basics/layout/juce_ComponentAnimator.h View File

@@ -148,10 +148,10 @@ public:
private:
//==============================================================================
class AnimationTask;
OwnedArray <AnimationTask> tasks;
OwnedArray<AnimationTask> tasks;
uint32 lastTime;
AnimationTask* findTaskFor (Component* component) const noexcept;
AnimationTask* findTaskFor (Component*) const noexcept;
void timerCallback();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComponentAnimator)


+ 1
- 1
modules/juce_gui_basics/layout/juce_ComponentBuilder.cpp View File

@@ -238,7 +238,7 @@ void ComponentBuilder::updateChildComponents (Component& parent, const ValueTree
const int numExistingChildComps = parent.getNumChildComponents();
Array <Component*> componentsInOrder;
Array<Component*> componentsInOrder;
componentsInOrder.ensureStorageAllocated (numExistingChildComps);
{


+ 1
- 1
modules/juce_gui_basics/layout/juce_ComponentBuilder.h View File

@@ -226,7 +226,7 @@ public:
private:
//=============================================================================
OwnedArray <TypeHandler> types;
OwnedArray<TypeHandler> types;
ScopedPointer<Component> component;
ImageProvider* imageProvider;
#if JUCE_DEBUG


+ 1
- 1
modules/juce_gui_basics/widgets/juce_ComboBox.h View File

@@ -418,7 +418,7 @@ private:
bool isEnabled : 1, isHeading : 1;
};
OwnedArray <ItemInfo> items;
OwnedArray<ItemInfo> items;
Value currentId;
int lastCurrentId;
bool isButtonDown, separatorPending, menuActive, scrollWheelEnabled;


+ 9
- 8
modules/juce_gui_basics/windows/juce_AlertWindow.cpp View File

@@ -404,7 +404,7 @@ void AlertWindow::updateLayout (const bool onlyIncreaseSize)
for (int i = textBlocks.size(); --i >= 0;)
{
const AlertTextComp* const ac = static_cast <const AlertTextComp*> (textBlocks.getUnchecked(i));
const AlertTextComp* const ac = static_cast<const AlertTextComp*> (textBlocks.getUnchecked(i));
w = jmax (w, ac->getPreferredWidth());
}
@@ -412,7 +412,7 @@ void AlertWindow::updateLayout (const bool onlyIncreaseSize)
for (int i = textBlocks.size(); --i >= 0;)
{
AlertTextComp* const ac = static_cast <AlertTextComp*> (textBlocks.getUnchecked(i));
AlertTextComp* const ac = static_cast<AlertTextComp*> (textBlocks.getUnchecked(i));
ac->updateLayout ((int) (w * 0.8f));
h += ac->getHeight() + 10;
}
@@ -470,11 +470,11 @@ void AlertWindow::updateLayout (const bool onlyIncreaseSize)
Component* const c = allComps.getUnchecked(i);
h = 22;
const int comboIndex = comboBoxes.indexOf (dynamic_cast <ComboBox*> (c));
const int comboIndex = comboBoxes.indexOf (dynamic_cast<ComboBox*> (c));
if (comboIndex >= 0 && comboBoxNames [comboIndex].isNotEmpty())
y += labelHeight;
const int tbIndex = textBoxes.indexOf (dynamic_cast <TextEditor*> (c));
const int tbIndex = textBoxes.indexOf (dynamic_cast<TextEditor*> (c));
if (tbIndex >= 0 && textboxNames[tbIndex].isNotEmpty())
y += labelHeight;
@@ -536,7 +536,8 @@ bool AlertWindow::keyPressed (const KeyPress& key)
exitModalState (0);
return true;
}
else if (key.isKeyCode (KeyPress::returnKey) && buttons.size() == 1)
if (key.isKeyCode (KeyPress::returnKey) && buttons.size() == 1)
{
buttons.getUnchecked(0)->triggerClick();
return true;
@@ -592,8 +593,8 @@ private:
LookAndFeel& lf = associatedComponent != nullptr ? associatedComponent->getLookAndFeel()
: LookAndFeel::getDefaultLookAndFeel();
ScopedPointer <Component> alertBox (lf.createAlertWindow (title, message, button1, button2, button3,
iconType, numButtons, associatedComponent));
ScopedPointer<Component> alertBox (lf.createAlertWindow (title, message, button1, button2, button3,
iconType, numButtons, associatedComponent));
jassert (alertBox != nullptr); // you have to return one of these!
@@ -614,7 +615,7 @@ private:
static void* showCallback (void* userData)
{
static_cast <AlertWindowInfo*> (userData)->show();
static_cast<AlertWindowInfo*> (userData)->show();
return nullptr;
}
};


+ 6
- 6
modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp View File

@@ -35,7 +35,7 @@ public:
const CodeDocument::Position& selStart,
const CodeDocument::Position& selEnd)
{
Array <SyntaxToken> newTokens;
Array<SyntaxToken> newTokens;
newTokens.ensureStorageAllocated (8);
if (tokeniser == nullptr)
@@ -129,13 +129,13 @@ private:
int tokenType;
};
Array <SyntaxToken> tokens;
Array<SyntaxToken> tokens;
int highlightColumnStart, highlightColumnEnd;
static void createTokens (int startPosition, const String& lineText,
CodeDocument::Iterator& source,
CodeTokeniser& tokeniser,
Array <SyntaxToken>& newTokens)
Array<SyntaxToken>& newTokens)
{
CodeDocument::Iterator lastIterator (source);
const int lineLength = lineText.length();
@@ -168,7 +168,7 @@ private:
source = lastIterator;
}
static void replaceTabsWithSpaces (Array <SyntaxToken>& tokens, const int spacesPerTab)
static void replaceTabsWithSpaces (Array<SyntaxToken>& tokens, const int spacesPerTab)
{
int x = 0;
for (int i = 0; i < tokens.size(); ++i)
@@ -412,7 +412,7 @@ bool CodeEditorComponent::isTextInputActive() const
return true;
}
void CodeEditorComponent::setTemporaryUnderlining (const Array <Range<int> >&)
void CodeEditorComponent::setTemporaryUnderlining (const Array<Range<int> >&)
{
jassertfalse; // TODO Windows IME not yet supported for this comp..
}
@@ -1235,7 +1235,7 @@ ApplicationCommandTarget* CodeEditorComponent::getNextCommandTarget()
return findFirstTargetParentComponent();
}
void CodeEditorComponent::getAllCommands (Array <CommandID>& commands)
void CodeEditorComponent::getAllCommands (Array<CommandID>& commands)
{
const CommandID ids[] = { StandardApplicationCommandIDs::cut,
StandardApplicationCommandIDs::copy,


+ 1
- 1
modules/juce_gui_extra/misc/juce_ColourSelector.h View File

@@ -145,7 +145,7 @@ private:
ScopedPointer<Slider> sliders[4];
ScopedPointer<ColourSpaceView> colourSpace;
ScopedPointer<HueSelectorComp> hueSelector;
OwnedArray <SwatchComponent> swatchComponents;
OwnedArray<SwatchComponent> swatchComponents;
const int flags;
int edgeGap;
Rectangle<int> previewArea;


Loading…
Cancel
Save