1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Squashed some compiler warnings with -Wmissing-prototypes enabled

This commit is contained in:
ed 2020-08-27 14:13:58 +01:00
parent cc0da9527a
commit 333f98d204
17 changed files with 48 additions and 38 deletions

View file

@ -169,10 +169,6 @@ AudioDeviceManager& getSharedAudioDeviceManager (int numInputChannels, int numOu
}
//==============================================================================
// need to split this into two files otherwise VS will fall over
void registerDemos_One() noexcept;
void registerDemos_Two() noexcept;
void registerAllDemos() noexcept
{
registerDemos_One();

View file

@ -57,6 +57,9 @@ struct JUCEDemos
static File findExamplesDirectoryFromExecutable (File exec);
};
void registerDemos_One() noexcept;
void registerDemos_Two() noexcept;
//==============================================================================
// used by child-process demo
bool invokeChildProcessDemo (const String& commandLine);

View file

@ -78,7 +78,7 @@ namespace build_tools
}
} // namespace mac
void writeMacIcon (const Icons& icons, OutputStream& out)
static void writeMacIcon (const Icons& icons, OutputStream& out)
{
MemoryOutputStream data;
auto smallest = std::numeric_limits<int>::max();
@ -269,7 +269,7 @@ namespace build_tools
}
} // namespace win
void writeWinIcon (const Icons& icons, OutputStream& os)
static void writeWinIcon (const Icons& icons, OutputStream& os)
{
Array<Image> images;
int sizes[] = { 16, 32, 48, 256 };

View file

@ -1452,7 +1452,7 @@ void ProjucerApplication::initCommandManager()
registerGUIEditorCommands();
}
void rescanModules (AvailableModulesList& list, const Array<File>& paths, bool async)
static void rescanModules (AvailableModulesList& list, const Array<File>& paths, bool async)
{
if (async)
list.scanPathsAsync (paths);
@ -1556,13 +1556,13 @@ void ProjucerApplication::setEditorColourScheme (int index, bool saveSetting)
getCommandManager().commandStatusChanged();
}
bool isEditorColourSchemeADefaultScheme (const StringArray& schemes, int editorColourSchemeIndex)
static bool isEditorColourSchemeADefaultScheme (const StringArray& schemes, int editorColourSchemeIndex)
{
auto& schemeName = schemes[editorColourSchemeIndex];
return (schemeName == "Default (Dark)" || schemeName == "Default (Light)");
}
int getEditorColourSchemeForGUIColourScheme (const StringArray& schemes, int guiColourSchemeIndex)
static int getEditorColourSchemeForGUIColourScheme (const StringArray& schemes, int guiColourSchemeIndex)
{
auto defaultDarkEditorIndex = schemes.indexOf ("Default (Dark)");
auto defaultLightEditorIndex = schemes.indexOf ("Default (Light)");

View file

@ -499,7 +499,7 @@ private:
std::function<void()> completionCallback;
};
void restartProcess (const File& targetFolder)
static void restartProcess (const File& targetFolder)
{
#if JUCE_MAC || JUCE_LINUX
#if JUCE_MAC

View file

@ -1217,6 +1217,7 @@ Image JucerDocumentEditor::createComponentLayerSnapshot() const
const int gridSnapMenuItemBase = 0x8723620;
const int snapSizes[] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32 };
PopupMenu createGUIEditorMenu();
PopupMenu createGUIEditorMenu()
{
PopupMenu menu;
@ -1293,6 +1294,7 @@ PopupMenu createGUIEditorMenu()
menu.addSubMenu ("Component Overlay", overlays, holder != nullptr);
}
return menu;
}

View file

@ -366,7 +366,7 @@ bool isJUCEModulesFolder (const File& f)
}
//==============================================================================
bool isDivider (const String& line)
static bool isDivider (const String& line)
{
auto afterIndent = line.trim();
@ -385,7 +385,7 @@ bool isDivider (const String& line)
return false;
}
int getIndexOfCommentBlockStart (const StringArray& lines, int endIndex)
static int getIndexOfCommentBlockStart (const StringArray& lines, int endIndex)
{
auto endLine = lines[endIndex];
@ -431,7 +431,7 @@ int findBestLineToScrollToForClass (StringArray lines, const String& className,
}
//==============================================================================
var parseJUCEHeaderMetadata (const StringArray& lines)
static var parseJUCEHeaderMetadata (const StringArray& lines)
{
auto* o = new DynamicObject();
var result (o);
@ -454,7 +454,7 @@ var parseJUCEHeaderMetadata (const StringArray& lines)
return result;
}
String parseMetadataItem (const StringArray& lines, int& index)
static String parseMetadataItem (const StringArray& lines, int& index)
{
String result = lines[index++];

View file

@ -47,7 +47,8 @@ namespace OggVorbisNamespace
"-Wsign-conversion",
"-Wswitch-default",
"-Wredundant-decls",
"-Wmisleading-indentation")
"-Wmisleading-indentation",
"-Wmissing-prototypes")
#include "oggvorbis/vorbisenc.h"
#include "oggvorbis/codec.h"

View file

@ -2975,6 +2975,7 @@ JUCE_END_IGNORE_WARNINGS_MSVC
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
//==============================================================================
bool initModule();
bool initModule()
{
#if JUCE_MAC
@ -2984,6 +2985,7 @@ bool initModule()
return true;
}
bool shutdownModule();
bool shutdownModule()
{
return true;
@ -2992,17 +2994,19 @@ bool shutdownModule()
#undef JUCE_EXPORTED_FUNCTION
#if JUCE_WINDOWS
extern "C" __declspec (dllexport) bool InitDll() { return initModule(); }
extern "C" __declspec (dllexport) bool ExitDll() { return shutdownModule(); }
#define JUCE_EXPORTED_FUNCTION
#else
#define JUCE_EXPORTED_FUNCTION extern "C" __attribute__ ((visibility ("default")))
#define JUCE_EXPORTED_FUNCTION extern "C" __attribute__ ((visibility("default")))
#endif
#if JUCE_LINUX
#if JUCE_WINDOWS
extern "C" __declspec (dllexport) bool InitDll() { return initModule(); }
extern "C" __declspec (dllexport) bool ExitDll() { return shutdownModule(); }
#elif JUCE_LINUX
void* moduleHandle = nullptr;
int moduleEntryCounter = 0;
JUCE_EXPORTED_FUNCTION bool ModuleEntry (void* sharedLibraryHandle);
JUCE_EXPORTED_FUNCTION bool ModuleEntry (void* sharedLibraryHandle)
{
if (++moduleEntryCounter == 1)
@ -3014,6 +3018,7 @@ bool shutdownModule()
return true;
}
JUCE_EXPORTED_FUNCTION bool ModuleExit();
JUCE_EXPORTED_FUNCTION bool ModuleExit()
{
if (--moduleEntryCounter == 0)
@ -3033,6 +3038,7 @@ bool shutdownModule()
char modulePath[MaxPathLength] = { 0 };
void* moduleHandle = nullptr;
JUCE_EXPORTED_FUNCTION bool bundleEntry (CFBundleRef ref);
JUCE_EXPORTED_FUNCTION bool bundleEntry (CFBundleRef ref)
{
if (ref != nullptr)
@ -3056,6 +3062,7 @@ bool shutdownModule()
return initModule();
}
JUCE_EXPORTED_FUNCTION bool bundleExit();
JUCE_EXPORTED_FUNCTION bool bundleExit()
{
if (shutdownModule())

View file

@ -127,4 +127,5 @@
#endif
#include "utility/juce_PluginHostType.h"
#include "utility/juce_CreatePluginFilter.h"
#include "VST/juce_VSTCallbackHandler.h"

View file

@ -43,7 +43,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wparentheses",
"-Wzero-as-null-pointer-constant",
"-Wnullable-to-nonnull-conversion",
"-Wignored-qualifiers",
"-Wfour-char-constants")
"-Wfour-char-constants",
"-Wmissing-prototypes")
// From MacOS 10.13 and iOS 11 Apple has (sensibly!) stopped defining a whole
// set of functions with rather generic names. However, we still need a couple

View file

@ -25,8 +25,6 @@
#pragma once
#include <juce_audio_processors/juce_audio_processors.h>
/** Somewhere in the codebase of your plugin, you need to implement this function
and make it return a new instance of the filter subclass that you're building.
*/

View file

@ -74,7 +74,7 @@ namespace AudioUnitFormatHelpers
static ThreadLocalValue<int> insideCallback;
#endif
String osTypeToString (OSType type) noexcept
static String osTypeToString (OSType type) noexcept
{
const juce_wchar s[4] = { (juce_wchar) ((type >> 24) & 0xff),
(juce_wchar) ((type >> 16) & 0xff),
@ -83,7 +83,7 @@ namespace AudioUnitFormatHelpers
return String (s, 4);
}
OSType stringToOSType (String s)
static OSType stringToOSType (String s)
{
if (s.trim().length() >= 4) // (to avoid trimming leading spaces)
s = s.trim();
@ -98,7 +98,7 @@ namespace AudioUnitFormatHelpers
static const char* auIdentifierPrefix = "AudioUnit:";
String createPluginIdentifier (const AudioComponentDescription& desc)
static String createPluginIdentifier (const AudioComponentDescription& desc)
{
String s (auIdentifierPrefix);
@ -123,7 +123,7 @@ namespace AudioUnitFormatHelpers
return s;
}
void getNameAndManufacturer (AudioComponent comp, String& name, String& manufacturer)
static void getNameAndManufacturer (AudioComponent comp, String& name, String& manufacturer)
{
CFStringRef cfName;
if (AudioComponentCopyName (comp, &cfName) == noErr)
@ -142,8 +142,8 @@ namespace AudioUnitFormatHelpers
name = "<Unknown>";
}
bool getComponentDescFromIdentifier (const String& fileOrIdentifier, AudioComponentDescription& desc,
String& name, String& version, String& manufacturer)
static bool getComponentDescFromIdentifier (const String& fileOrIdentifier, AudioComponentDescription& desc,
String& name, String& version, String& manufacturer)
{
if (fileOrIdentifier.startsWithIgnoreCase (auIdentifierPrefix))
{
@ -188,8 +188,8 @@ namespace AudioUnitFormatHelpers
return false;
}
bool getComponentDescFromFile (const String& fileOrIdentifier, AudioComponentDescription& desc,
String& name, String& version, String& manufacturer)
static bool getComponentDescFromFile (const String& fileOrIdentifier, AudioComponentDescription& desc,
String& name, String& version, String& manufacturer)
{
zerostruct (desc);
@ -291,7 +291,7 @@ namespace AudioUnitFormatHelpers
#endif
}
const char* getCategory (OSType type) noexcept
static const char* getCategory (OSType type) noexcept
{
switch (type)
{

View file

@ -55,7 +55,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor",
"-Wformat",
"-Wpedantic",
"-Wextra",
"-Wclass-memaccess")
"-Wclass-memaccess",
"-Wmissing-prototypes")
#undef DEVELOPMENT
#define DEVELOPMENT 0 // This avoids a Clang warning in Steinberg code about unused values

View file

@ -87,14 +87,14 @@ namespace ArrayBaseTestsHelpers
};
}
bool operator== (const ArrayBaseTestsHelpers::TriviallyCopyableType& tct,
const ArrayBaseTestsHelpers::NonTriviallyCopyableType& ntct)
static bool operator== (const ArrayBaseTestsHelpers::TriviallyCopyableType& tct,
const ArrayBaseTestsHelpers::NonTriviallyCopyableType& ntct)
{
return tct.getValue() == ntct.getValue();
}
bool operator== (const ArrayBaseTestsHelpers::NonTriviallyCopyableType& ntct,
const ArrayBaseTestsHelpers::TriviallyCopyableType& tct)
static bool operator== (const ArrayBaseTestsHelpers::NonTriviallyCopyableType& ntct,
const ArrayBaseTestsHelpers::TriviallyCopyableType& tct)
{
return tct == ntct;
}

View file

@ -42,7 +42,7 @@ public:
}
};
void updateButtonTickColour (ToggleButton* button, bool usingDefault)
static void updateButtonTickColour (ToggleButton* button, bool usingDefault)
{
button->setColour (ToggleButton::tickColourId, button->getLookAndFeel().findColour (ToggleButton::tickColourId)
.withAlpha (usingDefault ? 0.4f : 1.0f));

View file

@ -36,7 +36,7 @@ namespace juce
#endif
NSMutableURLRequest* getRequestForURL (const String& url, const StringArray* headers, const MemoryBlock* postData)
static NSMutableURLRequest* getRequestForURL (const String& url, const StringArray* headers, const MemoryBlock* postData)
{
NSString* urlString = juceStringToNS (url);