From 2fcb8fa71b02321a15cfe9b0b9b58efbae2e008b Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 9 Oct 2017 15:39:22 +0100 Subject: [PATCH] Added some prototype function definitions to avoid compiler warnings for people who enable the "missing prototype" flag --- .../juce_audio_devices/native/juce_mac_CoreMidi.cpp | 2 +- .../codecs/flac/libFLAC/stream_encoder.c | 10 +++++----- .../juce_audio_formats/codecs/juce_WavAudioFormat.cpp | 2 +- modules/juce_core/misc/juce_StdFunctionCompat.cpp | 4 ++-- modules/juce_core/text/juce_String.cpp | 3 +-- modules/juce_graphics/fonts/juce_Font.cpp | 2 +- modules/juce_graphics/native/juce_mac_IconHelpers.cpp | 4 +++- modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp | 2 +- modules/juce_gui_basics/native/juce_mac_MainMenu.mm | 4 ++-- modules/juce_gui_basics/native/juce_mac_Windowing.mm | 3 ++- .../juce_gui_basics/native/juce_win32_Windowing.cpp | 1 + 11 files changed, 20 insertions(+), 17 deletions(-) diff --git a/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp b/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp index 9637792a76..e2012a77c6 100644 --- a/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp +++ b/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp @@ -69,7 +69,7 @@ namespace CoreMidiHelpers return result; } - void enableSimulatorMidiSession() + static void enableSimulatorMidiSession() { #if TARGET_OS_SIMULATOR static bool hasEnabledNetworkSession = false; diff --git a/modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c b/modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c index f5eb90e85e..795025eb92 100644 --- a/modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c +++ b/modules/juce_audio_formats/codecs/flac/libFLAC/stream_encoder.c @@ -1527,7 +1527,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncod return true; } -FLAC_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value) +inline FLAC_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value) { FLAC__ASSERT(0 != encoder); FLAC__ASSERT(0 != encoder->private_); @@ -1896,7 +1896,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encod * These three functions are not static, but not publically exposed in * include/FLAC/ either. They are used by the test suite. */ -FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) +inline FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) { FLAC__ASSERT(0 != encoder); FLAC__ASSERT(0 != encoder->private_); @@ -1907,7 +1907,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__Stream return true; } -FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) +inline FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) { FLAC__ASSERT(0 != encoder); FLAC__ASSERT(0 != encoder->private_); @@ -1918,7 +1918,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEnc return true; } -FLAC_API FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) +inline FLAC_API FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) { FLAC__ASSERT(0 != encoder); FLAC__ASSERT(0 != encoder->private_); @@ -1994,7 +1994,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_get_streamable_subset(const FLAC__Strea return encoder->protected_->streamable_subset; } -FLAC_API FLAC__bool FLAC__stream_encoder_get_do_md5(const FLAC__StreamEncoder *encoder) +inline FLAC_API FLAC__bool FLAC__stream_encoder_get_do_md5(const FLAC__StreamEncoder *encoder) { FLAC__ASSERT(0 != encoder); FLAC__ASSERT(0 != encoder->private_); diff --git a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp index 565fecb6b5..9839b831b8 100644 --- a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp @@ -232,7 +232,7 @@ namespace WavFileHelpers } JUCE_PACKED; //============================================================================== - AudioChannelSet canonicalWavChannelSet (int numChannels) + inline AudioChannelSet canonicalWavChannelSet (int numChannels) { if (numChannels == 1) return AudioChannelSet::mono(); if (numChannels == 2) return AudioChannelSet::stereo(); diff --git a/modules/juce_core/misc/juce_StdFunctionCompat.cpp b/modules/juce_core/misc/juce_StdFunctionCompat.cpp index 93bcf5c602..1f98f552f3 100644 --- a/modules/juce_core/misc/juce_StdFunctionCompat.cpp +++ b/modules/juce_core/misc/juce_StdFunctionCompat.cpp @@ -35,8 +35,8 @@ namespace juce namespace FunctionTestsHelpers { - void incrementArgument (int& x) { x++; } - double multiply (double x, double a) noexcept { return a * x; } + static void incrementArgument (int& x) { x++; } + static double multiply (double x, double a) noexcept { return a * x; } struct BigData { diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 3fb472299a..2fa3bdbbcf 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -864,7 +864,6 @@ JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, StringRef s2) JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, uint8 number) { return s1 += (int) number; } JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const short number) { return s1 += (int) number; } JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const int number) { return s1 += number; } -JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const unsigned short number) { return s1 += (uint64) number; } JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const long number) { return s1 += String (number); } JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const unsigned long number) { return s1 += String (number); } JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const int64 number) { return s1 += String (number); } @@ -879,7 +878,7 @@ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const Str JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, StringRef text) { - const size_t numBytes = CharPointer_UTF8::getBytesRequiredFor (text.text); + auto numBytes = CharPointer_UTF8::getBytesRequiredFor (text.text); #if (JUCE_STRING_UTF_TYPE == 8) stream.write (text.text.getAddress(), numBytes); diff --git a/modules/juce_graphics/fonts/juce_Font.cpp b/modules/juce_graphics/fonts/juce_Font.cpp index 5b1b85aaca..24a8762179 100644 --- a/modules/juce_graphics/fonts/juce_Font.cpp +++ b/modules/juce_graphics/fonts/juce_Font.cpp @@ -326,7 +326,7 @@ struct FontPlaceholderNames regular { "" }; }; -const FontPlaceholderNames& getFontPlaceholderNames() +static const FontPlaceholderNames& getFontPlaceholderNames() { static FontPlaceholderNames names; return names; diff --git a/modules/juce_graphics/native/juce_mac_IconHelpers.cpp b/modules/juce_graphics/native/juce_mac_IconHelpers.cpp index 03aa559c5e..5f449253c0 100644 --- a/modules/juce_graphics/native/juce_mac_IconHelpers.cpp +++ b/modules/juce_graphics/native/juce_mac_IconHelpers.cpp @@ -27,7 +27,9 @@ namespace juce { -Image getIconFromIcnsFile (const File& icnsFile, const int size) +extern Image JUCE_API getIconFromApplication (const String&, int); + +static Image getIconFromIcnsFile (const File& icnsFile, const int size) { FileInputStream stream (icnsFile); diff --git a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp index 7ab23c3edd..7316497e9b 100644 --- a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp +++ b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp @@ -59,7 +59,7 @@ static uint32 splashDisplayTime = 0; static bool appUsageReported = false; -Rectangle getLogoArea (Rectangle parentRect) +static Rectangle getLogoArea (Rectangle parentRect) { return parentRect.reduced (6.0f) .removeFromRight ((float) splashScreenLogoWidth) diff --git a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm index b29e2f97eb..e38e3dd292 100644 --- a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm +++ b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm @@ -787,8 +787,8 @@ void juce_initialiseMacMainMenu() } // (used from other modules that need to create an NSMenu) -NSMenu* createNSMenu (const PopupMenu& menu, const String& name, - int topLevelMenuId, int topLevelIndex, bool addDelegate) +NSMenu* createNSMenu (const PopupMenu&, const String&, int, int, bool); +NSMenu* createNSMenu (const PopupMenu& menu, const String& name, int topLevelMenuId, int topLevelIndex, bool addDelegate) { juce_initialiseMacMainMenu(); diff --git a/modules/juce_gui_basics/native/juce_mac_Windowing.mm b/modules/juce_gui_basics/native/juce_mac_Windowing.mm index 166cb8ab26..a35844e94c 100644 --- a/modules/juce_gui_basics/native/juce_mac_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_mac_Windowing.mm @@ -164,7 +164,7 @@ static NSRect getDragRect (NSView* view, NSEvent* event) fromView: nil]; } -NSView* getNSViewForDragEvent (Component* sourceComp) +static NSView* getNSViewForDragEvent (Component* sourceComp) { if (sourceComp == nullptr) if (auto* draggingSource = Desktop::getInstance().getDraggingMouseSource(0)) @@ -558,6 +558,7 @@ static Image createNSWindowSnapshot (NSWindow* nsWindow) } } +Image createSnapshotOfNativeWindow (void*); Image createSnapshotOfNativeWindow (void* nativeWindowHandle) { if (id windowOrView = (id) nativeWindowHandle) diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 45c81f45d6..695d2fd0aa 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -617,6 +617,7 @@ private: }; //============================================================================== +Image createSnapshotOfNativeWindow (void*); Image createSnapshotOfNativeWindow (void* nativeWindowHandle) { auto hwnd = (HWND) nativeWindowHandle;