From 8324ed6cc956dab82f983303d47613baf2f57064 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 18 Feb 2009 22:45:59 +0100 Subject: [PATCH] shell32: Remove superfluous pointer casts from macros. --- dlls/shell32/autocomplete.c | 6 +++--- dlls/shell32/cpanelfolder.c | 18 +++++++++--------- dlls/shell32/dragdrophelper.c | 4 ++-- dlls/shell32/shfldr_fs.c | 18 +++++++++--------- dlls/shell32/shfldr_mycomp.c | 12 ++++++------ dlls/shell32/shfldr_netplaces.c | 6 +++--- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index 2057b25d900..7646dee783a 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -84,9 +84,9 @@ static const IAutoCompleteDropDownVtbl acdropdownvt; /* converts This to an interface pointer */ -#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) -#define _IAutoComplete2_(This) (IAutoComplete2*)&(This->lpVtbl) -#define _IAutoCompleteDropDown_(This) (IAutoCompleteDropDown*)&(This->lpDropDownVtbl) +#define _IUnknown_(This) ((IUnknown*)&(This)->lpVtbl) +#define _IAutoComplete2_(This) ((IAutoComplete2*)&(This)->lpVtbl) +#define _IAutoCompleteDropDown_(This) (&(This)->lpDropDownVtbl) static inline IAutoCompleteImpl *impl_from_IAutoCompleteDropDown(IAutoCompleteDropDown *iface) { diff --git a/dlls/shell32/cpanelfolder.c b/dlls/shell32/cpanelfolder.c index 5ef78af333e..2e4e683c60e 100644 --- a/dlls/shell32/cpanelfolder.c +++ b/dlls/shell32/cpanelfolder.c @@ -96,15 +96,15 @@ static inline ICPanelImpl *impl_from_IShellExecuteHookA( IShellExecuteHookA *ifa /* converts This to an interface pointer */ -#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) -#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) -#define _IShellFolder2_(This) (IShellFolder2*)&(This->lpVtbl) - -#define _IPersist_(This) (IPersist*)&(This->lpVtblPersistFolder2) -#define _IPersistFolder_(This) (IPersistFolder*)&(This->lpVtblPersistFolder2) -#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2) -#define _IShellExecuteHookW_(This) (IShellExecuteHookW*)&(This->lpVtblShellExecuteHookW) -#define _IShellExecuteHookA_(This) (IShellExecuteHookA*)&(This->lpVtblShellExecuteHookA) +#define _IUnknown_(This) ((IUnknown*)&(This)->lpVtbl) +#define _IShellFolder_(This) ((IShellFolder*)&(This)->lpVtbl) +#define _IShellFolder2_(This) (&(This)->lpVtbl) + +#define _IPersist_(This) (&(This)->lpVtblPersistFolder2) +#define _IPersistFolder_(This) (&(This)->lpVtblPersistFolder2) +#define _IPersistFolder2_(This) (&(This)->lpVtblPersistFolder2) +#define _IShellExecuteHookW_(This) (&(This)->lpVtblShellExecuteHookW) +#define _IShellExecuteHookA_(This) (&(This)->lpVtblShellExecuteHookA) /*********************************************************************** * IShellFolder [ControlPanel] implementation diff --git a/dlls/shell32/dragdrophelper.c b/dlls/shell32/dragdrophelper.c index 82ad0d99808..5015722b094 100644 --- a/dlls/shell32/dragdrophelper.c +++ b/dlls/shell32/dragdrophelper.c @@ -54,8 +54,8 @@ typedef struct { static const IDropTargetHelperVtbl vt_IDropTargetHelper; -#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) -#define _IDropTargetHelper_(This) (IDropTargetHelper*)&(This->lpVtbl) +#define _IUnknown_(This) ((IUnknown*)&(This)->lpVtbl) +#define _IDropTargetHelper_(This) (&(This)->lpVtbl) /************************************************************************** * IDropTargetHelper_Constructor diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index 891ff4afd4e..25acf4066c3 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -110,15 +110,15 @@ static inline IGenericSFImpl *impl_from_ISFHelper( ISFHelper *iface ) /* converts This to an interface pointer */ -#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) -#define _IShellFolder_(This) (IShellFolder*)&(This->lpvtblShellFolder) -#define _IShellFolder2_(This) (IShellFolder2*)&(This->lpvtblShellFolder) -#define _IPersist_(This) (IPersist*)&(This->lpvtblPersistFolder3) -#define _IPersistFolder_(This) (IPersistFolder*)&(This->lpvtblPersistFolder3) -#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpvtblPersistFolder3) -#define _IPersistFolder3_(This) (IPersistFolder3*)&(This->lpvtblPersistFolder3) -#define _IDropTarget_(This) (IDropTarget*)&(This->lpvtblDropTarget) -#define _ISFHelper_(This) (ISFHelper*)&(This->lpvtblSFHelper) +#define _IUnknown_(This) ((IUnknown*)&(This)->lpVtbl) +#define _IShellFolder_(This) ((IShellFolder*)&(This)->lpvtblShellFolder) +#define _IShellFolder2_(This) ((IShellFolder2*)&(This)->lpvtblShellFolder) +#define _IPersist_(This) (&(This)->lpvtblPersistFolder3) +#define _IPersistFolder_(This) (&(This)->lpvtblPersistFolder3) +#define _IPersistFolder2_(This) (&(This)->lpvtblPersistFolder3) +#define _IPersistFolder3_(This) (&(This)->lpvtblPersistFolder3) +#define _IDropTarget_(This) (&(This)->lpvtblDropTarget) +#define _ISFHelper_(This) (&(This)->lpvtblSFHelper) /************************************************************************** * registers clipboardformat once diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c index c6ff06ec9a1..17f61c91f5a 100644 --- a/dlls/shell32/shfldr_mycomp.c +++ b/dlls/shell32/shfldr_mycomp.c @@ -75,13 +75,13 @@ static inline IGenericSFImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface /* converts This to an interface pointer */ -#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) -#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) -#define _IShellFolder2_(This) (IShellFolder2*)&(This->lpVtbl) +#define _IUnknown_(This) ((IUnknown*)&(This)->lpVtbl) +#define _IShellFolder_(This) ((IShellFolder*)&(This)->lpVtbl) +#define _IShellFolder2_(This) (&(This)->lpVtbl) -#define _IPersist_(This) (IPersist*)&(This->lpVtblPersistFolder2) -#define _IPersistFolder_(This) (IPersistFolder*)&(This->lpVtblPersistFolder2) -#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2) +#define _IPersist_(This) (&(This)->lpVtblPersistFolder2) +#define _IPersistFolder_(This) (&(This)->lpVtblPersistFolder2) +#define _IPersistFolder2_(This) (&(This)->lpVtblPersistFolder2) /*********************************************************************** * IShellFolder [MyComputer] implementation diff --git a/dlls/shell32/shfldr_netplaces.c b/dlls/shell32/shfldr_netplaces.c index 39f61a7ce6d..30ab73e456a 100644 --- a/dlls/shell32/shfldr_netplaces.c +++ b/dlls/shell32/shfldr_netplaces.c @@ -69,9 +69,9 @@ static const IPersistFolder2Vtbl vt_NP_PersistFolder2; #define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = \ (class*)(((char*)name) - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2)) -#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) -#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) -#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2) +#define _IUnknown_(This) ((IUnknown*)&(This)->lpVtbl) +#define _IShellFolder_(This) ((IShellFolder*)&(This)->lpVtbl) +#define _IPersistFolder2_(This) (&(This)->lpVtblPersistFolder2) static const shvheader NetworkPlacesSFHeader[] = { {IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}, -- 2.11.4.GIT