Skip to content

Commit bfe67b9

Browse files
committed
Fixed some macOS and Linux build warnings
1 parent 11e5e32 commit bfe67b9

File tree

7 files changed

+114
-94
lines changed

7 files changed

+114
-94
lines changed

Source/CommandLine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ void performCommandLine (CommandLineValidator& validator, const ArgumentList& ar
388388
cli.addCommand ({ "--validate",
389389
"--validate [list]",
390390
"Validates the files (or IDs for AUs).", String(),
391-
[&validator] (const auto& args) { validate (validator, args); }});
391+
[&validator] (const auto& validatorArgs) { validate (validator, validatorArgs); }});
392392
cli.addCommand ({ "--run-tests",
393393
"--run-tests",
394394
"Runs the internal unit tests.", String(),

Source/CommandLine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct CommandLineValidator : private ChangeListener,
2121
private Validator::Listener
2222
{
2323
CommandLineValidator();
24-
~CommandLineValidator();
24+
~CommandLineValidator() override;
2525

2626
void validate (const StringArray& fileOrIDs, PluginTests::Options, bool validateInProcess);
2727

Source/Main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class PluginValidatorApplication : public JUCEApplication,
3131
return *propertiesFile;
3232
}
3333

34-
void initialiseSlaveFileLogger()
34+
void initialiseChildFileLogger()
3535
{
36-
#if LOG_PIPE_SLAVE_COMMUNICATION
37-
fileLogger = std::make_unique<FileLogger> (getPropertiesFileOptions().getDefaultFile().getSiblingFile ("slave_log.txt"),
36+
#if LOG_PIPE_CHILD_COMMUNICATION
37+
fileLogger = std::make_unique<FileLogger> (getPropertiesFileOptions().getDefaultFile().getSiblingFile ("child_log.txt"),
3838
getApplicationName() + " v" + getApplicationVersion(), 1024 * 1024);
3939
Logger::setCurrentLogger (fileLogger.get());
4040
#endif
@@ -59,7 +59,7 @@ class PluginValidatorApplication : public JUCEApplication,
5959
return;
6060
}
6161

62-
if (invokeSlaveProcessValidator (commandLine))
62+
if (invokeChildProcessValidator (commandLine))
6363
return;
6464

6565
validator = std::make_unique<Validator>();
@@ -190,7 +190,7 @@ PropertiesFile& getAppPreferences()
190190
return app->getAppPreferences();
191191
}
192192

193-
void slaveInitialised()
193+
void childInitialised()
194194
{
195-
dynamic_cast<PluginValidatorApplication*> (PluginValidatorApplication::getInstance())->initialiseSlaveFileLogger();
195+
dynamic_cast<PluginValidatorApplication*> (PluginValidatorApplication::getInstance())->initialiseChildFileLogger();
196196
}

Source/MainComponent.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct ConnectionStatus : public Component,
3232
validator.addChangeListener (this);
3333
}
3434

35-
~ConnectionStatus()
35+
~ConnectionStatus() override
3636
{
3737
validator.removeListener (this);
3838
validator.removeChangeListener (this);
@@ -119,7 +119,7 @@ struct ConsoleComponent : public Component,
119119
editor.setScrollbarThickness (8);
120120
}
121121

122-
~ConsoleComponent()
122+
~ConsoleComponent() override
123123
{
124124
validator.removeChangeListener (this);
125125
validator.removeListener (this);
@@ -222,7 +222,7 @@ class MainComponent : public Component,
222222
public:
223223
//==============================================================================
224224
MainComponent (Validator&);
225-
~MainComponent();
225+
~MainComponent() override;
226226

227227
//==============================================================================
228228
void paint (Graphics&) override;

Source/TestUtilities.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,26 @@ ATTRIBUTE_USED void operator delete[] (void* ptr) noexcept
103103
std::free (ptr);
104104
}
105105

106+
#if JUCE_CXX14_IS_AVAILABLE
107+
void operator delete (void* ptr, size_t) noexcept
108+
{
109+
if (! logAllocationViolationIfNotAllowed())
110+
if (thowIfRequiredAndReturnShouldLog())
111+
std::cerr << "!!! WARNING: Illegal deletion\n";
112+
113+
std::free (ptr);
114+
}
115+
116+
void operator delete[] (void* ptr, size_t) noexcept
117+
{
118+
if (! logAllocationViolationIfNotAllowed())
119+
if (thowIfRequiredAndReturnShouldLog())
120+
std::cerr << "!!! WARNING: Illegal array deletion\n";
121+
122+
std::free (ptr);
123+
}
124+
#endif
125+
106126
//==============================================================================
107127
std::atomic<AllocatorInterceptor::ViolationBehaviour> AllocatorInterceptor::violationBehaviour (ViolationBehaviour::logToCerr);
108128

0 commit comments

Comments
 (0)