Michael Stefaniuc : ole32: Remove some superfluous casts of void pointers and zero.

Alexandre Julliard julliard at winehq.org
Thu Nov 6 08:25:58 CST 2008


Module: wine
Branch: master
Commit: 095568dfe95a8b797a8b90dfca2fffca4066bb2b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=095568dfe95a8b797a8b90dfca2fffca4066bb2b

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Wed Nov  5 23:04:10 2008 +0100

ole32: Remove some superfluous casts of void pointers and zero.

---

 dlls/ole32/clipboard.c      |    4 ++--
 dlls/ole32/comcat.c         |    4 ++--
 dlls/ole32/memlockbytes16.c |    2 +-
 dlls/ole32/ole16.c          |    2 +-
 dlls/ole32/ole2.c           |    8 ++++----
 dlls/ole32/ole2_16.c        |    2 +-
 dlls/ole32/tests/marshal.c  |    2 +-
 dlls/ole32/tests/moniker.c  |    2 +-
 8 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c
index 0e9d55c..5320988 100644
--- a/dlls/ole32/clipboard.c
+++ b/dlls/ole32/clipboard.c
@@ -414,7 +414,7 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj)
    if (hDataObject==0)
      HANDLE_ERROR( E_OUTOFMEMORY );
 
-   ppDataObject = (OLEClipbrd**)GlobalLock(hDataObject);
+   ppDataObject = GlobalLock(hDataObject);
    *ppDataObject = theOleClipboard;
    GlobalUnlock(hDataObject);
 
@@ -958,7 +958,7 @@ static HRESULT OLEClipbrd_RenderFormat(IDataObject *pIDataObject, LPFORMATETC pF
 
       if (SUCCEEDED(hr = IDataObject_GetData(theOleClipboard->pIDataObjectSrc, &fmt2, &std2)))
       {
-        mfp = (METAFILEPICT *)GlobalLock(std2.u.hGlobal);
+        mfp = GlobalLock(std2.u.hGlobal);
       }
 
       if (mfp)
diff --git a/dlls/ole32/comcat.c b/dlls/ole32/comcat.c
index 9120df0..f757cf9 100644
--- a/dlls/ole32/comcat.c
+++ b/dlls/ole32/comcat.c
@@ -181,7 +181,7 @@ static HRESULT COMCAT_GetCategoryDesc(HKEY key, LCID lcid, PWCHAR pszDesc,
 	FIXME("Simplified lcid comparison\n");
 	return CAT_E_NODESCRIPTION;
     }
-    pszDesc[size / sizeof(WCHAR)] = (WCHAR)0;
+    pszDesc[size / sizeof(WCHAR)] = 0;
 
     return S_OK;
 }
@@ -531,7 +531,7 @@ static HRESULT WINAPI COMCAT_ICatInformation_GetCategoryDesc(
     if (res != ERROR_SUCCESS) return CAT_E_CATIDNOEXIST;
 
     /* Allocate a sensible amount of memory for the description. */
-    *ppszDesc = (PWCHAR) CoTaskMemAlloc(128 * sizeof(WCHAR));
+    *ppszDesc = CoTaskMemAlloc(128 * sizeof(WCHAR));
     if (*ppszDesc == NULL) {
 	RegCloseKey(key);
 	return E_OUTOFMEMORY;
diff --git a/dlls/ole32/memlockbytes16.c b/dlls/ole32/memlockbytes16.c
index bccb953..bca7aa1 100644
--- a/dlls/ole32/memlockbytes16.c
+++ b/dlls/ole32/memlockbytes16.c
@@ -193,7 +193,7 @@ HRESULT CDECL HGLOBALLockBytesImpl16_QueryInterface(
       REFIID       riid,        /* [in] */
       void**       ppvObject)   /* [out][iid_is] (ptr to SEGPTR!) */
 {
-  HGLOBALLockBytesImpl16* const This=(HGLOBALLockBytesImpl16*)MapSL((SEGPTR)iface);
+  HGLOBALLockBytesImpl16* const This = MapSL((SEGPTR)iface);
 
   TRACE("(%p,%s,%p)\n",iface,debugstr_guid(riid),ppvObject);
   /*
diff --git a/dlls/ole32/ole16.c b/dlls/ole32/ole16.c
index d19a817..a8fa59b 100644
--- a/dlls/ole32/ole16.c
+++ b/dlls/ole32/ole16.c
@@ -572,7 +572,7 @@ SEGPTR WINAPI CoMemAlloc(DWORD size, DWORD dwMemContext, DWORD x) {
 	TRACE("(%d, 0x%08x, 0x%08x)\n", size, dwMemContext, x);
 	hres = _xmalloc16(size, &segptr);
 	if (hres != S_OK)
-		return (SEGPTR)0;
+		return 0;
 	return segptr;
 }
 
diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c
index bdbf6da..441244c 100644
--- a/dlls/ole32/ole2.c
+++ b/dlls/ole32/ole2.c
@@ -1405,7 +1405,7 @@ static LRESULT CALLBACK OLEMenu_CallWndProc(INT code, WPARAM wParam, LPARAM lPar
     goto NEXTHOOK;
 
   /* Get the menu descriptor */
-  pOleMenuDescriptor = (OleMenuDescriptor *) GlobalLock( hOleMenu );
+  pOleMenuDescriptor = GlobalLock( hOleMenu );
   if ( !pOleMenuDescriptor ) /* Bad descriptor! */
     goto NEXTHOOK;
 
@@ -1524,7 +1524,7 @@ static LRESULT CALLBACK OLEMenu_GetMsgProc(INT code, WPARAM wParam, LPARAM lPara
   }
 
   /* Get the menu descriptor */
-  pOleMenuDescriptor = (OleMenuDescriptor *) GlobalLock( hOleMenu );
+  pOleMenuDescriptor = GlobalLock( hOleMenu );
   if ( !pOleMenuDescriptor ) /* Bad descriptor! */
     goto NEXTHOOK;
 
@@ -1579,7 +1579,7 @@ HOLEMENU WINAPI OleCreateMenuDescriptor(
                                 sizeof(OleMenuDescriptor) ) ) )
   return 0;
 
-  pOleMenuDescriptor = (OleMenuDescriptor *) GlobalLock( hOleMenu );
+  pOleMenuDescriptor = GlobalLock( hOleMenu );
   if ( !pOleMenuDescriptor )
     return 0;
 
@@ -1664,7 +1664,7 @@ HRESULT WINAPI OleSetMenuDescriptor(
   return E_FAIL;
 
     /* Get the menu descriptor */
-    pOleMenuDescriptor = (OleMenuDescriptor *) GlobalLock( hOleMenu );
+    pOleMenuDescriptor = GlobalLock( hOleMenu );
     if ( !pOleMenuDescriptor )
       return E_UNEXPECTED;
 
diff --git a/dlls/ole32/ole2_16.c b/dlls/ole32/ole2_16.c
index 90a1ed2..fc88d8a 100644
--- a/dlls/ole32/ole2_16.c
+++ b/dlls/ole32/ole2_16.c
@@ -113,7 +113,7 @@ HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16(
     hmf = CloseMetaFile(hdc);
 
     hmf16 = GlobalAlloc16(0, sizeof(METAFILEPICT16));
-    mf16 = (METAFILEPICT16 *)GlobalLock16(hmf16);
+    mf16 = GlobalLock16(hmf16);
     mf16->mm = MM_ANISOTROPIC;
     mf16->xExt = 20; /* FIXME: bogus */
     mf16->yExt = 20; /* ditto */
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 0443b63..9dc7632 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -2052,7 +2052,7 @@ static void test_freethreadedmarshaldata(IStream *pStream, MSHCTX mshctx, void *
 
     size = GlobalSize(hglobal);
 
-    marshal_data = (char *)GlobalLock(hglobal);
+    marshal_data = GlobalLock(hglobal);
 
     if (mshctx == MSHCTX_INPROC)
     {
diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c
index 468eb62..1b7bcc3 100644
--- a/dlls/ole32/tests/moniker.c
+++ b/dlls/ole32/tests/moniker.c
@@ -364,7 +364,7 @@ Moniker_GetDisplayName(IMoniker* iface, IBindCtx* pbc,
 {
     static const WCHAR wszDisplayName[] = {'*','*','G','e','m','m','a',0};
     CHECK_EXPECTED_METHOD("Moniker_GetDisplayName");
-    *ppszDisplayName = (LPOLESTR)CoTaskMemAlloc(sizeof(wszDisplayName));
+    *ppszDisplayName = CoTaskMemAlloc(sizeof(wszDisplayName));
     memcpy(*ppszDisplayName, wszDisplayName, sizeof(wszDisplayName));
     return S_OK;
 }




More information about the wine-cvs mailing list