Browse Source

Tidied up some more old typedefs

tags/2021-05-28
jules 7 years ago
parent
commit
87042769b6
16 changed files with 32 additions and 37 deletions
  1. +1
    -1
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  2. +1
    -1
      modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  3. +1
    -1
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  4. +1
    -1
      modules/juce_core/containers/juce_HashMap.h
  5. +1
    -1
      modules/juce_core/maths/juce_MathsFunctions.h
  6. +1
    -1
      modules/juce_core/memory/juce_Atomic.h
  7. +3
    -3
      modules/juce_core/threads/juce_CriticalSection.h
  8. +2
    -2
      modules/juce_dsp/containers/juce_SIMDRegister_Impl.h
  9. +1
    -1
      modules/juce_events/messages/juce_MessageManager.h
  10. +3
    -3
      modules/juce_events/native/juce_mac_MessageManager.mm
  11. +9
    -10
      modules/juce_events/native/juce_win32_Messaging.cpp
  12. +1
    -1
      modules/juce_graphics/fonts/juce_Font.cpp
  13. +1
    -1
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp
  14. +1
    -1
      modules/juce_gui_basics/native/juce_mac_MainMenu.mm
  15. +3
    -7
      modules/juce_gui_extra/misc/juce_LiveConstantEditor.h
  16. +2
    -2
      modules/juce_osc/osc/juce_OSCTypes.h

+ 1
- 1
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -2531,7 +2531,7 @@ bool shutdownModule()
//============================================================================== //==============================================================================
/** This typedef represents VST3's createInstance() function signature */ /** This typedef represents VST3's createInstance() function signature */
typedef FUnknown* (*CreateFunction) (Vst::IHostApplication*);
using CreateFunction = FUnknown* (*)(Vst::IHostApplication*);
static FUnknown* createComponentInstance (Vst::IHostApplication* host) static FUnknown* createComponentInstance (Vst::IHostApplication* host)
{ {


+ 1
- 1
modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -1142,7 +1142,7 @@ private:
if (CFBundleLoadExecutableAndReturnError (bundleRef, &error)) if (CFBundleLoadExecutableAndReturnError (bundleRef, &error))
{ {
typedef bool (*BundleEntryProc)(CFBundleRef);
using BundleEntryProc = bool (*)(CFBundleRef);
if (auto proc = (BundleEntryProc) getFunction ("bundleEntry")) if (auto proc = (BundleEntryProc) getFunction ("bundleEntry"))
{ {


+ 1
- 1
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -226,7 +226,7 @@ static pointer_sized_int VSTINTERFACECALL audioMaster (VstEffectInterface*, int3
namespace namespace
{ {
typedef void (*EventProcPtr) (XEvent* ev);
using EventProcPtr = void (*)(XEvent*);
Window getChildWindow (Window windowToCheck) Window getChildWindow (Window windowToCheck)
{ {


+ 1
- 1
modules/juce_core/containers/juce_HashMap.h View File

@@ -354,7 +354,7 @@ public:
inline const TypeOfCriticalSectionToUse& getLock() const noexcept { return lock; } inline const TypeOfCriticalSectionToUse& getLock() const noexcept { return lock; }
/** Returns the type of scoped lock to use for locking this array */ /** Returns the type of scoped lock to use for locking this array */
typedef typename TypeOfCriticalSectionToUse::ScopedLockType ScopedLockType;
using ScopedLockType = typename TypeOfCriticalSectionToUse::ScopedLockType;
private: private:
//============================================================================== //==============================================================================


+ 1
- 1
modules/juce_core/maths/juce_MathsFunctions.h View File

@@ -42,7 +42,7 @@ using uint16 = unsigned short;
/** A platform-independent 32-bit signed integer type. */ /** A platform-independent 32-bit signed integer type. */
using int32 = signed int; using int32 = signed int;
/** A platform-independent 32-bit unsigned integer type. */ /** A platform-independent 32-bit unsigned integer type. */
typedef unsigned int uint32;
using uint32 = unsigned int;
#if JUCE_MSVC #if JUCE_MSVC
/** A platform-independent 64-bit integer type. */ /** A platform-independent 64-bit integer type. */


+ 1
- 1
modules/juce_core/memory/juce_Atomic.h View File

@@ -40,7 +40,7 @@ namespace juce
template <typename Type> template <typename Type>
struct Atomic final struct Atomic final
{ {
typedef typename AtomicHelpers::DiffTypeHelper<Type>::Type DiffType;
using DiffType = typename AtomicHelpers::DiffTypeHelper<Type>::Type;
/** Creates a new value, initialised to zero. */ /** Creates a new value, initialised to zero. */
Atomic() noexcept : value (0) {} Atomic() noexcept : value (0) {}


+ 3
- 3
modules/juce_core/threads/juce_CriticalSection.h View File

@@ -183,7 +183,7 @@ private:
@see CriticalSection, ScopedUnlock @see CriticalSection, ScopedUnlock
*/ */
typedef CriticalSection::ScopedLockType ScopedLock;
using ScopedLock = CriticalSection::ScopedLockType;
//============================================================================== //==============================================================================
/** /**
@@ -223,7 +223,7 @@ typedef CriticalSection::ScopedLockType ScopedLock;
@see CriticalSection, ScopedLock @see CriticalSection, ScopedLock
*/ */
typedef CriticalSection::ScopedUnlockType ScopedUnlock;
using ScopedUnlock = CriticalSection::ScopedUnlockType;
//============================================================================== //==============================================================================
/** /**
@@ -257,6 +257,6 @@ typedef CriticalSection::ScopedUnlockType ScopedUnlock;
@see CriticalSection::tryEnter, ScopedLock, ScopedUnlock, ScopedReadLock @see CriticalSection::tryEnter, ScopedLock, ScopedUnlock, ScopedReadLock
*/ */
typedef CriticalSection::ScopedTryLockType ScopedTryLock;
using ScopedTryLock = CriticalSection::ScopedTryLockType;
} // namespace juce } // namespace juce

+ 2
- 2
modules/juce_dsp/containers/juce_SIMDRegister_Impl.h View File

@@ -54,7 +54,7 @@ private:
template <typename Scalar> template <typename Scalar>
struct CmplxSIMDOps struct CmplxSIMDOps
{ {
typedef typename SIMDNativeOps<Scalar>::vSIMDType vSIMDType;
using vSIMDType = typename SIMDNativeOps<Scalar>::vSIMDType;
static inline vSIMDType JUCE_VECTOR_CALLTYPE load (const Scalar* a) noexcept static inline vSIMDType JUCE_VECTOR_CALLTYPE load (const Scalar* a) noexcept
{ {
@@ -101,7 +101,7 @@ struct CmplxSIMDOps
template <typename Scalar> template <typename Scalar>
struct CmplxSIMDOps<std::complex<Scalar>> struct CmplxSIMDOps<std::complex<Scalar>>
{ {
typedef typename SIMDNativeOps<Scalar>::vSIMDType vSIMDType;
using vSIMDType = typename SIMDNativeOps<Scalar>::vSIMDType;
static inline vSIMDType JUCE_VECTOR_CALLTYPE load (const std::complex<Scalar>* a) noexcept static inline vSIMDType JUCE_VECTOR_CALLTYPE load (const std::complex<Scalar>* a) noexcept
{ {


+ 1
- 1
modules/juce_events/messages/juce_MessageManager.h View File

@@ -35,7 +35,7 @@ class OpenGLContext;
//============================================================================== //==============================================================================
/** See MessageManager::callFunctionOnMessageThread() for use of this function type. */ /** See MessageManager::callFunctionOnMessageThread() for use of this function type. */
typedef void* (MessageCallbackFunction) (void* userData);
using MessageCallbackFunction = void* (void* userData);
//============================================================================== //==============================================================================


+ 3
- 3
modules/juce_events/native/juce_mac_MessageManager.mm View File

@@ -23,13 +23,13 @@
namespace juce namespace juce
{ {
typedef void (*AppFocusChangeCallback)();
using AppFocusChangeCallback = void (*)();
AppFocusChangeCallback appFocusChangeCallback = nullptr; AppFocusChangeCallback appFocusChangeCallback = nullptr;
typedef bool (*CheckEventBlockedByModalComps) (NSEvent*);
using CheckEventBlockedByModalComps = bool (*)(NSEvent*);
CheckEventBlockedByModalComps isEventBlockedByModalComps = nullptr; CheckEventBlockedByModalComps isEventBlockedByModalComps = nullptr;
typedef void (*MenuTrackingChangedCallback)(bool);
using MenuTrackingChangedCallback = void (*)(bool);
MenuTrackingChangedCallback menuTrackingChangedCallback = nullptr; MenuTrackingChangedCallback menuTrackingChangedCallback = nullptr;
//============================================================================== //==============================================================================


+ 9
- 10
modules/juce_events/native/juce_win32_Messaging.cpp View File

@@ -25,10 +25,10 @@ namespace juce
extern HWND juce_messageWindowHandle; extern HWND juce_messageWindowHandle;
typedef bool (*CheckEventBlockedByModalComps) (const MSG&);
using CheckEventBlockedByModalComps = bool (*)(const MSG&);
CheckEventBlockedByModalComps isEventBlockedByModalComps = nullptr; CheckEventBlockedByModalComps isEventBlockedByModalComps = nullptr;
typedef void (*SettingChangeCallbackFunc) (void);
using SettingChangeCallbackFunc = void (*)(void);
SettingChangeCallbackFunc settingChangeCallback = nullptr; SettingChangeCallbackFunc settingChangeCallback = nullptr;
#if JUCE_MODULE_AVAILABLE_juce_audio_plugin_client && JucePlugin_Build_Unity #if JUCE_MODULE_AVAILABLE_juce_audio_plugin_client && JucePlugin_Build_Unity
@@ -72,7 +72,7 @@ namespace WindowsMessageHelpers
return TRUE; return TRUE;
} }
void handleBroadcastMessage (const COPYDATASTRUCT* const data)
void handleBroadcastMessage (const COPYDATASTRUCT* data)
{ {
if (data != nullptr && data->dwData == broadcastMessageMagicNumber) if (data != nullptr && data->dwData == broadcastMessageMagicNumber)
{ {
@@ -91,7 +91,7 @@ namespace WindowsMessageHelpers
} }
//============================================================================== //==============================================================================
LRESULT CALLBACK messageWndProc (HWND h, const UINT message, const WPARAM wParam, const LPARAM lParam) noexcept
LRESULT CALLBACK messageWndProc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) noexcept
{ {
if (h == juce_messageWindowHandle) if (h == juce_messageWindowHandle)
{ {
@@ -108,11 +108,10 @@ namespace WindowsMessageHelpers
handleBroadcastMessage (reinterpret_cast<const COPYDATASTRUCT*> (lParam)); handleBroadcastMessage (reinterpret_cast<const COPYDATASTRUCT*> (lParam));
return 0; return 0;
} }
else if (message == WM_SETTINGCHANGE)
{
if (message == WM_SETTINGCHANGE)
if (settingChangeCallback != nullptr) if (settingChangeCallback != nullptr)
settingChangeCallback(); settingChangeCallback();
}
} }
return DefWindowProc (h, message, wParam, lParam); return DefWindowProc (h, message, wParam, lParam);
@@ -124,7 +123,7 @@ LRESULT juce_offerEventToActiveXControl (::MSG&);
#endif #endif
//============================================================================== //==============================================================================
bool MessageManager::dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages)
bool MessageManager::dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages)
{ {
using namespace WindowsMessageHelpers; using namespace WindowsMessageHelpers;
MSG m; MSG m;
@@ -134,10 +133,10 @@ bool MessageManager::dispatchNextMessageOnSystemQueue (const bool returnIfNoPend
if (GetMessage (&m, (HWND) 0, 0, 0) >= 0) if (GetMessage (&m, (HWND) 0, 0, 0) >= 0)
{ {
#if JUCE_MODULE_AVAILABLE_juce_gui_extra
#if JUCE_MODULE_AVAILABLE_juce_gui_extra
if (juce_offerEventToActiveXControl (m) != S_FALSE) if (juce_offerEventToActiveXControl (m) != S_FALSE)
return true; return true;
#endif
#endif
if (m.message == customMessageID && m.hwnd == juce_messageWindowHandle) if (m.message == customMessageID && m.hwnd == juce_messageWindowHandle)
{ {


+ 1
- 1
modules/juce_graphics/fonts/juce_Font.cpp View File

@@ -40,7 +40,7 @@ namespace FontValues
String fallbackFontStyle; String fallbackFontStyle;
} }
typedef Typeface::Ptr (*GetTypefaceForFont) (const Font&);
using GetTypefaceForFont = Typeface::Ptr (*)(const Font&);
GetTypefaceForFont juce_getTypefaceForFont = nullptr; GetTypefaceForFont juce_getTypefaceForFont = nullptr;
float Font::getDefaultMinimumHorizontalScaleFactor() noexcept { return FontValues::minimumHorizontalScale; } float Font::getDefaultMinimumHorizontalScaleFactor() noexcept { return FontValues::minimumHorizontalScale; }


+ 1
- 1
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp View File

@@ -32,7 +32,7 @@ static Typeface::Ptr getTypefaceForFontFromLookAndFeel (const Font& font)
return LookAndFeel::getDefaultLookAndFeel().getTypefaceForFont (font); return LookAndFeel::getDefaultLookAndFeel().getTypefaceForFont (font);
} }
typedef Typeface::Ptr (*GetTypefaceForFont) (const Font&);
using GetTypefaceForFont = Typeface::Ptr (*)(const Font&);
extern GetTypefaceForFont juce_getTypefaceForFont; extern GetTypefaceForFont juce_getTypefaceForFont;
//============================================================================== //==============================================================================


+ 1
- 1
modules/juce_gui_basics/native/juce_mac_MainMenu.mm View File

@@ -765,7 +765,7 @@ const PopupMenu* MenuBarModel::getMacExtraAppleItemsMenu()
return nullptr; return nullptr;
} }
typedef void (*MenuTrackingChangedCallback) (bool);
using MenuTrackingChangedCallback = void (*)(bool);
extern MenuTrackingChangedCallback menuTrackingChangedCallback; extern MenuTrackingChangedCallback menuTrackingChangedCallback;
static void mainMenuTrackingChanged (bool isTracking) static void mainMenuTrackingChanged (bool isTracking)


+ 3
- 7
modules/juce_gui_extra/misc/juce_LiveConstantEditor.h View File

@@ -204,17 +204,13 @@ namespace LiveConstantEditor
LiveValue<Type>& getValue (const char* file, int line, const Type& initialValue) LiveValue<Type>& getValue (const char* file, int line, const Type& initialValue)
{ {
const ScopedLock sl (lock); const ScopedLock sl (lock);
typedef LiveValue<Type> ValueType;
for (int i = 0; i < values.size(); ++i)
{
LiveValueBase* v = values.getUnchecked(i);
using ValueType = LiveValue<Type>;
for (auto* v : values)
if (v->sourceLine == line && v->sourceFile == file) if (v->sourceLine == line && v->sourceFile == file)
return *static_cast<ValueType*> (v); return *static_cast<ValueType*> (v);
}
ValueType* v = new ValueType (file, line, initialValue);
auto v = new ValueType (file, line, initialValue);
addValue (v); addValue (v);
return *v; return *v;
} }


+ 2
- 2
modules/juce_osc/osc/juce_OSCTypes.h View File

@@ -30,11 +30,11 @@ namespace juce
//============================================================================== //==============================================================================
/** The type used for OSC type tags. */ /** The type used for OSC type tags. */
typedef char OSCType;
using OSCType = char;
/** The type used for OSC type tag strings. */ /** The type used for OSC type tag strings. */
typedef Array<OSCType> OSCTypeList;
using OSCTypeList = Array<OSCType>;
//============================================================================== //==============================================================================


Loading…
Cancel
Save