diff --git a/modules/juce_core/javascript/choc/containers/choc_Value.h b/modules/juce_core/javascript/choc/containers/choc_Value.h index 101b212f9de2..9649ac1345b8 100644 --- a/modules/juce_core/javascript/choc/containers/choc_Value.h +++ b/modules/juce_core/javascript/choc/containers/choc_Value.h @@ -2838,7 +2838,7 @@ inline void Value::changeMember (uint32_t index, const Type& newType, void* newD for (uint32_t i = 0; i < numElements; ++i) { - auto member = value.type.getObjectMember (i); + const auto &member = value.type.getObjectMember (i); newCopy.addMember (member.name, i == index ? ValueView (newType, newData, newDictionary) : value[i]); } diff --git a/modules/juce_core/javascript/choc/javascript/choc_javascript_QuickJS.h b/modules/juce_core/javascript/choc/javascript/choc_javascript_QuickJS.h index 12e93f8771de..a23894849d44 100644 --- a/modules/juce_core/javascript/choc/javascript/choc_javascript_QuickJS.h +++ b/modules/juce_core/javascript/choc/javascript/choc_javascript_QuickJS.h @@ -6023,8 +6023,8 @@ static int compute_stack_size(const uint8_t *bc_buf, int bc_buf_len) pos = 0; while (pos < bc_buf_len) { opcode = bc_buf[pos]; - len = reopcode_info[opcode].size; assert(opcode < REOP_COUNT); + len = reopcode_info[opcode].size; assert((pos + len) <= bc_buf_len); switch(opcode) { case REOP_push_i32: diff --git a/modules/juce_graphics/fonts/harfbuzz/hb-directwrite.cc b/modules/juce_graphics/fonts/harfbuzz/hb-directwrite.cc index 6c90265d0b6e..d4cacf4c8609 100644 --- a/modules/juce_graphics/fonts/harfbuzz/hb-directwrite.cc +++ b/modules/juce_graphics/fonts/harfbuzz/hb-directwrite.cc @@ -168,8 +168,11 @@ _hb_directwrite_shaper_face_data_create (hb_face_t *face) } HB_STMT_END data->dwrite_dll = LoadLibrary (TEXT ("DWRITE")); - if (unlikely (!data->dwrite_dll)) - FAIL ("Cannot find DWrite.DLL"); + if ( unlikely( !data->dwrite_dll ) ) + { + delete data; + FAIL("Cannot find DWrite.DLL"); + } t_DWriteCreateFactory p_DWriteCreateFactory; diff --git a/modules/juce_gui_basics/native/accessibility/juce_UIAHelpers_windows.h b/modules/juce_gui_basics/native/accessibility/juce_UIAHelpers_windows.h index 8dd172104f64..1c014d697949 100644 --- a/modules/juce_gui_basics/native/accessibility/juce_UIAHelpers_windows.h +++ b/modules/juce_gui_basics/native/accessibility/juce_UIAHelpers_windows.h @@ -87,7 +87,7 @@ inline JUCE_COMRESULT addHandlersToArray (const std::vector (rangeProvider)); - - if (FAILED (hr)) - return E_FAIL; + hr = SafeArrayPutElement (*pRetVal, &pos, static_cast (rangeProvider)); rangeProvider->Release(); } + else + { + hr = E_FAIL; + } - return S_OK; + return hr; }); } @@ -111,22 +114,25 @@ class UIATextProvider : public UIAProviderBase, { return withTextInterface (pRetVal, [&] (const AccessibilityTextInterface& textInterface) { - *pRetVal = SafeArrayCreateVector (VT_UNKNOWN, 0, 1); + HRESULT hr; - if (pRetVal != nullptr) + *pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 1); + + if (*pRetVal != nullptr) { auto* rangeProvider = new UIATextRangeProvider (*this, { 0, textInterface.getTotalNumCharacters() }); LONG pos = 0; - auto hr = SafeArrayPutElement (*pRetVal, &pos, static_cast (rangeProvider)); - - if (FAILED (hr)) - return E_FAIL; + hr = SafeArrayPutElement (*pRetVal, &pos, static_cast (rangeProvider)); rangeProvider->Release(); } + else + { + hr = E_FAIL; + } - return S_OK; + return hr; }); } diff --git a/modules/juce_gui_basics/native/juce_FileChooser_windows.cpp b/modules/juce_gui_basics/native/juce_FileChooser_windows.cpp index 0801b061d343..8aeaeeb00f6a 100644 --- a/modules/juce_gui_basics/native/juce_FileChooser_windows.cpp +++ b/modules/juce_gui_basics/native/juce_FileChooser_windows.cpp @@ -451,25 +451,28 @@ class Win32NativeFileChooser final : private Thread LPITEMIDLIST list = SHBrowseForFolder (&bi); - if (! SHGetPathFromIDListW (list, files)) + if ( list != nullptr ) { - files[0] = 0; - returnedString.clear(); - } + if (!SHGetPathFromIDListW(list, files)) + { + files[0] = 0; + returnedString.clear(); + } - LPMALLOC al; + LPMALLOC al; - if (list != nullptr && SUCCEEDED (SHGetMalloc (&al))) - al->Free (list); + if (SUCCEEDED(SHGetMalloc(&al))) + al->Free(list); - if (files[0] != 0) - { - File result (String (files.get())); + if (files[0] != 0) + { + File result(String(files.get())); - if (returnedString.isNotEmpty()) - result = result.getSiblingFile (returnedString); + if (returnedString.isNotEmpty()) + result = result.getSiblingFile(returnedString); - selections.add (URL (result)); + selections.add(URL(result)); + } } } else