diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-05 09:58:46 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-05 13:15:39 +0000 |
commit | be7f8d3a49fc6d5d31e6fe61f9ba2dec43341e90 (patch) | |
tree | e8d249300a22fed7fff1787449b9d3ad8e6c9f98 /src/plugins/directshow/common/directshowpinenum.cpp | |
parent | 8daa96db2991c24c9102e736413f79241813b7df (diff) |
DirectShow: Fix clang-tidy warnings about else after return
- Unindent the code or replace by switch ()
- Smaller fixups when reindenting (nullptr, use QStringView for
comparison against wchar_t)
Change-Id: I249cb00b9ebe375b089d8d53b10c2d16d5771680
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/directshow/common/directshowpinenum.cpp')
-rw-r--r-- | src/plugins/directshow/common/directshowpinenum.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/plugins/directshow/common/directshowpinenum.cpp b/src/plugins/directshow/common/directshowpinenum.cpp index e0ab58d19..20fa93d6e 100644 --- a/src/plugins/directshow/common/directshowpinenum.cpp +++ b/src/plugins/directshow/common/directshowpinenum.cpp @@ -87,21 +87,20 @@ HRESULT DirectShowPinEnum::QueryInterface(REFIID riid, void **ppv) HRESULT DirectShowPinEnum::Next(ULONG cPins, IPin **ppPins, ULONG *pcFetched) { - if (ppPins && (pcFetched || cPins == 1)) { - ULONG count = qBound<ULONG>(0, cPins, m_pins.count() - m_index); - - for (ULONG i = 0; i < count; ++i, ++m_index) { - ppPins[i] = m_pins.at(m_index); - ppPins[i]->AddRef(); - } + if (!ppPins || (!pcFetched && cPins != 1)) + return E_POINTER; - if (pcFetched) - *pcFetched = count; + ULONG count = qBound<ULONG>(0, cPins, m_pins.count() - m_index); - return count == cPins ? S_OK : S_FALSE; - } else { - return E_POINTER; + for (ULONG i = 0; i < count; ++i, ++m_index) { + ppPins[i] = m_pins.at(m_index); + ppPins[i]->AddRef(); } + + if (pcFetched) + *pcFetched = count; + + return count == cPins ? S_OK : S_FALSE; } HRESULT DirectShowPinEnum::Skip(ULONG cPins) @@ -120,16 +119,10 @@ HRESULT DirectShowPinEnum::Reset() HRESULT DirectShowPinEnum::Clone(IEnumPins **ppEnum) { - if (ppEnum) { - if (m_filter) - *ppEnum = new DirectShowPinEnum(m_filter); - else - *ppEnum = new DirectShowPinEnum(m_pins); - - return S_OK; - } else { + if (!ppEnum) return E_POINTER; - } + *ppEnum = m_filter ? new DirectShowPinEnum(m_filter) : new DirectShowPinEnum(m_pins); + return S_OK; } QT_END_NAMESPACE |