diff --git a/modules/juce_core/native/juce_win32_SystemStats.cpp b/modules/juce_core/native/juce_win32_SystemStats.cpp index 75e4f41c92..702fd7c03d 100644 --- a/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -369,8 +369,10 @@ bool Time::setSystemTimeToThisTime() const // do this twice because of daylight saving conversion problems - the // first one sets it up, the second one kicks it in. - return SetLocalTime (&st) != 0 - && SetLocalTime (&st) != 0; + // NB: the local variable is here to avoid analysers warning about having + // two identical sub-expressions in the return statement + bool firstCallToSetTimezone = SetLocalTime (&st) != 0; + return firstCallToSetTimezone && SetLocalTime (&st) != 0; } int SystemStats::getPageSize() diff --git a/modules/juce_core/network/juce_Socket.cpp b/modules/juce_core/network/juce_Socket.cpp index b62f4c593b..a3d1ad8517 100644 --- a/modules/juce_core/network/juce_Socket.cpp +++ b/modules/juce_core/network/juce_Socket.cpp @@ -40,9 +40,11 @@ #if JUCE_WINDOWS typedef int juce_socklen_t; typedef SOCKET SocketHandle; + static const SocketHandle invalidSocket = INVALID_SOCKET; #else typedef socklen_t juce_socklen_t; typedef int SocketHandle; + static const SocketHandle invalidSocket = -1; #endif //============================================================================== @@ -354,7 +356,7 @@ namespace SocketHelpers { const SocketHandle newHandle = socket (i->ai_family, i->ai_socktype, 0); - if (newHandle >= 0) + if (newHandle != invalidSocket) { setSocketBlockingState (newHandle, false); const int result = ::connect (newHandle, i->ai_addr, (socklen_t) i->ai_addrlen); diff --git a/modules/juce_graphics/image_formats/jpglib/jmemmgr.c b/modules/juce_graphics/image_formats/jpglib/jmemmgr.c index c11609b889..d7dca35d2b 100644 --- a/modules/juce_graphics/image_formats/jpglib/jmemmgr.c +++ b/modules/juce_graphics/image_formats/jpglib/jmemmgr.c @@ -1030,7 +1030,7 @@ jinit_memory_mgr (j_common_ptr cinfo) my_mem_ptr mem; long max_to_use; int pool; - size_t test_mac; +// size_t test_mac; cinfo->mem = NULL; /* for safety if init fails */ @@ -1048,10 +1048,10 @@ jinit_memory_mgr (j_common_ptr cinfo) * Again, an "unreachable code" warning may be ignored here. * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK. */ - test_mac = (size_t) MAX_ALLOC_CHUNK; - if ((long) test_mac != MAX_ALLOC_CHUNK || - (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0) - ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); +// test_mac = (size_t) MAX_ALLOC_CHUNK; +// if ((long) test_mac != MAX_ALLOC_CHUNK || +// (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0) +// ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */ diff --git a/modules/juce_gui_basics/misc/juce_DropShadower.cpp b/modules/juce_gui_basics/misc/juce_DropShadower.cpp index d46f1372d8..0c3f4ad621 100644 --- a/modules/juce_gui_basics/misc/juce_DropShadower.cpp +++ b/modules/juce_gui_basics/misc/juce_DropShadower.cpp @@ -187,10 +187,12 @@ void DropShadower::updateShadows() WeakReference sw (shadowWindows[i]); if (sw != nullptr) + { sw->setAlwaysOnTop (owner->isAlwaysOnTop()); - if (sw != nullptr) - { + if (sw == nullptr) + return; + switch (i) { case 0: sw->setBounds (x - shadowEdge, y, shadowEdge, h); break; @@ -199,13 +201,12 @@ void DropShadower::updateShadows() case 3: sw->setBounds (x, owner->getBottom(), w, shadowEdge); break; default: break; } - } - if (sw != nullptr) + if (sw == nullptr) + return; + sw->toBehind (i == 3 ? owner : shadowWindows.getUnchecked (i + 1)); - - if (sw == nullptr) - return; + } } } else diff --git a/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp b/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp index e7fd60b599..b9afe20555 100644 --- a/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp +++ b/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp @@ -91,7 +91,7 @@ public: if (owner.isCurrentlyBlockedByAnotherModalComponent()) { if (lParam == WM_LBUTTONDOWN || lParam == WM_RBUTTONDOWN - || lParam == WM_LBUTTONDBLCLK || lParam == WM_LBUTTONDBLCLK) + || lParam == WM_LBUTTONDBLCLK || lParam == WM_RBUTTONDBLCLK) { if (Component* const current = Component::getCurrentlyModalComponent()) current->inputAttemptWhenModal(); diff --git a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp index 96612094a3..5cccd6c543 100644 --- a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp @@ -118,8 +118,9 @@ public: } } - browser->Navigate ((BSTR) (const OLECHAR*) url.toWideCharPointer(), - &headerFlags, &frame, &postDataVar, &headersVar); + BSTR urlBSTR = SysAllocString ((const OLECHAR*) url.toWideCharPointer()); + browser->Navigate (urlBSTR, &headerFlags, &frame, &postDataVar, &headersVar); + SysFreeString (urlBSTR); if (sa != nullptr) SafeArrayDestroy (sa);