From 6994317b05a554f0e7ab5956c0f95ebd90a14388 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Mon, 27 Dec 2010 23:26:23 +0100 Subject: [PATCH] avifil32: Reorder some code to avoid forward declarations for the IGetFrameVtbl methods. --- dlls/avifil32/getframe.c | 73 +++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/dlls/avifil32/getframe.c b/dlls/avifil32/getframe.c index 6f3e6baedc5..c24009c1497 100644 --- a/dlls/avifil32/getframe.c +++ b/dlls/avifil32/getframe.c @@ -37,29 +37,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(avifile); /***********************************************************************/ -static HRESULT WINAPI IGetFrame_fnQueryInterface(IGetFrame *iface, - REFIID refiid, LPVOID *obj); -static ULONG WINAPI IGetFrame_fnAddRef(IGetFrame *iface); -static ULONG WINAPI IGetFrame_fnRelease(IGetFrame *iface); -static LPVOID WINAPI IGetFrame_fnGetFrame(IGetFrame *iface, LONG lPos); -static HRESULT WINAPI IGetFrame_fnBegin(IGetFrame *iface, LONG lStart, - LONG lEnd, LONG lRate); -static HRESULT WINAPI IGetFrame_fnEnd(IGetFrame *iface); -static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface, - LPBITMAPINFOHEADER lpbi, - LPVOID lpBits, INT x, INT y, - INT dx, INT dy); - -static const struct IGetFrameVtbl igetframeVtbl = { - IGetFrame_fnQueryInterface, - IGetFrame_fnAddRef, - IGetFrame_fnRelease, - IGetFrame_fnGetFrame, - IGetFrame_fnBegin, - IGetFrame_fnEnd, - IGetFrame_fnSetFormat -}; - typedef struct _IGetFrameImpl { /* IUnknown stuff */ IGetFrame IGetFrame_iface; @@ -115,26 +92,6 @@ static void AVIFILE_CloseCompressor(IGetFrameImpl *This) } } -PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pStream) -{ - IGetFrameImpl *pg; - - /* check parameter */ - if (pStream == NULL) - return NULL; - - pg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IGetFrameImpl)); - if (pg != NULL) { - pg->IGetFrame_iface.lpVtbl = &igetframeVtbl; - pg->ref = 1; - pg->lCurrentFrame = -1; - pg->pStream = pStream; - IAVIStream_AddRef(pStream); - } - - return (PGETFRAME)pg; -} - static HRESULT WINAPI IGetFrame_fnQueryInterface(IGetFrame *iface, REFIID refiid, LPVOID *obj) { @@ -521,4 +478,34 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface, } } +static const struct IGetFrameVtbl igetframeVtbl = { + IGetFrame_fnQueryInterface, + IGetFrame_fnAddRef, + IGetFrame_fnRelease, + IGetFrame_fnGetFrame, + IGetFrame_fnBegin, + IGetFrame_fnEnd, + IGetFrame_fnSetFormat +}; + +PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pStream) +{ + IGetFrameImpl *pg; + + /* check parameter */ + if (pStream == NULL) + return NULL; + + pg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IGetFrameImpl)); + if (pg != NULL) { + pg->IGetFrame_iface.lpVtbl = &igetframeVtbl; + pg->ref = 1; + pg->lCurrentFrame = -1; + pg->pStream = pStream; + IAVIStream_AddRef(pStream); + } + + return (PGETFRAME)pg; +} + /***********************************************************************/