Browse Source

Cleanup: Add some missing explicit constructors

tags/2021-05-28
reuk 5 years ago
parent
commit
4292a38327
20 changed files with 46 additions and 46 deletions
  1. +2
    -3
      extras/AudioPerformanceTest/Source/Main.cpp
  2. +2
    -2
      extras/AudioPerformanceTest/Source/MainComponent.h
  3. +3
    -2
      extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp
  4. +2
    -2
      extras/NetworkGraphicsDemo/Source/Demos.h
  5. +3
    -3
      extras/NetworkGraphicsDemo/Source/Main.cpp
  6. +1
    -1
      extras/NetworkGraphicsDemo/Source/MasterComponent.h
  7. +7
    -7
      extras/NetworkGraphicsDemo/Source/SharedCanvas.h
  8. +1
    -1
      extras/NetworkGraphicsDemo/Source/SlaveComponent.h
  9. +1
    -1
      extras/Projucer/Source/Application/jucer_AutoUpdater.cpp
  10. +1
    -1
      extras/Projucer/Source/Application/jucer_CommandLine.cpp
  11. +4
    -4
      extras/Projucer/Source/ComponentEditor/PaintElements/jucer_ColouredElement.cpp
  12. +1
    -1
      extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.cpp
  13. +2
    -2
      extras/Projucer/Source/ComponentEditor/UI/jucer_EditingPanelBase.cpp
  14. +8
    -8
      extras/Projucer/Source/ComponentEditor/UI/jucer_JucerDocumentEditor.cpp
  15. +1
    -1
      extras/Projucer/Source/ComponentEditor/UI/jucer_ResourceEditorPanel.cpp
  16. +1
    -1
      extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp
  17. +1
    -1
      extras/Projucer/Source/ComponentEditor/jucer_PaintRoutine.cpp
  18. +2
    -2
      extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.cpp
  19. +2
    -2
      extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineServer.cpp
  20. +1
    -1
      extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.cpp

+ 2
- 3
extras/AudioPerformanceTest/Source/Main.cpp View File

@@ -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);


+ 2
- 2
extras/AudioPerformanceTest/Source/MainComponent.h View File

@@ -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();
}


+ 3
- 2
extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp View File

@@ -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[]


+ 2
- 2
extras/NetworkGraphicsDemo/Source/Demos.h View File

@@ -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;


+ 3
- 3
extras/NetworkGraphicsDemo/Source/Main.cpp View File

@@ -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();
}


+ 1
- 1
extras/NetworkGraphicsDemo/Source/MasterComponent.h View File

@@ -48,7 +48,7 @@ struct MasterContentComponent : public Component,
startTimerHz (30);
}
~MasterContentComponent()
~MasterContentComponent() override
{
OSCReceiver::removeListener (this);
}


+ 7
- 7
extras/NetworkGraphicsDemo/Source/SharedCanvas.h View File

@@ -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** "; }


+ 1
- 1
extras/NetworkGraphicsDemo/Source/SlaveComponent.h View File

@@ -58,7 +58,7 @@ public:
startTimer (2000);
}
~SlaveCanvasComponent()
~SlaveCanvasComponent() override
{
OSCReceiver::removeListener (this);
}


+ 1
- 1
extras/Projucer/Source/Application/jucer_AutoUpdater.cpp View File

@@ -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());


+ 1
- 1
extras/Projucer/Source/Application/jucer_CommandLine.cpp View File

@@ -63,7 +63,7 @@ namespace
//==============================================================================
struct LoadedProject
{
LoadedProject (const ArgumentList::Argument& fileToLoad)
explicit LoadedProject (const ArgumentList::Argument& fileToLoad)
{
hideDockIcon();


+ 4
- 4
extras/Projucer/Source/ComponentEditor/PaintElements/jucer_ColouredElement.cpp View File

@@ -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_)
{


+ 1
- 1
extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.cpp View File

@@ -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_)
{


+ 2
- 2
extras/Projucer/Source/ComponentEditor/UI/jucer_EditingPanelBase.cpp View File

@@ -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)
{
}


+ 8
- 8
extras/Projucer/Source/ComponentEditor/UI/jucer_JucerDocumentEditor.cpp View File

@@ -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)
{}


+ 1
- 1
extras/Projucer/Source/ComponentEditor/UI/jucer_ResourceEditorPanel.cpp View File

@@ -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);


+ 1
- 1
extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp View File

@@ -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;


+ 1
- 1
extras/Projucer/Source/ComponentEditor/jucer_PaintRoutine.cpp View File

@@ -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)
{


+ 2
- 2
extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.cpp View File

@@ -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
{


+ 2
- 2
extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineServer.cpp View File

@@ -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))


+ 1
- 1
extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.cpp View File

@@ -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…
Cancel
Save