From abe01671d4ae28878943650ea00da37caf915a3e Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 18 Jun 2018 17:11:12 +0100 Subject: [PATCH] Fixed a very old spelling mistake!(SystemStats::getCpuSpeedInMegaherz -> SystemStats::getCpuSpeedInMegahertz) --- examples/Plugins/SamplerPluginDemo.h | 10 ++++------ examples/Utilities/SystemInfoDemo.h | 2 +- .../Source/Application/jucer_Application.cpp | 2 +- .../native/juce_android_SystemStats.cpp | 2 +- .../juce_core/native/juce_linux_SystemStats.cpp | 2 +- modules/juce_core/native/juce_mac_SystemStats.mm | 2 +- .../juce_core/native/juce_win32_SystemStats.cpp | 2 +- modules/juce_core/system/juce_SystemStats.h | 16 +++++++++------- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/Plugins/SamplerPluginDemo.h b/examples/Plugins/SamplerPluginDemo.h index 4d677d8764..aeec87643f 100644 --- a/examples/Plugins/SamplerPluginDemo.h +++ b/examples/Plugins/SamplerPluginDemo.h @@ -163,16 +163,14 @@ public: source.read (&data, 0, length + 4, 0, true, true); } - double getSampleRate() const { return sourceSampleRate; } - - int getLength() const { return length; } - - const AudioSampleBuffer& getBuffer() const { return data; } + double getSampleRate() const { return sourceSampleRate; } + int getLength() const { return length; } + const AudioBuffer& getBuffer() const { return data; } private: double sourceSampleRate; int length; - AudioSampleBuffer data; + AudioBuffer data; }; //============================================================================== diff --git a/examples/Utilities/SystemInfoDemo.h b/examples/Utilities/SystemInfoDemo.h index 7c6dfb8821..e0954c07ed 100644 --- a/examples/Utilities/SystemInfoDemo.h +++ b/examples/Utilities/SystemInfoDemo.h @@ -150,7 +150,7 @@ static String getAllSystemInfo() << "Memory size: " << SystemStats::getMemorySizeInMegabytes() << " MB" << newLine << "CPU vendor: " << SystemStats::getCpuVendor() << newLine << "CPU model: " << SystemStats::getCpuModel() << newLine - << "CPU speed: " << SystemStats::getCpuSpeedInMegaherz() << " MHz" << newLine + << "CPU speed: " << SystemStats::getCpuSpeedInMegahertz() << " MHz" << newLine << "CPU has MMX: " << (SystemStats::hasMMX() ? "yes" : "no") << newLine << "CPU has SSE: " << (SystemStats::hasSSE() ? "yes" : "no") << newLine << "CPU has SSE2: " << (SystemStats::hasSSE2() ? "yes" : "no") << newLine diff --git a/extras/Projucer/Source/Application/jucer_Application.cpp b/extras/Projucer/Source/Application/jucer_Application.cpp index 2d43febac1..12e1157be1 100644 --- a/extras/Projucer/Source/Application/jucer_Application.cpp +++ b/extras/Projucer/Source/Application/jucer_Application.cpp @@ -77,7 +77,7 @@ void ProjucerApplication::initialise (const String& commandLine) { initialiseLogger ("IDE_Log_"); Logger::writeToLog (SystemStats::getOperatingSystemName()); - Logger::writeToLog ("CPU: " + String (SystemStats::getCpuSpeedInMegaherz()) + Logger::writeToLog ("CPU: " + String (SystemStats::getCpuSpeedInMegahertz()) + "MHz Cores: " + String (SystemStats::getNumCpus()) + " " + String (SystemStats::getMemorySizeInMegabytes()) + "MB"); diff --git a/modules/juce_core/native/juce_android_SystemStats.cpp b/modules/juce_core/native/juce_android_SystemStats.cpp index 916cd871e1..77e463a43b 100644 --- a/modules/juce_core/native/juce_android_SystemStats.cpp +++ b/modules/juce_core/native/juce_android_SystemStats.cpp @@ -433,7 +433,7 @@ String SystemStats::getCpuModel() return readPosixConfigFileValue ("/proc/cpuinfo", "Hardware"); } -int SystemStats::getCpuSpeedInMegaherz() +int SystemStats::getCpuSpeedInMegahertz() { int maxFreqKHz = 0; diff --git a/modules/juce_core/native/juce_linux_SystemStats.cpp b/modules/juce_core/native/juce_linux_SystemStats.cpp index 6b27719693..154f01c5ca 100644 --- a/modules/juce_core/native/juce_linux_SystemStats.cpp +++ b/modules/juce_core/native/juce_linux_SystemStats.cpp @@ -80,7 +80,7 @@ String SystemStats::getCpuModel() return getCpuInfo ("model name"); } -int SystemStats::getCpuSpeedInMegaherz() +int SystemStats::getCpuSpeedInMegahertz() { return roundToInt (getCpuInfo ("cpu MHz").getFloatValue()); } diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index 993d0a0139..5bcae75b24 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -203,7 +203,7 @@ String SystemStats::getCpuModel() return {}; } -int SystemStats::getCpuSpeedInMegaherz() +int SystemStats::getCpuSpeedInMegahertz() { uint64 speedHz = 0; size_t speedSize = sizeof (speedHz); diff --git a/modules/juce_core/native/juce_win32_SystemStats.cpp b/modules/juce_core/native/juce_win32_SystemStats.cpp index d1c11423a9..e1512d38a8 100644 --- a/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -386,7 +386,7 @@ static int64 juce_getClockCycleCounter() noexcept #endif } -int SystemStats::getCpuSpeedInMegaherz() +int SystemStats::getCpuSpeedInMegahertz() { const int64 cycles = juce_getClockCycleCounter(); const uint32 millis = Time::getMillisecondCounter(); diff --git a/modules/juce_core/system/juce_SystemStats.h b/modules/juce_core/system/juce_SystemStats.h index 30894dc449..d50983ca56 100644 --- a/modules/juce_core/system/juce_SystemStats.h +++ b/modules/juce_core/system/juce_SystemStats.h @@ -156,7 +156,7 @@ public: @returns the speed in megahertz, e.g. 1500, 2500, 32000 (depending on what year you're reading this...) */ - static int getCpuSpeedInMegaherz(); + static int getCpuSpeedInMegahertz(); /** Returns a string to indicate the CPU vendor. Might not be known on some systems. @@ -199,10 +199,10 @@ public: */ static String getStackBacktrace(); - /** A function type for use in setApplicationCrashHandler(). The parameter will contain - platform-specific data about the crash. + /** A function type for use in setApplicationCrashHandler(). + When called, its void* argument will contain platform-specific data about the crash. */ - using CrashHandlerFunction = void (*) (void*); + using CrashHandlerFunction = void(*)(void*); /** Sets up a global callback function that will be called if the application executes some kind of illegal instruction. @@ -213,15 +213,17 @@ public: static void setApplicationCrashHandler (CrashHandlerFunction); /** Returns true if this code is running inside an app extension sandbox. - This function will always return false on windows, linux and android. */ static bool isRunningInAppExtensionSandbox() noexcept; -private: + //============================================================================== - SystemStats(); + // This method was spelt wrong! Please change your code to use getCpuSpeedInMegahertz() instead + JUCE_DEPRECATED_WITH_BODY (static int getCpuSpeedInMegaherz(), { return getCpuSpeedInMegahertz(); }) +private: + SystemStats() = delete; // uses only static methods JUCE_DECLARE_NON_COPYABLE (SystemStats) };