From 7fa17be7c5c8ea8b2f8ff0d7995e050d70209c3f Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Mon, 2 Jul 2012 00:58:29 +0200 Subject: [PATCH] quartz: Move the FilterMapper_create to avoid forward declarations. --- dlls/quartz/filtermapper.c | 93 ++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 49 deletions(-) diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index 464caee77d2..51b5ed78e94 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -55,11 +55,6 @@ typedef struct FilterMapper3Impl LONG ref; } FilterMapper3Impl; -static const IUnknownVtbl IInner_VTable; -static const IFilterMapper3Vtbl fm3vtbl; -static const IFilterMapperVtbl fmvtbl; -static const IAMFilterDataVtbl AMFilterDataVtbl; - static inline FilterMapper3Impl *impl_from_IFilterMapper3( IFilterMapper3 *iface ) { return CONTAINING_RECORD(iface, FilterMapper3Impl, IFilterMapper3_iface); @@ -180,50 +175,6 @@ static void delete_vector(struct Vector * v) v->capacity = 0; } -HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj) -{ - FilterMapper3Impl * pFM2impl; - - TRACE("(%p, %p)\n", pUnkOuter, ppObj); - - pFM2impl = CoTaskMemAlloc(sizeof(*pFM2impl)); - if (!pFM2impl) - return E_OUTOFMEMORY; - - pFM2impl->IUnknown_inner.lpVtbl = &IInner_VTable; - pFM2impl->IFilterMapper3_iface.lpVtbl = &fm3vtbl; - pFM2impl->IFilterMapper_iface.lpVtbl = &fmvtbl; - pFM2impl->IAMFilterData_iface.lpVtbl = &AMFilterDataVtbl; - pFM2impl->ref = 1; - - if (pUnkOuter) - pFM2impl->outer_unk = pUnkOuter; - else - pFM2impl->outer_unk = &pFM2impl->IUnknown_inner; - - *ppObj = &pFM2impl->IUnknown_inner; - - TRACE("-- created at %p\n", pFM2impl); - - return S_OK; -} - -HRESULT FilterMapper_create(IUnknown *pUnkOuter, LPVOID *ppObj) -{ - FilterMapper3Impl *pFM2impl; - HRESULT hr; - - TRACE("(%p, %p)\n", pUnkOuter, ppObj); - - hr = FilterMapper2_create(pUnkOuter, (LPVOID*)&pFM2impl); - if (FAILED(hr)) - return hr; - - *ppObj = &pFM2impl->IFilterMapper_iface; - - return hr; -} - /*** IUnknown (inner) methods ***/ static HRESULT WINAPI Inner_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) @@ -1737,3 +1688,47 @@ static const IAMFilterDataVtbl AMFilterDataVtbl = { AMFilterData_ParseFilterData, AMFilterData_CreateFilterData }; + +HRESULT FilterMapper2_create(IUnknown *pUnkOuter, LPVOID *ppObj) +{ + FilterMapper3Impl * pFM2impl; + + TRACE("(%p, %p)\n", pUnkOuter, ppObj); + + pFM2impl = CoTaskMemAlloc(sizeof(*pFM2impl)); + if (!pFM2impl) + return E_OUTOFMEMORY; + + pFM2impl->IUnknown_inner.lpVtbl = &IInner_VTable; + pFM2impl->IFilterMapper3_iface.lpVtbl = &fm3vtbl; + pFM2impl->IFilterMapper_iface.lpVtbl = &fmvtbl; + pFM2impl->IAMFilterData_iface.lpVtbl = &AMFilterDataVtbl; + pFM2impl->ref = 1; + + if (pUnkOuter) + pFM2impl->outer_unk = pUnkOuter; + else + pFM2impl->outer_unk = &pFM2impl->IUnknown_inner; + + *ppObj = &pFM2impl->IUnknown_inner; + + TRACE("-- created at %p\n", pFM2impl); + + return S_OK; +} + +HRESULT FilterMapper_create(IUnknown *pUnkOuter, LPVOID *ppObj) +{ + FilterMapper3Impl *pFM2impl; + HRESULT hr; + + TRACE("(%p, %p)\n", pUnkOuter, ppObj); + + hr = FilterMapper2_create(pUnkOuter, (LPVOID*)&pFM2impl); + if (FAILED(hr)) + return hr; + + *ppObj = &pFM2impl->IFilterMapper_iface; + + return hr; +}