Browse Source

Squashed some compiler warnings with -Wmissing-prototypes enabled

tags/2021-05-28
ed 5 years ago
parent
commit
333f98d204
17 changed files with 48 additions and 38 deletions
  1. +0
    -4
      examples/DemoRunner/Source/Demos/JUCEDemos.cpp
  2. +3
    -0
      examples/DemoRunner/Source/Demos/JUCEDemos.h
  3. +2
    -2
      extras/Build/juce_build_tools/utils/juce_Icons.cpp
  4. +3
    -3
      extras/Projucer/Source/Application/jucer_Application.cpp
  5. +1
    -1
      extras/Projucer/Source/Application/jucer_AutoUpdater.cpp
  6. +2
    -0
      extras/Projucer/Source/ComponentEditor/UI/jucer_JucerDocumentEditor.cpp
  7. +4
    -4
      extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.cpp
  8. +2
    -1
      modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp
  9. +11
    -4
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  10. +1
    -0
      modules/juce_audio_plugin_client/juce_audio_plugin_client.h
  11. +2
    -1
      modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm
  12. +0
    -2
      modules/juce_audio_plugin_client/utility/juce_CreatePluginFilter.h
  13. +9
    -9
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  14. +2
    -1
      modules/juce_audio_processors/format_types/juce_VST3Headers.h
  15. +4
    -4
      modules/juce_core/containers/juce_ArrayBase.cpp
  16. +1
    -1
      modules/juce_gui_basics/properties/juce_MultiChoicePropertyComponent.cpp
  17. +1
    -1
      modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm

+ 0
- 4
examples/DemoRunner/Source/Demos/JUCEDemos.cpp 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 void registerAllDemos() noexcept
{ {
registerDemos_One(); registerDemos_One();


+ 3
- 0
examples/DemoRunner/Source/Demos/JUCEDemos.h View File

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


+ 2
- 2
extras/Build/juce_build_tools/utils/juce_Icons.cpp View File

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


+ 3
- 3
extras/Projucer/Source/Application/jucer_Application.cpp View File

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


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

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


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

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


+ 4
- 4
extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.cpp 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(); auto afterIndent = line.trim();
@@ -385,7 +385,7 @@ bool isDivider (const String& line)
return false; return false;
} }
int getIndexOfCommentBlockStart (const StringArray& lines, int endIndex)
static int getIndexOfCommentBlockStart (const StringArray& lines, int endIndex)
{ {
auto endLine = lines[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(); auto* o = new DynamicObject();
var result (o); var result (o);
@@ -454,7 +454,7 @@ var parseJUCEHeaderMetadata (const StringArray& lines)
return result; return result;
} }
String parseMetadataItem (const StringArray& lines, int& index)
static String parseMetadataItem (const StringArray& lines, int& index)
{ {
String result = lines[index++]; String result = lines[index++];


+ 2
- 1
modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp View File

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


+ 11
- 4
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

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


+ 1
- 0
modules/juce_audio_plugin_client/juce_audio_plugin_client.h View File

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

+ 2
- 1
modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm View File

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


+ 0
- 2
modules/juce_audio_plugin_client/utility/juce_CreatePluginFilter.h View File

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


+ 9
- 9
modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm View File

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


+ 2
- 1
modules/juce_audio_processors/format_types/juce_VST3Headers.h View File

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


+ 4
- 4
modules/juce_core/containers/juce_ArrayBase.cpp 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(); 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; return tct == ntct;
} }


+ 1
- 1
modules/juce_gui_basics/properties/juce_MultiChoicePropertyComponent.cpp 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) button->setColour (ToggleButton::tickColourId, button->getLookAndFeel().findColour (ToggleButton::tickColourId)
.withAlpha (usingDefault ? 0.4f : 1.0f)); .withAlpha (usingDefault ? 0.4f : 1.0f));


+ 1
- 1
modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm View File

@@ -36,7 +36,7 @@ namespace juce
#endif #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); NSString* urlString = juceStringToNS (url);


Loading…
Cancel
Save