user32: Remove unneeded casts (2 of 2)

Andrew Talbot andrew.talbot at talbotville.com
Mon Jan 21 14:06:59 CST 2008


Changelog:
    user32: Remove unneeded casts.

diff --git a/dlls/user32/dialog16.c b/dlls/user32/dialog16.c
index 72bec00..6850d35 100644
--- a/dlls/user32/dialog16.c
+++ b/dlls/user32/dialog16.c
@@ -548,7 +548,7 @@ INT16 WINAPI GetDlgItemText16( HWND16 hwnd, INT16 id, SEGPTR str, UINT16 len )
 void WINAPI SetDlgItemInt16( HWND16 hwnd, INT16 id, UINT16 value, BOOL16 fSigned )
 {
     SetDlgItemInt( WIN_Handle32(hwnd), (UINT)(UINT16)id,
-             (UINT)(fSigned ? (INT16) value : (UINT16) value), fSigned );
+             (UINT)(fSigned ? (INT16) value : value), fSigned );
 }
 
 
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index 7f9f24e..a3eb1d8 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -2165,8 +2165,7 @@ static void EDIT_MoveWordBackward(EDITSTATE *es, BOOL extend)
 			e = li + EDIT_EM_LineLength(es, li);
 		}
 	} else {
-		e = li + (INT)EDIT_CallWordBreakProc(es,
-				li, e - li, ll, WB_LEFT);
+		e = li + EDIT_CallWordBreakProc(es, li, e - li, ll, WB_LEFT);
 	}
 	if (!extend)
 		s = e;
diff --git a/dlls/user32/exticon.c b/dlls/user32/exticon.c
index 2b54df4..8e9f938 100644
--- a/dlls/user32/exticon.c
+++ b/dlls/user32/exticon.c
@@ -486,10 +486,10 @@ static UINT ICO_ExtractIconExW(
 
 	        if (pCIDir)
                 {
-	          RetPtr[icon] = (HICON)CreateIconFromResourceEx(pCIDir, uSize, TRUE, 0x00030000,
+	          RetPtr[icon] = CreateIconFromResourceEx(pCIDir, uSize, TRUE, 0x00030000,
                                                                  cx1, cy1, flags);
                   if (cx2 && cy2)
-                      RetPtr[++icon] = (HICON)CreateIconFromResourceEx(pCIDir, uSize, TRUE, 0x00030000,
+                      RetPtr[++icon] = CreateIconFromResourceEx(pCIDir, uSize, TRUE, 0x00030000,
                                                                        cx2, cy2, flags);
                 }
 	        else
@@ -674,11 +674,9 @@ static UINT ICO_ExtractIconExW(
 	      RetPtr[i]=0;
 	      continue;
 	    }
-	    RetPtr[i] = (HICON) CreateIconFromResourceEx(idata,idataent->Size,TRUE,0x00030000,
-                                                         cx1, cy1, flags);
+	    RetPtr[i] = CreateIconFromResourceEx(idata, idataent->Size, TRUE, 0x00030000, cx1, cy1, flags);
             if (cx2 && cy2)
-                RetPtr[++i] = (HICON) CreateIconFromResourceEx(idata,idataent->Size,TRUE,0x00030000,
-                                                               cx2, cy2, flags);
+                RetPtr[++i] = CreateIconFromResourceEx(idata, idataent->Size, TRUE, 0x00030000, cx2, cy2, flags);
 	  }
 	  ret = i;	/* return number of retrieved icons */
 	}			/* if(sig == IMAGE_NT_SIGNATURE) */
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
index 3331ef5..6aa9a95 100644
--- a/dlls/user32/msgbox.c
+++ b/dlls/user32/msgbox.c
@@ -474,7 +474,7 @@ INT WINAPI MessageBoxIndirectW( LPMSGBOXPARAMSW msgbox )
     if (!(hRes = FindResourceExW(user32_module, (LPWSTR)RT_DIALOG,
                                  msg_box_res_nameW, msgbox->dwLanguageId)))
         return 0;
-    if (!(tmplate = (LPVOID)LoadResource(user32_module, hRes)))
+    if (!(tmplate = LoadResource(user32_module, hRes)))
         return 0;
 
     if ((msgbox->dwStyle & MB_TASKMODAL) && (msgbox->hwndOwner==NULL))
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index 3b2785e..b323a9b 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -609,7 +609,7 @@ static BOOL SYSPARAMS_LoadRaw( LPCWSTR lpRegKey, LPCWSTR lpValName, LPBYTE lpBuf
     if ((RegOpenKeyW( get_volatile_regkey(), lpRegKey, &hKey ) == ERROR_SUCCESS) ||
         (RegOpenKeyW( HKEY_CURRENT_USER, lpRegKey, &hKey ) == ERROR_SUCCESS))
     {
-        ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, (LPBYTE)lpBuf, &count);
+        ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, lpBuf, &count);
         RegCloseKey( hKey );
     }
     return ret;
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index b1dec05..33c02d4 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -1721,7 +1721,7 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, UINT size, BOOL unicod
     case GWLP_USERDATA:  retvalue = wndPtr->userdata; break;
     case GWL_STYLE:      retvalue = wndPtr->dwStyle; break;
     case GWL_EXSTYLE:    retvalue = wndPtr->dwExStyle; break;
-    case GWLP_ID:        retvalue = (ULONG_PTR)wndPtr->wIDmenu; break;
+    case GWLP_ID:        retvalue = wndPtr->wIDmenu; break;
     case GWLP_HINSTANCE: retvalue = (ULONG_PTR)wndPtr->hInstance; break;
     case GWLP_WNDPROC:
         /* This looks like a hack only for the edit control (see tests). This makes these controls
@@ -2070,7 +2070,7 @@ LONG WINAPI SetWindowLong16( HWND16 hwnd, INT16 offset, LONG newval )
     {
         WNDPROC new_proc = WINPROC_AllocProc16( (WNDPROC16)newval );
         WNDPROC old_proc = (WNDPROC)SetWindowLongPtrA( WIN_Handle32(hwnd), offset, (LONG_PTR)new_proc );
-        return (LONG)WINPROC_GetProc16( (WNDPROC)old_proc, FALSE );
+        return (LONG)WINPROC_GetProc16( old_proc, FALSE );
     }
     else return SetWindowLongA( WIN_Handle32(hwnd), offset, newval );
 }
diff --git a/dlls/user32/wnd16.c b/dlls/user32/wnd16.c
index 0b0d0c1..4090245 100644
--- a/dlls/user32/wnd16.c
+++ b/dlls/user32/wnd16.c
@@ -690,7 +690,7 @@ LONG WINAPI SetClassLong16( HWND16 hwnd16, INT16 offset, LONG newval )
         {
             WNDPROC new_proc = WINPROC_AllocProc16( (WNDPROC16)newval );
             WNDPROC old_proc = (WNDPROC)SetClassLongA( WIN_Handle32(hwnd16), offset, (LONG_PTR)new_proc );
-            return (LONG)WINPROC_GetProc16( (WNDPROC)old_proc, FALSE );
+            return (LONG)WINPROC_GetProc16( old_proc, FALSE );
         }
     case GCLP_MENUNAME:
         newval = (LONG)MapSL( newval );



More information about the wine-patches mailing list