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

Warnings: Fix missing-prototypes warnings

This commit is contained in:
reuk 2022-04-11 13:30:46 +01:00
parent 3bf635e004
commit 19ddbe2368
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
38 changed files with 133 additions and 75 deletions

View file

@ -25,7 +25,7 @@ elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQU
-Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare
-Wint-conversion -Wconditional-uninitialized -Wconstant-conversion
-Wsign-conversion -Wbool-conversion -Wextra-semi -Wunreachable-code
-Wcast-align -Wshift-sign-overflow
-Wcast-align -Wshift-sign-overflow -Wmissing-prototypes
-Wnullable-to-nonnull-conversion -Wno-ignored-qualifiers -Wswitch-enum
-Wpedantic -Wdeprecated
$<$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:OBJCXX>>:

View file

@ -856,7 +856,8 @@ ProjectExporter::BuildConfiguration::BuildConfiguration (Project& p, const Value
"-Wshorten-64-to-32", "-Wconversion", "-Wint-conversion",
"-Wconditional-uninitialized", "-Wconstant-conversion", "-Wbool-conversion",
"-Wextra-semi", "-Wshift-sign-overflow",
"-Wshadow-all", "-Wnullable-to-nonnull-conversion"
"-Wshadow-all", "-Wnullable-to-nonnull-conversion",
"-Wmissing-prototypes"
});
llvmFlags.cpp.addArray ({
"-Wunused-private-field", "-Winconsistent-missing-destructor-override"

View file

@ -25,7 +25,7 @@ namespace juce
namespace SampleRateHelpers
{
const auto& getAllSampleRates()
static inline const std::vector<double>& getAllSampleRates()
{
static auto sampleRates = []
{

View file

@ -1416,6 +1416,7 @@ private:
};
//==============================================================================
pthread_t juce_createRealtimeAudioThread (void* (*entry) (void*), void* userPtr);
pthread_t juce_createRealtimeAudioThread (void* (*entry) (void*), void* userPtr)
{
auto thread = std::make_unique<OboeRealtimeThread>();

View file

@ -1273,6 +1273,7 @@ private:
};
//==============================================================================
pthread_t juce_createRealtimeAudioThread (void* (*entry) (void*), void* userPtr);
pthread_t juce_createRealtimeAudioThread (void* (*entry) (void*), void* userPtr)
{
auto thread = std::make_unique<SLRealtimeThread>();

View file

@ -1287,12 +1287,12 @@ private:
}
//==============================================================================
AudioIODeviceType* createAudioIODeviceType_ALSA_Soundcards()
static inline AudioIODeviceType* createAudioIODeviceType_ALSA_Soundcards()
{
return new ALSAAudioIODeviceType (true, "ALSA HW");
}
AudioIODeviceType* createAudioIODeviceType_ALSA_PCMDevices()
static inline AudioIODeviceType* createAudioIODeviceType_ALSA_PCMDevices()
{
return new ALSAAudioIODeviceType (false, "ALSA");
}

View file

@ -130,7 +130,7 @@ namespace juce
//==============================================================================
namespace DSoundLogging
{
String getErrorMessage (HRESULT hr)
static String getErrorMessage (HRESULT hr)
{
const char* result = nullptr;

View file

@ -33,7 +33,7 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wlanguage-extension-token")
namespace WasapiClasses
{
void logFailure (HRESULT hr)
static void logFailure (HRESULT hr)
{
ignoreUnused (hr);
jassert (hr != (HRESULT) 0x800401f0); // If you hit this, it means you're trying to call from
@ -89,7 +89,7 @@ void logFailure (HRESULT hr)
#undef check
bool check (HRESULT hr)
static bool check (HRESULT hr)
{
logFailure (hr);
return SUCCEEDED (hr);
@ -361,7 +361,7 @@ namespace juce
namespace WasapiClasses
{
String getDeviceID (IMMDevice* device)
static String getDeviceID (IMMDevice* device)
{
String s;
WCHAR* deviceId = nullptr;

View file

@ -2046,9 +2046,13 @@ private:
//==============================================================================
#if JUCE_IOS
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes")
bool JUCE_CALLTYPE juce_isInterAppAudioConnected() { return false; }
void JUCE_CALLTYPE juce_switchToHostApplication() {}
Image JUCE_CALLTYPE juce_getIAAHostIcon (int) { return {}; }
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#endif
JUCE_END_IGNORE_WARNINGS_GCC_LIKE

View file

@ -60,7 +60,10 @@
#else
#if _MSC_VER
short __stdcall NewPlugIn (void*);
short __stdcall NewPlugIn (void*) { return 0; }
short __stdcall _PI_GetRoutineDescriptor (long, void*);
short __stdcall _PI_GetRoutineDescriptor (long, void*) { return 0; }
#endif

View file

@ -132,6 +132,8 @@ protected:
#if JucePlugin_Build_Standalone && JUCE_IOS
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes")
using namespace juce;
bool JUCE_CALLTYPE juce_isInterAppAudioConnected()
@ -155,6 +157,9 @@ Image JUCE_CALLTYPE juce_getIAAHostIcon (int size)
return Image();
}
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#endif
#endif

View file

@ -279,7 +279,7 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (UnityPeer)
};
ComponentPeer* createUnityPeer (Component& c) { return new UnityPeer (c); }
static ComponentPeer* createUnityPeer (Component& c) { return new UnityPeer (c); }
//==============================================================================
class AudioProcessorUnityWrapper
@ -486,7 +486,7 @@ private:
};
//==============================================================================
HashMap<int, AudioProcessorUnityWrapper*>& getWrapperMap()
static HashMap<int, AudioProcessorUnityWrapper*>& getWrapperMap()
{
static HashMap<int, AudioProcessorUnityWrapper*> wrapperMap;
return wrapperMap;
@ -505,7 +505,7 @@ static void onWrapperDeletion (AudioProcessorUnityWrapper* wrapperToRemove)
//==============================================================================
namespace UnityCallbacks
{
int UNITY_INTERFACE_API createCallback (UnityAudioEffectState* state)
static int UNITY_INTERFACE_API createCallback (UnityAudioEffectState* state)
{
auto* pluginInstance = new AudioProcessorUnityWrapper (false);
pluginInstance->create (state);
@ -517,7 +517,7 @@ namespace UnityCallbacks
return 0;
}
int UNITY_INTERFACE_API releaseCallback (UnityAudioEffectState* state)
static int UNITY_INTERFACE_API releaseCallback (UnityAudioEffectState* state)
{
auto* pluginInstance = state->getEffectData<AudioProcessorUnityWrapper>();
pluginInstance->release();
@ -531,7 +531,7 @@ namespace UnityCallbacks
return 0;
}
int UNITY_INTERFACE_API resetCallback (UnityAudioEffectState* state)
static int UNITY_INTERFACE_API resetCallback (UnityAudioEffectState* state)
{
auto* pluginInstance = state->getEffectData<AudioProcessorUnityWrapper>();
pluginInstance->reset();
@ -539,14 +539,14 @@ namespace UnityCallbacks
return 0;
}
int UNITY_INTERFACE_API setPositionCallback (UnityAudioEffectState* state, unsigned int pos)
static int UNITY_INTERFACE_API setPositionCallback (UnityAudioEffectState* state, unsigned int pos)
{
ignoreUnused (state, pos);
return 0;
}
int UNITY_INTERFACE_API setFloatParameterCallback (UnityAudioEffectState* state, int index, float value)
static int UNITY_INTERFACE_API setFloatParameterCallback (UnityAudioEffectState* state, int index, float value)
{
auto* pluginInstance = state->getEffectData<AudioProcessorUnityWrapper>();
pluginInstance->setParameter (index, value);
@ -554,7 +554,7 @@ namespace UnityCallbacks
return 0;
}
int UNITY_INTERFACE_API getFloatParameterCallback (UnityAudioEffectState* state, int index, float* value, char* valueStr)
static int UNITY_INTERFACE_API getFloatParameterCallback (UnityAudioEffectState* state, int index, float* value, char* valueStr)
{
auto* pluginInstance = state->getEffectData<AudioProcessorUnityWrapper>();
*value = pluginInstance->getParameter (index);
@ -564,7 +564,7 @@ namespace UnityCallbacks
return 0;
}
int UNITY_INTERFACE_API getFloatBufferCallback (UnityAudioEffectState* state, const char* name, float* buffer, int numSamples)
static int UNITY_INTERFACE_API getFloatBufferCallback (UnityAudioEffectState* state, const char* name, float* buffer, int numSamples)
{
ignoreUnused (numSamples);
@ -608,7 +608,7 @@ namespace UnityCallbacks
return 0;
}
int UNITY_INTERFACE_API processCallback (UnityAudioEffectState* state, float* inBuffer, float* outBuffer,
static int UNITY_INTERFACE_API processCallback (UnityAudioEffectState* state, float* inBuffer, float* outBuffer,
unsigned int bufferSize, int numInChannels, int numOutChannels)
{
auto* pluginInstance = state->getEffectData<AudioProcessorUnityWrapper>();
@ -769,6 +769,8 @@ UNITY_INTERFACE_EXPORT void UNITY_INTERFACE_API unitySetScreenBounds (int id, fl
//==============================================================================
#if JUCE_WINDOWS
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes")
extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID)
{
if (reason == DLL_PROCESS_ATTACH)
@ -776,6 +778,8 @@ UNITY_INTERFACE_EXPORT void UNITY_INTERFACE_API unitySetScreenBounds (int id, fl
return true;
}
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#endif
#endif

View file

@ -2146,6 +2146,8 @@ namespace
#define JUCE_EXPORTED_FUNCTION extern "C" __attribute__ ((visibility("default")))
#endif
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes")
//==============================================================================
// Mac startup code..
#if JUCE_MAC
@ -2221,6 +2223,8 @@ namespace
}
#endif
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
JUCE_END_IGNORE_WARNINGS_MSVC
#endif

View file

@ -285,7 +285,7 @@ static QueryInterfaceResult queryAdditionalInterfaces (AudioProcessor* processor
return {};
}
tresult extractResult (const QueryInterfaceResult& userInterface,
static tresult extractResult (const QueryInterfaceResult& userInterface,
const InterfaceResultWithDeferredAddRef& juceInterface,
void** obj)
{
@ -3481,8 +3481,12 @@ bool shutdownModule()
#endif
#if JUCE_WINDOWS
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes")
extern "C" __declspec (dllexport) bool InitDll() { return initModule(); }
extern "C" __declspec (dllexport) bool ExitDll() { return shutdownModule(); }
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#elif JUCE_LINUX || JUCE_BSD
void* moduleHandle = nullptr;
int moduleEntryCounter = 0;
@ -3859,7 +3863,11 @@ extern "C" SMTG_EXPORT_SYMBOL IPluginFactory* PLUGIN_API GetPluginFactory()
//==============================================================================
#if JUCE_WINDOWS
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes")
extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID) { if (reason == DLL_PROCESS_ATTACH) Process::setCurrentModuleInstanceHandle (instance); return true; }
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#endif
JUCE_END_NO_SANITIZE

View file

@ -18,11 +18,6 @@
#pragma once
/** 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.
*/
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter();
namespace juce
{

View file

@ -28,6 +28,7 @@ namespace juce
{
#if JucePlugin_Build_Unity
bool juce_isRunningInUnity();
bool juce_isRunningInUnity() { return PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_Unity; }
#endif
@ -124,6 +125,7 @@ namespace juce
#endif
#if JucePlugin_Build_VST
bool JUCE_API handleManufacturerSpecificVST2Opcode (int32 index, pointer_sized_int value, void* ptr, float);
bool JUCE_API handleManufacturerSpecificVST2Opcode (int32 index, pointer_sized_int value, void* ptr, float)
{
#if VST3_REPLACEMENT_AVAILABLE

View file

@ -137,7 +137,7 @@ private:
};
//==============================================================================
std::array<uint32, 4> getNormalisedTUID (const TUID& tuid) noexcept
static std::array<uint32, 4> getNormalisedTUID (const TUID& tuid) noexcept
{
const FUID fuid { tuid };
return { { fuid.getLong1(), fuid.getLong2(), fuid.getLong3(), fuid.getLong4() } };

View file

@ -142,3 +142,8 @@
#include "utilities/juce_ParameterAttachments.h"
#include "utilities/juce_AudioProcessorValueTreeState.h"
#include "utilities/juce_PluginHostType.h"
// This is here to avoid missing-prototype warnings in user code.
// If you're implementing a plugin, you should supply a body for
// this function in your own code.
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter();

View file

@ -479,7 +479,7 @@ struct AndroidContentUriOutputStream : public OutputStream
int64 pos = 0;
};
OutputStream* juce_CreateContentURIOutputStream (const URL& url)
static OutputStream* juce_CreateContentURIOutputStream (const URL& url)
{
auto stream = AndroidContentUriResolver::getStreamForContentUri (url, false);

View file

@ -246,6 +246,7 @@ static LocalRef<jobject> getMulticastLock()
return multicastLock;
}
JUCE_API void JUCE_CALLTYPE acquireMulticastLock();
JUCE_API void JUCE_CALLTYPE acquireMulticastLock()
{
auto multicastLock = getMulticastLock();
@ -254,6 +255,7 @@ JUCE_API void JUCE_CALLTYPE acquireMulticastLock()
getEnv()->CallVoidMethod (multicastLock.get(), AndroidMulticastLock.acquire);
}
JUCE_API void JUCE_CALLTYPE releaseMulticastLock();
JUCE_API void JUCE_CALLTYPE releaseMulticastLock()
{
auto multicastLock = getMulticastLock();

View file

@ -56,7 +56,7 @@ JNIEnv* getEnv() noexcept
return nullptr;
}
void JNICALL juce_JavainitialiseJUCE (JNIEnv* env, jobject /*jclass*/, jobject context)
static void JNICALL juce_JavainitialiseJUCE (JNIEnv* env, jobject /*jclass*/, jobject context)
{
Thread::initialiseJUCE (env, context);
}

View file

@ -64,12 +64,12 @@ namespace WindowsFileHelpers
#endif
//==============================================================================
DWORD getAtts (const String& path) noexcept
static DWORD getAtts (const String& path) noexcept
{
return GetFileAttributes (path.toWideCharPointer());
}
bool changeAtts (const String& path, DWORD bitsToSet, DWORD bitsToClear) noexcept
static bool changeAtts (const String& path, DWORD bitsToSet, DWORD bitsToClear) noexcept
{
auto oldAtts = getAtts (path);
@ -82,7 +82,7 @@ namespace WindowsFileHelpers
|| SetFileAttributes (path.toWideCharPointer(), newAtts) != FALSE;
}
int64 fileTimeToTime (const FILETIME* const ft) noexcept
static int64 fileTimeToTime (const FILETIME* const ft) noexcept
{
static_assert (sizeof (ULARGE_INTEGER) == sizeof (FILETIME),
"ULARGE_INTEGER is too small to hold FILETIME: please report!");
@ -90,7 +90,7 @@ namespace WindowsFileHelpers
return (int64) ((reinterpret_cast<const ULARGE_INTEGER*> (ft)->QuadPart - 116444736000000000LL) / 10000);
}
FILETIME* timeToFileTime (const int64 time, FILETIME* const ft) noexcept
static FILETIME* timeToFileTime (const int64 time, FILETIME* const ft) noexcept
{
if (time <= 0)
return nullptr;
@ -99,7 +99,7 @@ namespace WindowsFileHelpers
return ft;
}
String getDriveFromPath (String path)
static String getDriveFromPath (String path)
{
if (path.isNotEmpty() && path[1] == ':' && path[2] == 0)
path << '\\';
@ -115,7 +115,7 @@ namespace WindowsFileHelpers
return path;
}
int64 getDiskSpaceInfo (const String& path, const bool total)
static int64 getDiskSpaceInfo (const String& path, const bool total)
{
ULARGE_INTEGER spc, tot, totFree;
@ -126,12 +126,12 @@ namespace WindowsFileHelpers
return 0;
}
unsigned int getWindowsDriveType (const String& path)
static unsigned int getWindowsDriveType (const String& path)
{
return GetDriveType (getDriveFromPath (path).toWideCharPointer());
}
File getSpecialFolderPath (int type)
static File getSpecialFolderPath (int type)
{
WCHAR path[MAX_PATH + 256];
@ -141,7 +141,7 @@ namespace WindowsFileHelpers
return {};
}
File getModuleFileName (HINSTANCE moduleHandle)
static File getModuleFileName (HINSTANCE moduleHandle)
{
WCHAR dest[MAX_PATH + 256];
dest[0] = 0;
@ -149,7 +149,7 @@ namespace WindowsFileHelpers
return File (String (dest));
}
Result getResultForLastError()
static Result getResultForLastError()
{
TCHAR messageBuffer[256] = {};
@ -159,7 +159,7 @@ namespace WindowsFileHelpers
return Result::fail (String (messageBuffer));
}
}
} // namespace WindowsFileHelpers
//==============================================================================
#if JUCE_ALLOW_STATIC_NULL_VARIABLES

View file

@ -214,6 +214,7 @@ static DebugFlagsInitialiser debugFlagsInitialiser;
return 0;
}
#else
RTL_OSVERSIONINFOW getWindowsVersionInfo();
RTL_OSVERSIONINFOW getWindowsVersionInfo()
{
RTL_OSVERSIONINFOW versionInfo = {};

View file

@ -197,6 +197,7 @@ static int lastProcessPriority = -1;
// called when the app gains focus because Windows does weird things to process priority
// when you swap apps, and this forces an update when the app is brought to the front.
void juce_repeatLastProcessPriority();
void juce_repeatLastProcessPriority()
{
if (lastProcessPriority >= 0) // (avoid changing this if it's not been explicitly set by the app..)
@ -265,6 +266,7 @@ void JUCE_CALLTYPE Process::terminate()
ExitProcess (1);
}
bool juce_isRunningInWine();
bool juce_isRunningInWine()
{
HMODULE ntdll = GetModuleHandleA ("ntdll");

View file

@ -790,10 +790,6 @@ std::unique_ptr<InputStream> URL::createInputStream (const InputStreamOptions& o
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
}
#if JUCE_ANDROID
OutputStream* juce_CreateContentURIOutputStream (const URL&);
#endif
std::unique_ptr<OutputStream> URL::createOutputStream() const
{
if (isLocalFile())

View file

@ -288,6 +288,7 @@ private:
//==============================================================================
File juce_getExecutableFile();
void juce_juceEventsAndroidStartApp();
void juce_juceEventsAndroidStartApp()
{
auto dllPath = juce_getExecutableFile().getFullPathName();

View file

@ -236,13 +236,13 @@ namespace LinuxErrorHandling
{
static bool keyboardBreakOccurred = false;
void keyboardBreakSignalHandler (int sig)
static void keyboardBreakSignalHandler (int sig)
{
if (sig == SIGINT)
keyboardBreakOccurred = true;
}
void installKeyboardBreakHandler()
static void installKeyboardBreakHandler()
{
struct sigaction saction;
sigset_t maskSet;
@ -324,6 +324,7 @@ void LinuxEventLoop::unregisterFdCallback (int fd)
} // namespace juce
JUCE_API std::vector<std::pair<int, std::function<void (int)>>> getFdReadCallbacks();
JUCE_API std::vector<std::pair<int, std::function<void (int)>>> getFdReadCallbacks()
{
using namespace juce;

View file

@ -21,7 +21,7 @@ namespace juce
namespace GraphicsHelpers
{
LocalRef<jobject> createPaint (Graphics::ResamplingQuality quality)
static LocalRef<jobject> createPaint (Graphics::ResamplingQuality quality)
{
jint constructorFlags = 1 /*ANTI_ALIAS_FLAG*/
| 4 /*DITHER_FLAG*/
@ -33,7 +33,7 @@ namespace GraphicsHelpers
return LocalRef<jobject>(getEnv()->NewObject (AndroidPaint, AndroidPaint.constructor, constructorFlags));
}
const LocalRef<jobject> createMatrix (JNIEnv* env, const AffineTransform& t)
static LocalRef<jobject> createMatrix (JNIEnv* env, const AffineTransform& t)
{
auto m = LocalRef<jobject>(env->NewObject (AndroidMatrix, AndroidMatrix.constructor));
@ -49,7 +49,7 @@ namespace GraphicsHelpers
return m;
}
}
} // namespace GraphicsHelpers
ImagePixelData::Ptr NativeImageType::create (Image::PixelFormat format, int width, int height, bool clearImage) const
{

View file

@ -18,5 +18,6 @@
namespace juce
{
Image JUCE_API getIconFromApplication (const String&, int);
Image JUCE_API getIconFromApplication (const String&, int) { return {}; }
}

View file

@ -18,5 +18,6 @@
namespace juce
{
Image JUCE_API getIconFromApplication (const String&, int);
Image JUCE_API getIconFromApplication (const String&, int) { return {}; }
}

View file

@ -222,7 +222,7 @@ namespace DirectWriteTypeLayout
return dwFontMetrics.designUnitsPerEm / totalHeight;
}
void setTextFormatProperties (const AttributedString& text, IDWriteTextFormat& format)
static void setTextFormatProperties (const AttributedString& text, IDWriteTextFormat& format)
{
DWRITE_TEXT_ALIGNMENT alignment = DWRITE_TEXT_ALIGNMENT_LEADING;
DWRITE_WORD_WRAPPING wrapType = DWRITE_WORD_WRAPPING_WRAP;
@ -264,7 +264,7 @@ namespace DirectWriteTypeLayout
format.SetWordWrapping (wrapType);
}
void addAttributedRange (const AttributedString::Attribute& attr,
static void addAttributedRange (const AttributedString::Attribute& attr,
IDWriteTextLayout& textLayout,
CharPointer_UTF16 begin,
CharPointer_UTF16 textPointer,
@ -330,9 +330,13 @@ namespace DirectWriteTypeLayout
}
}
bool setupLayout (const AttributedString& text, float maxWidth, float maxHeight,
ID2D1RenderTarget& renderTarget, IDWriteFactory& directWriteFactory,
IDWriteFontCollection& fontCollection, ComSmartPtr<IDWriteTextLayout>& textLayout)
static bool setupLayout (const AttributedString& text,
float maxWidth,
float maxHeight,
ID2D1RenderTarget& renderTarget,
IDWriteFactory& directWriteFactory,
IDWriteFontCollection& fontCollection,
ComSmartPtr<IDWriteTextLayout>& textLayout)
{
// To add color to text, we need to create a D2D render target
// Since we are not actually rendering to a D2D context we create a temporary GDI render target
@ -396,7 +400,8 @@ namespace DirectWriteTypeLayout
return true;
}
void createLayout (TextLayout& layout, const AttributedString& text,
static void createLayout (TextLayout& layout,
const AttributedString& text,
IDWriteFactory& directWriteFactory,
IDWriteFontCollection& fontCollection,
ID2D1DCRenderTarget& renderTarget)
@ -435,8 +440,11 @@ namespace DirectWriteTypeLayout
}
}
void drawToD2DContext (const AttributedString& text, const Rectangle<float>& area, ID2D1RenderTarget& renderTarget,
IDWriteFactory& directWriteFactory, IDWriteFontCollection& fontCollection)
static inline void drawToD2DContext (const AttributedString& text,
const Rectangle<float>& area,
ID2D1RenderTarget& renderTarget,
IDWriteFactory& directWriteFactory,
IDWriteFontCollection& fontCollection)
{
ComSmartPtr<IDWriteTextLayout> dwTextLayout;

View file

@ -18,5 +18,6 @@
namespace juce
{
Image JUCE_API getIconFromApplication (const String&, int);
Image JUCE_API getIconFromApplication (const String&, int) { return {}; }
}

View file

@ -277,12 +277,12 @@ void AccessibilityHandler::postAnnouncement (const String& announcementString, A
//==============================================================================
namespace WindowsAccessibility
{
long getUiaRootObjectId()
static long getUiaRootObjectId()
{
return static_cast<long> (UiaRootObjectId);
}
bool handleWmGetObject (AccessibilityHandler* handler, WPARAM wParam, LPARAM lParam, LRESULT* res)
static bool handleWmGetObject (AccessibilityHandler* handler, WPARAM wParam, LPARAM lParam, LRESULT* res)
{
if (isStartingUpOrShuttingDown() || (handler == nullptr || ! isHandlerValid (*handler)))
return false;
@ -301,7 +301,7 @@ namespace WindowsAccessibility
return false;
}
void revokeUIAMapEntriesForWindow (HWND hwnd)
static void revokeUIAMapEntriesForWindow (HWND hwnd)
{
if (auto* uiaWrapper = WindowsUIAWrapper::getInstanceWithoutCreating())
uiaWrapper->returnRawElementProvider (hwnd, 0, 0, nullptr);

View file

@ -892,12 +892,14 @@ Image juce_createIconForFile (const File&)
return {};
}
void juce_LinuxAddRepaintListener (ComponentPeer* peer, Component* dummy);
void juce_LinuxAddRepaintListener (ComponentPeer* peer, Component* dummy)
{
if (auto* linuxPeer = dynamic_cast<LinuxComponentPeer*> (peer))
linuxPeer->addOpenGLRepaintListener (dummy);
}
void juce_LinuxRemoveRepaintListener (ComponentPeer* peer, Component* dummy);
void juce_LinuxRemoveRepaintListener (ComponentPeer* peer, Component* dummy)
{
if (auto* linuxPeer = dynamic_cast<LinuxComponentPeer*> (peer))

View file

@ -205,7 +205,7 @@ namespace DragAndDropHelpers
};
//==============================================================================
HDROP createHDrop (const StringArray& fileNames)
static HDROP createHDrop (const StringArray& fileNames)
{
size_t totalBytes = 0;
for (int i = fileNames.size(); --i >= 0;)

View file

@ -54,7 +54,7 @@ void* getUser32Function (const char*);
#if JUCE_DEBUG
int numActiveScopedDpiAwarenessDisablers = 0;
bool isInScopedDPIAwarenessDisabler() { return numActiveScopedDpiAwarenessDisablers > 0; }
static bool isInScopedDPIAwarenessDisabler() { return numActiveScopedDpiAwarenessDisablers > 0; }
extern HWND juce_messageWindowHandle;
#endif
@ -642,6 +642,7 @@ static Point<int> convertLogicalScreenPointToPhysical (Point<int> p, HWND h) noe
return p;
}
JUCE_API double getScaleFactorForWindow (HWND h);
JUCE_API double getScaleFactorForWindow (HWND h)
{
// NB. Using a local function here because we need to call this method from the plug-in wrappers
@ -823,6 +824,7 @@ Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
return upright;
}
int64 getMouseEventTime();
int64 getMouseEventTime()
{
static int64 eventTimeOffset = 0;
@ -1095,7 +1097,7 @@ Image createSnapshotOfNativeWindow (void* nativeWindowHandle)
//==============================================================================
namespace IconConverters
{
Image createImageFromHICON (HICON icon)
static Image createImageFromHICON (HICON icon)
{
if (icon == nullptr)
return {};
@ -1203,6 +1205,7 @@ namespace IconConverters
return {};
}
HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY);
HICON createHICONFromImage (const Image& image, const BOOL isIcon, int hotspotX, int hotspotY)
{
auto nativeBitmap = new WindowsBitmapImage (Image::ARGB, image.getWidth(), image.getHeight(), true);
@ -1226,7 +1229,7 @@ namespace IconConverters
DeleteObject (mask);
return hi;
}
}
} // namespace IconConverters
//==============================================================================
JUCE_IUNKNOWNCLASS (ITipInvocation, "37c994e7-432b-4834-a2f7-dce1f13b834b")
@ -4403,6 +4406,7 @@ ComponentPeer* Component::createNewPeer (int styleFlags, void* parentHWND)
return new HWNDComponentPeer (*this, styleFlags, (HWND) parentHWND, false);
}
JUCE_API ComponentPeer* createNonRepaintingEmbeddedWindowsPeer (Component& component, void* parentHWND);
JUCE_API ComponentPeer* createNonRepaintingEmbeddedWindowsPeer (Component& component, void* parentHWND)
{
return new HWNDComponentPeer (component, ComponentPeer::windowIgnoresMouseClicks,
@ -4442,6 +4446,7 @@ bool KeyPress::isKeyCurrentlyDown (const int keyCode)
}
// (This internal function is used by the plugin client module)
bool offerKeyMessageToJUCEWindow (MSG& m);
bool offerKeyMessageToJUCEWindow (MSG& m) { return HWNDComponentPeer::offerKeyMessageToJUCEWindow (m); }
//==============================================================================

View file

@ -559,6 +559,7 @@ enum
{
static int trappedErrorCode = 0;
extern "C" int errorTrapHandler (Display*, XErrorEvent* err);
extern "C" int errorTrapHandler (Display*, XErrorEvent* err)
{
trappedErrorCode = err->error_code;
@ -3213,11 +3214,13 @@ void XWindowSystem::destroyXDisplay()
}
//==============================================================================
::Window juce_createKeyProxyWindow (ComponentPeer* peer);
::Window juce_createKeyProxyWindow (ComponentPeer* peer)
{
return XWindowSystem::getInstance()->createKeyProxy ((::Window) peer->getNativeHandle());
}
void juce_deleteKeyProxyWindow (::Window keyProxy);
void juce_deleteKeyProxyWindow (::Window keyProxy)
{
XWindowSystem::getInstance()->deleteKeyProxy (keyProxy);

View file

@ -478,6 +478,7 @@ intptr_t ActiveXControlComponent::offerEventToActiveXControlStatic (void* ptr)
return S_FALSE;
}
LRESULT juce_offerEventToActiveXControl (::MSG& msg);
LRESULT juce_offerEventToActiveXControl (::MSG& msg)
{
if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST)