From 74e0072dfd28eabc3a61c1c63973cd1927134936 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sun, 29 Mar 2009 21:31:27 +0200 Subject: [PATCH] urlmon: Get rid of ICOM_THIS_MULTI macro. --- dlls/urlmon/format.c | 18 ++++++++++-------- dlls/urlmon/urlmon_main.h | 1 - 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dlls/urlmon/format.c b/dlls/urlmon/format.c index 0c87ca54789..bf9dda06034 100644 --- a/dlls/urlmon/format.c +++ b/dlls/urlmon/format.c @@ -35,11 +35,13 @@ typedef struct { static IEnumFORMATETC *EnumFORMATETC_Create(UINT cfmtetc, const FORMATETC *rgfmtetc, UINT it); -#define ENUMF_THIS(iface) ICOM_THIS_MULTI(EnumFORMATETC, lpEnumFORMATETCVtbl, iface) +#define ENUMF_THIS(iface) DEFINE_THIS(EnumFORMATETC, EnumFORMATETC, iface) static HRESULT WINAPI EnumFORMATETC_QueryInterface(IEnumFORMATETC *iface, REFIID riid, void **ppv) { - TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); + EnumFORMATETC *This = ENUMF_THIS(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); *ppv = NULL; @@ -55,7 +57,7 @@ static HRESULT WINAPI EnumFORMATETC_QueryInterface(IEnumFORMATETC *iface, REFIID static ULONG WINAPI EnumFORMATETC_AddRef(IEnumFORMATETC *iface) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); LONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); return ref; @@ -63,7 +65,7 @@ static ULONG WINAPI EnumFORMATETC_AddRef(IEnumFORMATETC *iface) static ULONG WINAPI EnumFORMATETC_Release(IEnumFORMATETC *iface) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); @@ -81,7 +83,7 @@ static ULONG WINAPI EnumFORMATETC_Release(IEnumFORMATETC *iface) static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface, ULONG celt, FORMATETC *rgelt, ULONG *pceltFetched) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); ULONG cnt; TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched); @@ -108,7 +110,7 @@ static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface, ULONG celt, static HRESULT WINAPI EnumFORMATETC_Skip(IEnumFORMATETC *iface, ULONG celt) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); TRACE("(%p)->(%d)\n", This, celt); @@ -118,7 +120,7 @@ static HRESULT WINAPI EnumFORMATETC_Skip(IEnumFORMATETC *iface, ULONG celt) static HRESULT WINAPI EnumFORMATETC_Reset(IEnumFORMATETC *iface) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); TRACE("(%p)\n", This); @@ -128,7 +130,7 @@ static HRESULT WINAPI EnumFORMATETC_Reset(IEnumFORMATETC *iface) static HRESULT WINAPI EnumFORMATETC_Clone(IEnumFORMATETC *iface, IEnumFORMATETC **ppenum) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); TRACE("(%p)->(%p)\n", This, ppenum); diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 637e58e1306..0d9a9669136 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -53,7 +53,6 @@ extern LONG URLMON_refCount; static inline void URLMON_LockModule(void) { InterlockedIncrement( &URLMON_refCount ); } static inline void URLMON_UnlockModule(void) { InterlockedDecrement( &URLMON_refCount ); } -#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc))) #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)