comdlg32: Remove superfluous pointer casts.

Michael Stefaniuc mstefani at redhat.de
Tue Jan 13 16:30:08 CST 2009


---
 dlls/comdlg32/filedlg.c        |   14 +++++++-------
 dlls/comdlg32/filedlg31.c      |    2 +-
 dlls/comdlg32/filedlgbrowser.c |   20 ++++++++++----------
 dlls/comdlg32/finddlg32.c      |    2 +-
 dlls/comdlg32/fontdlg.c        |    6 +++---
 dlls/comdlg32/printdlg.c       |    2 +-
 dlls/comdlg32/tests/filedlg.c  |    2 +-
 7 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index 386a201..a2826c8 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -292,7 +292,7 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
                                      (LPARAM) fodInfos);
     else
       lRes = DialogBoxIndirectParamA(COMDLG32_hInstance,
-                                     (LPCDLGTEMPLATEA) template,
+                                     template,
                                      fodInfos->ofnInfos->hwndOwner,
                                      FileOpenDlgProc95,
                                      (LPARAM) fodInfos);
@@ -998,7 +998,7 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
 
 	 /* Adds the FileOpenDlgInfos in the property list of the dialog
             so it will be easily accessible through a GetPropA(...) */
-      	 SetPropA(hwnd, FileOpenDlgInfosStr, (HANDLE) fodInfos);
+         SetPropA(hwnd, FileOpenDlgInfosStr, fodInfos);
 
          FILEDLG95_InitControls(hwnd);
 
@@ -1971,7 +1971,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
         DWORD len;
 
         /* replace the current filter */
-        MemFree((LPVOID)fodInfos->ShellInfos.lpstrCurrentFilter);
+        MemFree(fodInfos->ShellInfos.lpstrCurrentFilter);
         len = lstrlenW(lpszTemp)+1;
         fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc(len * sizeof(WCHAR));
         lstrcpyW( fodInfos->ShellInfos.lpstrCurrentFilter, lpszTemp);
@@ -2484,7 +2484,7 @@ static BOOL FILEDLG95_FILETYPE_OnCommand(HWND hwnd, WORD wNotifyCode)
         (fodInfos->customfilter == NULL ? 1 : 0);
 
       /* Set the current filter with the current selection */
-      MemFree((LPVOID)fodInfos->ShellInfos.lpstrCurrentFilter);
+      MemFree(fodInfos->ShellInfos.lpstrCurrentFilter);
 
       lpstrFilter = (LPWSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,
                                              iItem);
@@ -2592,7 +2592,7 @@ static void FILEDLG95_LOOKIN_Init(HWND hwndCombo)
 
   liInfos->iMaxIndentation = 0;
 
-  SetPropA(hwndCombo, LookInInfosStr, (HANDLE) liInfos);
+  SetPropA(hwndCombo, LookInInfosStr, liInfos);
 
   /* set item height for both text field and listbox */
   CBSetItemHeight(hwndCombo,-1,GetSystemMetrics(SM_CYSMICON));
@@ -2901,7 +2901,7 @@ static int FILEDLG95_LOOKIN_InsertItemAfterParent(HWND hwnd,LPITEMIDLIST pidl)
   }
 
   /* Free pidlParent memory */
-  COMDLG32_SHFree((LPVOID)pidlParent);
+  COMDLG32_SHFree(pidlParent);
 
   return FILEDLG95_LOOKIN_AddItem(hwnd,pidl,iParentPos + 1);
 }
@@ -3114,7 +3114,7 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
               lstrcpyW( lpstrAllFile, lpstrTemp );
 	    }
           }
-          COMDLG32_SHFree( (LPVOID) pidl );
+          COMDLG32_SHFree( pidl );
 	}
       }
       SetWindowTextW( fodInfos->DlgInfos.hwndFileName, lpstrAllFile );
diff --git a/dlls/comdlg32/filedlg31.c b/dlls/comdlg32/filedlg31.c
index 6b2a379..3e43178 100644
--- a/dlls/comdlg32/filedlg31.c
+++ b/dlls/comdlg32/filedlg31.c
@@ -822,7 +822,7 @@ LONG FD31_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
   PFD31_DATA lfs = (PFD31_DATA) lParam;
 
   if (!lfs) return FALSE;
-  SetPropA(hWnd, FD31_OFN_PROP, (HANDLE)lfs);
+  SetPropA(hWnd, FD31_OFN_PROP, lfs);
   lfs->hwnd = hWnd;
   ofn = lfs->ofnW;
 
diff --git a/dlls/comdlg32/filedlgbrowser.c b/dlls/comdlg32/filedlgbrowser.c
index f933f15..d485d73 100644
--- a/dlls/comdlg32/filedlgbrowser.c
+++ b/dlls/comdlg32/filedlgbrowser.c
@@ -156,12 +156,12 @@ static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPC
 	switch (src->uType)
 	{
 	  case STRRET_WSTR:
-	    lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
+            lstrcpynW(dest, src->u.pOleStr, len);
 	    COMDLG32_SHFree(src->u.pOleStr);
 	    break;
 
 	  case STRRET_CSTR:
-            if (len && !MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, (LPWSTR)dest, len ))
+            if (len && !MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, dest, len ))
                 ((LPWSTR)dest)[len-1] = 0;
 	    break;
 
@@ -169,7 +169,7 @@ static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPC
 	    if (pidl)
 	    {
                 if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset,
-                                                 -1, (LPWSTR)dest, len ))
+                                                 -1, dest, len ))
                     ((LPWSTR)dest)[len-1] = 0;
 	    }
 	    break;
@@ -196,7 +196,7 @@ IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner)
     IShellBrowserImpl *sb;
     FileOpenDlgInfos *fodInfos = GetPropA(hwndOwner,FileOpenDlgInfosStr);
 
-    sb=(IShellBrowserImpl*)COMDLG32_SHAlloc(sizeof(IShellBrowserImpl));
+    sb = COMDLG32_SHAlloc(sizeof(IShellBrowserImpl));
 
     /* Initialisation of the member variables */
     sb->ref=1;
@@ -231,19 +231,19 @@ static HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
     { *ppvObj = This;
     }
     else if(IsEqualIID(riid, &IID_IOleWindow))  /*IOleWindow*/
-    { *ppvObj = (IOleWindow*)This;
+    { *ppvObj = This;
     }
 
     else if(IsEqualIID(riid, &IID_IShellBrowser))  /*IShellBrowser*/
-    { *ppvObj = (IShellBrowser*)This;
+    { *ppvObj = This;
     }
 
     else if(IsEqualIID(riid, &IID_ICommDlgBrowser))  /*ICommDlgBrowser*/
-    { *ppvObj = (ICommDlgBrowser*) &(This->lpVtblCommDlgBrowser);
+    { *ppvObj = &(This->lpVtblCommDlgBrowser);
     }
 
     else if(IsEqualIID(riid, &IID_IServiceProvider))  /* IServiceProvider */
-    { *ppvObj = (ICommDlgBrowser*) &(This->lpVtblServiceProvider);
+    { *ppvObj = &(This->lpVtblServiceProvider);
     }
 
     if(*ppvObj)
@@ -442,7 +442,7 @@ static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
     fodInfos->Shell.FOIShellFolder = psfTmp;
 
     /* Release old pidlAbsCurrent and update its value */
-    COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent);
+    COMDLG32_SHFree(fodInfos->ShellInfos.pidlAbsCurrent);
     fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
 
     COMDLG32_UpdateCurrentDir(fodInfos);
@@ -795,7 +795,7 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDl
 	}
 
         /* Free memory used by pidl */
-        COMDLG32_SHFree((LPVOID)pidl);
+        COMDLG32_SHFree(pidl);
 
         return hRes;
     }
diff --git a/dlls/comdlg32/finddlg32.c b/dlls/comdlg32/finddlg32.c
index 80c8e8b..2a7d7e3 100644
--- a/dlls/comdlg32/finddlg32.c
+++ b/dlls/comdlg32/finddlg32.c
@@ -408,7 +408,7 @@ static HWND COMDLG32_FR_DoFindReplace(
         }
         else
         {
-        	loadrc = (HGLOBAL)pdata->fr.hInstance;
+                loadrc = pdata->fr.hInstance;
         }
 
         if(!loadrc)
diff --git a/dlls/comdlg32/fontdlg.c b/dlls/comdlg32/fontdlg.c
index 470b7d3..f61de36 100644
--- a/dlls/comdlg32/fontdlg.c
+++ b/dlls/comdlg32/fontdlg.c
@@ -182,7 +182,7 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
 
     if ( (lpChFont->Flags&CF_ENABLETEMPLATEHANDLE)!=0 )
     {
-        template=(LPCVOID)lpChFont->hInstance;
+        template=lpChFont->hInstance;
     } else
     {
         if ( (lpChFont->Flags&CF_ENABLETEMPLATE)!=0 )
@@ -236,7 +236,7 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
 
     if ( (lpChFont->Flags&CF_ENABLETEMPLATEHANDLE)!=0 )
     {
-        template=(LPCVOID)lpChFont->hInstance;
+        template=lpChFont->hInstance;
     } else
     {
         if ( (lpChFont->Flags&CF_ENABLETEMPLATE)!=0 )
@@ -601,7 +601,7 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
     HCURSOR hcursor=SetCursor(LoadCursorW(0,(LPWSTR)IDC_WAIT));
     static const WCHAR strColorName[] = {'[','c','o','l','o','r',' ','n','a','m','e',']',0};
 
-    SetPropW(hDlg, strWineFontData, (HANDLE)lpcf);
+    SetPropW(hDlg, strWineFontData, lpcf);
     lpxx=lpcf->lpLogFont;
     TRACE("WM_INITDIALOG lParam=%08lX\n", lParam);
 
diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c
index 6515700..4a07f04 100644
--- a/dlls/comdlg32/printdlg.c
+++ b/dlls/comdlg32/printdlg.c
@@ -736,7 +736,7 @@ static BOOL PRINTDLG_SetUpPaperComboBoxW(HWND hDlg,
     NrOfEntries = DeviceCapabilitiesW(PrinterName, PortName,
                                       fwCapability_Names, Names, dm);
     NrOfEntries = DeviceCapabilitiesW(PrinterName, PortName,
-				      fwCapability_Words, (LPWSTR)Words, dm);
+                                      fwCapability_Words, Words, dm);
 
     /* reset any current content in the combobox */
     SendDlgItemMessageW(hDlg, nIDComboBox, CB_RESETCONTENT, 0, 0);
diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c
index c3d56ea..9c3487f 100644
--- a/dlls/comdlg32/tests/filedlg.c
+++ b/dlls/comdlg32/tests/filedlg.c
@@ -74,7 +74,7 @@ static void test_DialogCancel(void)
     ofn.nMaxFile = MAX_PATH;
     ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_ENABLEHOOK;
     ofn.lpstrDefExt = "txt";
-    ofn.lpfnHook = (LPOFNHOOKPROC) OFNHookProc;
+    ofn.lpfnHook = OFNHookProc;
     ofn.lpstrInitialDir = szInitialDir;
 
     PrintDlgA(NULL);
-- 
1.6.0.6
-------------- 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/20090113/817f7b0e/attachment-0001.pgp 


More information about the wine-patches mailing list