From b888a72db908bf0bd1832ce5906c33d393baaddd Mon Sep 17 00:00:00 2001 From: jules Date: Sat, 17 Mar 2012 11:34:12 +0000 Subject: [PATCH] Updated win32 GetSystemInfo calls. URL domain name fix. --- modules/juce_core/native/juce_win32_SystemStats.cpp | 4 ++-- modules/juce_core/network/juce_URL.cpp | 6 +++--- .../juce_video/native/juce_win32_DirectShowComponent.cpp | 8 -------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/modules/juce_core/native/juce_win32_SystemStats.cpp b/modules/juce_core/native/juce_win32_SystemStats.cpp index cec8a2262d..9e47416838 100644 --- a/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -114,7 +114,7 @@ SystemStats::CPUFlags::CPUFlags() #endif SYSTEM_INFO systemInfo; - GetSystemInfo (&systemInfo); + GetNativeSystemInfo (&systemInfo); numCpus = (int) systemInfo.dwNumberOfProcessors; } @@ -344,7 +344,7 @@ bool Time::setSystemTimeToThisTime() const int SystemStats::getPageSize() { SYSTEM_INFO systemInfo; - GetSystemInfo (&systemInfo); + GetNativeSystemInfo (&systemInfo); return (int) systemInfo.dwPageSize; } diff --git a/modules/juce_core/network/juce_URL.cpp b/modules/juce_core/network/juce_URL.cpp index 90444150ce..ff5a4c3e47 100644 --- a/modules/juce_core/network/juce_URL.cpp +++ b/modules/juce_core/network/juce_URL.cpp @@ -241,9 +241,9 @@ String URL::getDomain() const const int end1 = url.indexOfChar (start, '/'); const int end2 = url.indexOfChar (start, ':'); - const int end = (end1 < 0 || end2 < 0) ? jmax (end1, end2) - : jmin (end1, end2); - + const int end = (end1 < 0 && end2 < 0) ? std::numeric_limits::max() + : ((end1 < 0 || end2 < 0) ? jmax (end1, end2) + : jmin (end1, end2)); return url.substring (start, end); } diff --git a/modules/juce_video/native/juce_win32_DirectShowComponent.cpp b/modules/juce_video/native/juce_win32_DirectShowComponent.cpp index 69c0bce74e..bdc183d291 100644 --- a/modules/juce_video/native/juce_win32_DirectShowComponent.cpp +++ b/modules/juce_video/native/juce_win32_DirectShowComponent.cpp @@ -226,12 +226,6 @@ public: CoUninitialize(); } - //====================================================================== - HWND getNativeWindowHandle() const - { - return nativeWindow != nullptr ? nativeWindow->getHandle() : 0; - } - //====================================================================== void updateWindowPosition (const Rectangle& newBounds) { @@ -537,8 +531,6 @@ private: if (c != nullptr) { - jassert (c->getNativeWindowHandle() == hwnd); - switch (msg) { case WM_ERASEBKGND: return 1;