From d357dbfdd7722d4ed4fda6cec8935da797ac46dd Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc <mstefani@redhat.de> Date: Tue, 12 Jul 2016 10:03:57 +0200 Subject: [PATCH] riched20: Get rid of casts from COM objects to interfaces. Signed-off-by: Michael Stefaniuc <mstefani@redhat.de> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> --- dlls/riched20/clipboard.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/riched20/clipboard.c b/dlls/riched20/clipboard.c index c53666521d2..d4560dbc600 100644 --- a/dlls/riched20/clipboard.c +++ b/dlls/riched20/clipboard.c @@ -159,7 +159,8 @@ static const IEnumFORMATETCVtbl VT_EnumFormatImpl = { EnumFormatImpl_Clone }; -static HRESULT EnumFormatImpl_Create(const FORMATETC *fmtetc, UINT fmtetc_cnt, IEnumFORMATETC **lplpformatetc) +static HRESULT EnumFormatImpl_Create(const FORMATETC *fmtetc, UINT fmtetc_cnt, + IEnumFORMATETC **formatetc) { EnumFormatImpl *ret; TRACE("\n"); @@ -171,7 +172,7 @@ static HRESULT EnumFormatImpl_Create(const FORMATETC *fmtetc, UINT fmtetc_cnt, I ret->fmtetc_cnt = fmtetc_cnt; ret->fmtetc = GlobalAlloc(GMEM_ZEROINIT, fmtetc_cnt*sizeof(FORMATETC)); memcpy(ret->fmtetc, fmtetc, fmtetc_cnt*sizeof(FORMATETC)); - *lplpformatetc = (LPENUMFORMATETC)ret; + *formatetc = &ret->IEnumFORMATETC_iface; return S_OK; } @@ -401,8 +402,8 @@ static HGLOBAL get_rtf_text(ME_TextEditor *editor, const ME_Cursor *start, int n return gds.hData; } -HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start, - int nChars, LPDATAOBJECT *lplpdataobj) +HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start, int nChars, + IDataObject **dataobj) { DataObjectImpl *obj; TRACE("(%p,%d,%d)\n", editor, ME_GetCursorOfs(start), nChars); @@ -426,6 +427,6 @@ HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start, InitFormatEtc(obj->fmtetc[1], cfRTF, TYMED_HGLOBAL); } - *lplpdataobj = (LPDATAOBJECT)obj; + *dataobj = &obj->IDataObject_iface; return S_OK; }