From 7dd00af7478de1c0d1e8c98445c30a5bf4f815f2 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 19 Oct 2015 11:57:50 +0300 Subject: [PATCH] strmbase: Remove some redundant return value initializers. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/strmbase/audio.c | 2 +- dlls/strmbase/dispatch.c | 2 +- dlls/strmbase/filter.c | 3 +-- dlls/strmbase/outputqueue.c | 3 +-- dlls/strmbase/pin.c | 13 +++++-------- dlls/strmbase/renderer.c | 8 ++++---- dlls/strmbase/transform.c | 2 +- dlls/strmbase/video.c | 2 +- dlls/strmbase/window.c | 2 +- 9 files changed, 16 insertions(+), 21 deletions(-) diff --git a/dlls/strmbase/audio.c b/dlls/strmbase/audio.c index e167a794019..1b79ec5a907 100644 --- a/dlls/strmbase/audio.c +++ b/dlls/strmbase/audio.c @@ -70,8 +70,8 @@ HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPO HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr) { BasicAudio *This = impl_from_IBasicAudio(iface); - HRESULT hr = S_OK; ITypeInfo *pTypeInfo; + HRESULT hr; hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); if (SUCCEEDED(hr)) diff --git a/dlls/strmbase/dispatch.c b/dlls/strmbase/dispatch.c index 8f7aa058b17..d0f778e07b1 100644 --- a/dlls/strmbase/dispatch.c +++ b/dlls/strmbase/dispatch.c @@ -29,8 +29,8 @@ HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid) { - HRESULT hr = E_FAIL; ITypeLib *pTypeLib; + HRESULT hr; This->pTypeInfo = NULL; hr = LoadRegTypeLib(&LIBID_QuartzTypeLib, 1, 0, LOCALE_SYSTEM_DEFAULT, &pTypeLib); diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index 697b2439e98..f1b2d498643 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -158,7 +158,6 @@ HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO * HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName ) { - HRESULT hr = S_OK; BaseFilter *This = impl_from_IBaseFilter(iface); TRACE("(%p)->(%p, %s)\n", This, pGraph, debugstr_w(pName)); @@ -173,7 +172,7 @@ HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph } LeaveCriticalSection(&This->csFilter); - return hr; + return S_OK; } HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo) diff --git a/dlls/strmbase/outputqueue.c b/dlls/strmbase/outputqueue.c index 36960e38147..842a9f0fa07 100644 --- a/dlls/strmbase/outputqueue.c +++ b/dlls/strmbase/outputqueue.c @@ -68,7 +68,6 @@ HRESULT WINAPI OutputQueue_Construct( OutputQueue **ppOutputQueue ) { - HRESULT hr = S_OK; BOOL threaded = FALSE; DWORD tid; @@ -116,7 +115,7 @@ HRESULT WINAPI OutputQueue_Construct( } LeaveCriticalSection(&This->csQueue); - return hr; + return S_OK; } HRESULT WINAPI OutputQueue_Destroy(OutputQueue *pOutputQueue) diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index a9c1928e078..d61469c86a7 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -575,9 +575,9 @@ HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin *This, IMediaSa /* replaces OutputPin_SendSample */ HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin *This, IMediaSample * pSample) { - HRESULT hr = S_OK; IMemInputPin * pMemConnected = NULL; PIN_INFO pinInfo; + HRESULT hr; EnterCriticalSection(This->pin.pCritSec); { @@ -615,7 +615,7 @@ HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin *This, IMediaSample * pSa /* replaces OutputPin_CommitAllocator */ HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin *This) { - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p)->()\n", This); @@ -635,7 +635,7 @@ HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin *This) /* replaces OutputPin_DecommitAllocator */ HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin *This) { - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p)->()\n", This); @@ -875,12 +875,9 @@ ULONG WINAPI BaseInputPinImpl_Release(IPin * iface) TRACE("(%p)->() Release from %d\n", iface, refCount + 1); if (!refCount) - { BaseInputPin_Destroy(This); - return 0; - } - else - return refCount; + + return refCount; } HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt) diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 99c9278ad10..fa2545be6dc 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -60,7 +60,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection(IPin * iface, IPin { BaseInputPin *This = impl_BaseInputPin_from_IPin(iface); BaseRenderer *renderer = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p/%p)->(%p, %p)\n", This, renderer, pReceivePin, pmt); @@ -99,7 +99,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_Disconnect(IPin * iface) static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface) { - HRESULT hr = S_OK; + HRESULT hr; BaseInputPin* This = impl_BaseInputPin_from_IPin(iface); BaseRenderer *pFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); @@ -126,7 +126,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin * iface) { BaseInputPin* This = impl_BaseInputPin_from_IPin(iface); BaseRenderer *pFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p/%p)->()\n", This, iface); @@ -151,7 +151,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface) { BaseInputPin* This = impl_BaseInputPin_from_IPin(iface); BaseRenderer *pFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p/%p)->()\n", This, pFilter); diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 4d872befa11..59c89be7712 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -93,7 +93,7 @@ static HRESULT WINAPI TransformFilter_Input_CheckMediaType(BasePin *iface, const static HRESULT WINAPI TransformFilter_Input_Receive(BaseInputPin *This, IMediaSample *pInSample) { - HRESULT hr = S_FALSE; + HRESULT hr; TransformFilter * pTransform; TRACE("%p\n", This); pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); diff --git a/dlls/strmbase/video.c b/dlls/strmbase/video.c index 1c4f3606f67..9714d7ee733 100644 --- a/dlls/strmbase/video.c +++ b/dlls/strmbase/video.c @@ -77,8 +77,8 @@ HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID rii HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr) { BaseControlVideo *This = impl_from_IBasicVideo(iface); - HRESULT hr = S_OK; ITypeInfo *pTypeInfo; + HRESULT hr; hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); if (SUCCEEDED(hr)) diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c index cb448e347b1..b4b5aabd283 100644 --- a/dlls/strmbase/window.c +++ b/dlls/strmbase/window.c @@ -250,8 +250,8 @@ HRESULT WINAPI BaseControlWindowImpl_GetIDsOfNames(IVideoWindow *iface, REFIID r HRESULT WINAPI BaseControlWindowImpl_Invoke(IVideoWindow *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr) { BaseControlWindow* This = impl_from_IVideoWindow(iface); - HRESULT hr = S_OK; ITypeInfo *pTypeInfo; + HRESULT hr; hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); if (SUCCEEDED(hr))