Skip to content

Commit cb4e419

Browse files
committed
Fix warnings
1 parent 7f008ca commit cb4e419

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

Source/Components/PropertiesPanel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,9 @@ void PropertiesPanel::InspectorColourComponent::mouseExit(MouseEvent const& e)
550550
repaint();
551551
}
552552

553-
struct SwatchComponent final : public Component {
553+
class SwatchComponent final : public Component {
554554

555+
public:
555556
explicit SwatchComponent(Value const& colour)
556557
{
557558
colourValue.referTo(colour);

Source/Components/PropertiesPanel.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,13 @@ class PropertiesPanel : public Component {
306306
};
307307

308308
template<typename T>
309-
struct EditableComponent final : public PropertiesPanelProperty, public Value::Listener {
310-
std::unique_ptr<Component> label;
309+
class EditableComponent final : public PropertiesPanelProperty, public Value::Listener {
311310
Value property;
312311
String allowedCharacters = "";
313312
double min, max;
314-
313+
public:
314+
std::unique_ptr<Component> label;
315+
315316
EditableComponent(String const& propertyName, Value& value, double minimum = 0.0, double maximum = 0.0, std::function<void(bool)> onInteractionFn = nullptr)
316317
: PropertiesPanelProperty(propertyName)
317318
, property(value)

Source/Pd/Instance.cpp

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,16 @@ EXTERN int sys_load_lib(t_canvas* canvas, char const* classname);
3232

3333
namespace pd {
3434

35-
struct ConsoleMessageHandler final : public Timer {
35+
class ConsoleMessageHandler final : public Timer {
3636
Instance* instance;
3737

38+
public:
3839
explicit ConsoleMessageHandler(Instance* parent)
3940
: instance(parent)
4041
{
4142
startTimerHz(30);
4243
}
4344

44-
void timerCallback() override
45-
{
46-
auto item = std::tuple<void*, SmallString, bool>();
47-
int numReceived = 0;
48-
bool newWarning = false;
49-
50-
while (pendingMessages.try_dequeue(item)) {
51-
auto& [object, message, type] = item;
52-
addMessage(object, message.toString(), type);
53-
54-
numReceived++;
55-
newWarning = newWarning || type;
56-
}
57-
58-
// Check if any item got assigned
59-
if (numReceived) {
60-
instance->updateConsole(numReceived, newWarning);
61-
}
62-
}
63-
6445
void addMessage(void* object, String const& message, bool type)
6546
{
6647
if (consoleMessages.size()) {
@@ -139,10 +120,31 @@ struct ConsoleMessageHandler final : public Timer {
139120
length = 0;
140121
}
141122
}
142-
123+
143124
std::deque<std::tuple<void*, String, int, int, int>> consoleMessages;
144125
std::deque<std::tuple<void*, String, int, int, int>> consoleHistory;
126+
127+
private:
128+
void timerCallback() override
129+
{
130+
auto item = std::tuple<void*, SmallString, bool>();
131+
int numReceived = 0;
132+
bool newWarning = false;
133+
134+
while (pendingMessages.try_dequeue(item)) {
135+
auto& [object, message, type] = item;
136+
addMessage(object, message.toString(), type);
145137

138+
numReceived++;
139+
newWarning = newWarning || type;
140+
}
141+
142+
// Check if any item got assigned
143+
if (numReceived) {
144+
instance->updateConsole(numReceived, newWarning);
145+
}
146+
}
147+
146148
StackArray<char, 2048> printConcatBuffer;
147149

148150
moodycamel::ConcurrentQueue<std::tuple<void*, SmallString, bool>> pendingMessages = moodycamel::ConcurrentQueue<std::tuple<void*, SmallString, bool>>(512);

0 commit comments

Comments
 (0)