mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Cleanup: Add some missing explicit constructors
This commit is contained in:
parent
4cf66d6522
commit
4292a38327
20 changed files with 46 additions and 46 deletions
|
|
@ -53,9 +53,8 @@ public:
|
|||
class MainWindow : public DocumentWindow
|
||||
{
|
||||
public:
|
||||
MainWindow (String name) : DocumentWindow (name,
|
||||
Colours::lightgrey,
|
||||
DocumentWindow::allButtons)
|
||||
explicit MainWindow (String name)
|
||||
: DocumentWindow (name, Colours::lightgrey, DocumentWindow::allButtons)
|
||||
{
|
||||
setUsingNativeTitleBar (true);
|
||||
setContentOwned (createMainContentComponent(), true);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public:
|
|||
startTimer (1000);
|
||||
}
|
||||
|
||||
~MainContentComponent()
|
||||
~MainContentComponent() override
|
||||
{
|
||||
shutdownAudio();
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ public:
|
|||
void prepareToPlay (int bufferSize, double sampleRate) override
|
||||
{
|
||||
currentSampleRate = sampleRate;
|
||||
allocateBuffers (bufferSize);
|
||||
allocateBuffers (static_cast<size_t> (bufferSize));
|
||||
printHeader();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -502,7 +502,8 @@ struct GraphEditorPanel::PluginComponent : public Component,
|
|||
struct GraphEditorPanel::ConnectorComponent : public Component,
|
||||
public SettableTooltipClient
|
||||
{
|
||||
ConnectorComponent (GraphEditorPanel& p) : panel (p), graph (p.graph)
|
||||
explicit ConnectorComponent (GraphEditorPanel& p)
|
||||
: panel (p), graph (p.graph)
|
||||
{
|
||||
setAlwaysOnTop (true);
|
||||
}
|
||||
|
|
@ -986,7 +987,7 @@ class GraphDocumentComponent::TitleBarComponent : public Component,
|
|||
private Button::Listener
|
||||
{
|
||||
public:
|
||||
TitleBarComponent (GraphDocumentComponent& graphDocumentComponent)
|
||||
explicit TitleBarComponent (GraphDocumentComponent& graphDocumentComponent)
|
||||
: owner (graphDocumentComponent)
|
||||
{
|
||||
static const unsigned char burgerMenuPathData[]
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ struct BackgroundLogo : public AnimatedContent
|
|||
void reset() override {}
|
||||
void handleTouch (Point<float>) override {}
|
||||
|
||||
void generateCanvas (Graphics& g, SharedCanvasDescription& canvas, Rectangle<float> activeArea) override
|
||||
void generateCanvas (Graphics& g, SharedCanvasDescription& canvas, Rectangle<float>) override
|
||||
{
|
||||
logo->drawWithin (g, canvas.getLimits().reduced (3.0f), RectanglePlacement (RectanglePlacement::centred), 0.6f);
|
||||
}
|
||||
|
|
@ -465,7 +465,7 @@ struct MultiLogo : public BackgroundLogo
|
|||
{
|
||||
String getName() const override { return "Multi-Logo " + String ((int) numHorizontalLogos); }
|
||||
|
||||
void generateCanvas (Graphics& g, SharedCanvasDescription& canvas, Rectangle<float> activeArea) override
|
||||
void generateCanvas (Graphics& g, SharedCanvasDescription& canvas, Rectangle<float>) override
|
||||
{
|
||||
float indent = 0.5f;
|
||||
float logoSize = canvas.getLimits().getWidth() / numHorizontalLogos;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace
|
|||
static const String canvasStateOSCAddress = "/juce/nfd/canvasState";
|
||||
static const String newClientOSCAddress = "/juce/nfd/newClient";
|
||||
static const String userInputOSCAddress = "/juce/nfd/userInput";
|
||||
};
|
||||
}
|
||||
|
||||
#include "SharedCanvas.h"
|
||||
#include "SlaveComponent.h"
|
||||
|
|
@ -84,7 +84,7 @@ public:
|
|||
//==============================================================================
|
||||
struct MainWindow : public DocumentWindow
|
||||
{
|
||||
MainWindow (PropertiesFile& props)
|
||||
explicit MainWindow (PropertiesFile& props)
|
||||
: DocumentWindow ("JUCE Networked Graphics Demo - Master", Colours::white, DocumentWindow::allButtons)
|
||||
{
|
||||
setUsingNativeTitleBar (true);
|
||||
|
|
@ -114,7 +114,7 @@ public:
|
|||
#endif
|
||||
}
|
||||
|
||||
~MainWindow()
|
||||
~MainWindow() override
|
||||
{
|
||||
glContext.detach();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ struct MasterContentComponent : public Component,
|
|||
startTimerHz (30);
|
||||
}
|
||||
|
||||
~MasterContentComponent()
|
||||
~MasterContentComponent() override
|
||||
{
|
||||
OSCReceiver::removeListener (this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -447,9 +447,9 @@ struct BlockPacketiser
|
|||
|
||||
while (remaining > 0)
|
||||
{
|
||||
auto num = (int) jmin (maxBlockSize, remaining);
|
||||
blocks.add (MemoryBlock (addBytesToPointer (data.getData(), offset), (size_t) num));
|
||||
offset += num;
|
||||
auto num = (size_t) jmin (maxBlockSize, remaining);
|
||||
blocks.add (MemoryBlock (addBytesToPointer (data.getData(), offset), num));
|
||||
offset += (int) num;
|
||||
remaining -= num;
|
||||
}
|
||||
|
||||
|
|
@ -459,7 +459,7 @@ struct BlockPacketiser
|
|||
|
||||
for (int i = 0; i < blocks.size(); ++i)
|
||||
{
|
||||
uint32 index = ByteOrder::swapIfBigEndian (i);
|
||||
auto index = (uint32) ByteOrder::swapIfBigEndian (i);
|
||||
blocks.getReference(i).append (&index, sizeof (index));
|
||||
}
|
||||
}
|
||||
|
|
@ -497,9 +497,9 @@ struct BlockPacketiser
|
|||
|
||||
static int compareElements (const MemoryBlock& b1, const MemoryBlock& b2)
|
||||
{
|
||||
int i1 = ByteOrder::littleEndianInt (addBytesToPointer (b1.getData(), b1.getSize() - 4));
|
||||
int i2 = ByteOrder::littleEndianInt (addBytesToPointer (b2.getData(), b2.getSize() - 4));
|
||||
return i1 - i2;
|
||||
auto i1 = ByteOrder::littleEndianInt (addBytesToPointer (b1.getData(), b1.getSize() - 4));
|
||||
auto i2 = ByteOrder::littleEndianInt (addBytesToPointer (b2.getData(), b2.getSize() - 4));
|
||||
return (int) (i1 - i2);
|
||||
}
|
||||
|
||||
static const char* getLastPacketPrefix() { return "**END_OF_PACKET_LIST** "; }
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public:
|
|||
startTimer (2000);
|
||||
}
|
||||
|
||||
~SlaveCanvasComponent()
|
||||
~SlaveCanvasComponent() override
|
||||
{
|
||||
OSCReceiver::removeListener (this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ private:
|
|||
|
||||
struct ScopedDownloadFolder
|
||||
{
|
||||
ScopedDownloadFolder (const File& installTargetFolder)
|
||||
explicit ScopedDownloadFolder (const File& installTargetFolder)
|
||||
{
|
||||
folder = installTargetFolder.getSiblingFile (installTargetFolder.getFileNameWithoutExtension() + "_download").getNonexistentSibling();
|
||||
jassert (folder.createDirectory());
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ namespace
|
|||
//==============================================================================
|
||||
struct LoadedProject
|
||||
{
|
||||
LoadedProject (const ArgumentList::Argument& fileToLoad)
|
||||
explicit LoadedProject (const ArgumentList::Argument& fileToLoad)
|
||||
{
|
||||
hideDockIcon();
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ private:
|
|||
class EnableStrokeProperty : public BooleanPropertyComponent
|
||||
{
|
||||
public:
|
||||
EnableStrokeProperty (ColouredElement* const owner_)
|
||||
explicit EnableStrokeProperty (ColouredElement* const owner_)
|
||||
: BooleanPropertyComponent ("outline", "Outline enabled", "No outline"),
|
||||
listener (owner_)
|
||||
{
|
||||
|
|
@ -223,7 +223,7 @@ public:
|
|||
class StrokeThicknessProperty : public SliderPropertyComponent
|
||||
{
|
||||
public:
|
||||
StrokeThicknessProperty (ColouredElement* const owner_)
|
||||
explicit StrokeThicknessProperty (ColouredElement* const owner_)
|
||||
: SliderPropertyComponent ("outline thickness", 0.1, 200.0, 0.1, 0.3),
|
||||
listener (owner_)
|
||||
{
|
||||
|
|
@ -249,7 +249,7 @@ public:
|
|||
class StrokeJointProperty : public ChoicePropertyComponent
|
||||
{
|
||||
public:
|
||||
StrokeJointProperty (ColouredElement* const owner_)
|
||||
explicit StrokeJointProperty (ColouredElement* const owner_)
|
||||
: ChoicePropertyComponent ("joint style"),
|
||||
listener (owner_)
|
||||
{
|
||||
|
|
@ -294,7 +294,7 @@ public:
|
|||
class StrokeEndCapProperty : public ChoicePropertyComponent
|
||||
{
|
||||
public:
|
||||
StrokeEndCapProperty (ColouredElement* const owner_)
|
||||
explicit StrokeEndCapProperty (ColouredElement* const owner_)
|
||||
: ChoicePropertyComponent ("end-cap style"),
|
||||
listener (owner_)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class PathWindingModeProperty : public ChoicePropertyComponent,
|
|||
public ChangeListener
|
||||
{
|
||||
public:
|
||||
PathWindingModeProperty (PaintElementPath* const owner_)
|
||||
explicit PathWindingModeProperty (PaintElementPath* const owner_)
|
||||
: ChoicePropertyComponent ("winding rule"),
|
||||
owner (owner_)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
class EditingPanelBase::MagnifierComponent : public Component
|
||||
{
|
||||
public:
|
||||
MagnifierComponent (Component* c) : content (c)
|
||||
explicit MagnifierComponent (Component* c) : content (c)
|
||||
{
|
||||
addAndMakeVisible (content.get());
|
||||
childBoundsChanged (content.get());
|
||||
|
|
@ -53,7 +53,7 @@ private:
|
|||
class ZoomingViewport : public Viewport
|
||||
{
|
||||
public:
|
||||
ZoomingViewport (EditingPanelBase* p) : panel (p)
|
||||
explicit ZoomingViewport (EditingPanelBase* p) : panel (p)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class ClassPropertiesPanel : public Component,
|
|||
private ChangeListener
|
||||
{
|
||||
public:
|
||||
ClassPropertiesPanel (JucerDocument& doc)
|
||||
explicit ClassPropertiesPanel (JucerDocument& doc)
|
||||
: document (doc)
|
||||
{
|
||||
addAndMakeVisible (panel1);
|
||||
|
|
@ -188,7 +188,7 @@ private:
|
|||
class ComponentClassNameProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
ComponentClassNameProperty (JucerDocument& doc)
|
||||
explicit ComponentClassNameProperty (JucerDocument& doc)
|
||||
: ComponentTextProperty<Component> ("Class name", 128, false, nullptr, doc)
|
||||
{}
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ private:
|
|||
class ComponentCompNameProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
ComponentCompNameProperty (JucerDocument& doc)
|
||||
explicit ComponentCompNameProperty (JucerDocument& doc)
|
||||
: ComponentTextProperty<Component> ("Component name", 200, false, nullptr, doc)
|
||||
{}
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ private:
|
|||
class ComponentParentClassesProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
ComponentParentClassesProperty (JucerDocument& doc)
|
||||
explicit ComponentParentClassesProperty (JucerDocument& doc)
|
||||
: ComponentTextProperty<Component> ("Parent classes", 512, false, nullptr, doc)
|
||||
{}
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ private:
|
|||
class ComponentConstructorParamsProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
ComponentConstructorParamsProperty (JucerDocument& doc)
|
||||
explicit ComponentConstructorParamsProperty (JucerDocument& doc)
|
||||
: ComponentTextProperty<Component> ("Constructor params", 2048, false, nullptr, doc)
|
||||
{}
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ private:
|
|||
class ComponentInitialisersProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
ComponentInitialisersProperty (JucerDocument& doc)
|
||||
explicit ComponentInitialisersProperty (JucerDocument& doc)
|
||||
: ComponentTextProperty <Component> ("Member initialisers", 16384, true, nullptr, doc)
|
||||
{
|
||||
preferredHeight = 24 * 3;
|
||||
|
|
@ -280,7 +280,7 @@ private:
|
|||
class FixedSizeProperty : public ComponentChoiceProperty <Component>
|
||||
{
|
||||
public:
|
||||
FixedSizeProperty (JucerDocument& doc)
|
||||
explicit FixedSizeProperty (JucerDocument& doc)
|
||||
: ComponentChoiceProperty<Component> ("Fixed size", nullptr, doc)
|
||||
{
|
||||
choices.add ("Resize component to fit workspace");
|
||||
|
|
@ -295,7 +295,7 @@ private:
|
|||
class TemplateFileProperty : public ComponentTextProperty <Component>
|
||||
{
|
||||
public:
|
||||
TemplateFileProperty (JucerDocument& doc)
|
||||
explicit TemplateFileProperty (JucerDocument& doc)
|
||||
: ComponentTextProperty<Component> ("Template file", 2048, false, nullptr, doc)
|
||||
{}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
class ResourceListButton : public Component
|
||||
{
|
||||
public:
|
||||
ResourceListButton (JucerDocument& doc)
|
||||
explicit ResourceListButton (JucerDocument& doc)
|
||||
: document (doc), reloadButton ("Reload"), row (0)
|
||||
{
|
||||
setInterceptsMouseClicks (false, true);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ void JucerDocument::changed()
|
|||
|
||||
struct UserDocChangeTimer : public Timer
|
||||
{
|
||||
UserDocChangeTimer (JucerDocument& d) : doc (d) {}
|
||||
explicit UserDocChangeTimer (JucerDocument& d) : doc (d) {}
|
||||
void timerCallback() override { doc.reloadFromDocument(); }
|
||||
|
||||
JucerDocument& doc;
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ PaintElement* PaintRoutine::addNewElement (PaintElement* e, const int index, con
|
|||
class DeleteElementAction : public PaintElementUndoableAction <PaintElement>
|
||||
{
|
||||
public:
|
||||
DeleteElementAction (PaintElement* const element)
|
||||
explicit DeleteElementAction (PaintElement* const element)
|
||||
: PaintElementUndoableAction <PaintElement> (element),
|
||||
oldIndex (-1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class ClientIPC : public MessageHandler,
|
|||
private Timer
|
||||
{
|
||||
public:
|
||||
ClientIPC (CompileEngineChildProcess& cp)
|
||||
explicit ClientIPC (CompileEngineChildProcess& cp)
|
||||
: InterprocessConnection (true), owner (cp)
|
||||
{
|
||||
launchServer();
|
||||
|
|
@ -705,7 +705,7 @@ private:
|
|||
|
||||
struct TransactionTimer : public Timer
|
||||
{
|
||||
TransactionTimer (CodeDocument& doc) : document (doc) {}
|
||||
explicit TransactionTimer (CodeDocument& doc) : document (doc) {}
|
||||
|
||||
void timerCallback() override
|
||||
{
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ struct ZombiePatrol : private Thread,
|
|||
private AsyncUpdater,
|
||||
private Timer
|
||||
{
|
||||
ZombiePatrol (MessageHandler& mh)
|
||||
explicit ZombiePatrol (MessageHandler& mh)
|
||||
: Thread ("Ping"), owner (mh)
|
||||
{
|
||||
startThread (2);
|
||||
|
|
@ -135,7 +135,7 @@ class ServerIPC : public InterprocessConnection,
|
|||
public MessageHandler
|
||||
{
|
||||
public:
|
||||
ServerIPC (const StringArray& info)
|
||||
explicit ServerIPC (const StringArray& info)
|
||||
: InterprocessConnection (true), liveCodeBuilder (nullptr)
|
||||
{
|
||||
if (! createPipe (info[0], -1))
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ ProjectContentComponent* JucerTreeViewBase::getProjectContentComponent() const
|
|||
class JucerTreeViewBase::ItemSelectionTimer : public Timer
|
||||
{
|
||||
public:
|
||||
ItemSelectionTimer (JucerTreeViewBase& tvb) : owner (tvb) {}
|
||||
explicit ItemSelectionTimer (JucerTreeViewBase& tvb) : owner (tvb) {}
|
||||
|
||||
void timerCallback() override { owner.invokeShowDocument(); }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue