comctl32: LockResource() returns a LPVOID so don't cast its return value.

Michael Stefaniuc mstefani at redhat.de
Thu Oct 23 16:52:45 CDT 2008


Found by using the scripts (adapted to Wine) from
http://kernelnewbies.org/KernelJanitors/Todo/VoidPointerConvs
---
 dlls/comctl32/commctrl.c  |    2 +-
 dlls/comctl32/propsheet.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index 050a018..f21aa11 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -878,7 +878,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
     hglb = LoadResource (hInstance, hRsrc);
     if (hglb == 0)
 	return 0;
-    lpBitmap = (LPBITMAPINFOHEADER)LockResource (hglb);
+    lpBitmap = LockResource (hglb);
     if (lpBitmap == NULL)
 	return 0;
 
diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index 0499a83..b463dfd 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -441,7 +441,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
                                     (LPWSTR)RT_DIALOG);
     HGLOBAL hTemplate = LoadResource(lppsp->hInstance,
                                      hResource);
-    pTemplate = (LPDLGTEMPLATEW)LockResource(hTemplate);
+    pTemplate = LockResource(hTemplate);
   }
   else
   {
@@ -450,7 +450,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
                                     (LPSTR)RT_DIALOG);
     HGLOBAL hTemplate = LoadResource(lppsp->hInstance,
                                      hResource);
-    pTemplate = (LPDLGTEMPLATEA)LockResource(hTemplate);
+    pTemplate = LockResource(hTemplate);
   }
 
   /*
@@ -1412,7 +1412,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
     if(!hTemplate)
 	return FALSE;
 
-    pTemplate = (LPDLGTEMPLATEW)LockResource(hTemplate);
+    pTemplate = LockResource(hTemplate);
     /*
      * Make a copy of the dialog template to make it writable
      */
@@ -1434,7 +1434,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
     if(!hTemplate)
 	return FALSE;
 
-    pTemplate = (LPDLGTEMPLATEA)LockResource(hTemplate);
+    pTemplate = LockResource(hTemplate);
     /*
      * Make a copy of the dialog template to make it writable
      */
-- 
1.6.0.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20081023/21a53fe3/attachment.pgp 


More information about the wine-patches mailing list