Michael Stefaniuc : comctl32: Remove superfluous casts that crept in as well as some older ones.

Alexandre Julliard julliard at winehq.org
Fri Nov 7 07:23:56 CST 2008


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Nov  7 00:56:07 2008 +0100

comctl32: Remove superfluous casts that crept in as well as some older ones.

---

 dlls/comctl32/commctrl.c       |    2 +-
 dlls/comctl32/listview.c       |    2 +-
 dlls/comctl32/tests/header.c   |    2 +-
 dlls/comctl32/tests/listview.c |    2 +-
 dlls/comctl32/tests/toolbar.c  |   44 ++++++++++++++++++++--------------------
 dlls/comctl32/tests/tooltips.c |   10 ++++----
 6 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index a3a0fb1..b97a5e5 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -932,7 +932,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
 	DeleteDC (hdcDst);
     }
     ReleaseDC (NULL, hdcScreen);
-    GlobalFree ((HGLOBAL)lpBitmapInfo);
+    GlobalFree (lpBitmapInfo);
     FreeResource (hglb);
 
     return hbm;
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index ce1e1b4..172925f 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -4795,7 +4795,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
 	ITEMHDR *hdrItem;
 	INT i;
 
-	hdpaSubItems = (HDPA)DPA_DeletePtr(infoPtr->hdpaItems, nItem);	
+	hdpaSubItems = DPA_DeletePtr(infoPtr->hdpaItems, nItem);
 	for (i = 0; i < DPA_GetPtrCount(hdpaSubItems); i++)
     	{
             hdrItem = DPA_GetPtr(hdpaSubItems, i);
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index dc61a75..b7341d4 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -952,7 +952,7 @@ static void test_hdm_sethotdivider(HWND hParent)
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
     todo_wine
     {
-        retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, TRUE, (LPARAM) 0X00050005);
+        retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, TRUE, 0X00050005);
         expect(0, retVal);
     }
     retVal = SendMessage(hChild, HDM_SETHOTDIVIDER, FALSE, 100);
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 56d9bf0..4d8028a 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -989,7 +989,7 @@ static void test_item_count(void)
     expect(3, r);
 
     /* [item0, item1] */
-    r = SendMessage(hwnd, LVM_DELETEITEM, (WPARAM) 2, 0);
+    r = SendMessage(hwnd, LVM_DELETEITEM, 2, 0);
     expect(TRUE, r);
 
     r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0);
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index a0c061c..04eecfb 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -168,7 +168,7 @@ static void rebuild_toolbar(HWND *hToolbar)
     *hToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,
         hMainWnd, (HMENU)5, GetModuleHandle(NULL), NULL);
     ok(*hToolbar != NULL, "Toolbar creation problem\n");
-    ok(SendMessage(*hToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0) == 0, "TB_BUTTONSTRUCTSIZE failed\n");
+    ok(SendMessage(*hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0) == 0, "TB_BUTTONSTRUCTSIZE failed\n");
     ok(SendMessage(*hToolbar, TB_AUTOSIZE, 0, 0) == 0, "TB_AUTOSIZE failed\n");
     ok(SendMessage(*hToolbar, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0)==1, "WM_SETFONT\n");
 }
@@ -958,42 +958,42 @@ static void test_sizes(void)
 
     rebuild_toolbar(&hToolbar);
 
-    ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, (WPARAM)0, (LPARAM) MAKELONG (32, 32) ) == 1, "TB_SETBITMAPSIZE failed\n");
-    ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, (WPARAM)0, (LPARAM)MAKELONG(100, 100)) == 1, "TB_SETBUTTONSIZE failed\n");
-    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&buttons2[0]) == 1, "TB_ADDBUTTONS failed\n");
-    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&buttons3[2]) == 1, "TB_ADDBUTTONS failed\n");
-    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&buttons3[0]) == 1, "TB_ADDBUTTONS failed\n");
-    SendMessageA(hToolbar, TB_AUTOSIZE, (WPARAM)0, (LPARAM)0 );
+    ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELPARAM(32, 32)) == 1, "TB_SETBITMAPSIZE failed\n");
+    ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(100, 100)) == 1, "TB_SETBUTTONSIZE failed\n");
+    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons2[0]) == 1, "TB_ADDBUTTONS failed\n");
+    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[2]) == 1, "TB_ADDBUTTONS failed\n");
+    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[0]) == 1, "TB_ADDBUTTONS failed\n");
+    SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 );
     check_sizes();
 
     rebuild_toolbar(&hToolbar);
     SetWindowLong(hToolbar, GWL_STYLE, TBSTYLE_LIST | GetWindowLong(hToolbar, GWL_STYLE));
-    ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, (WPARAM)0, (LPARAM) MAKELONG (32, 32) ) == 1, "TB_SETBITMAPSIZE failed\n");
-    ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, (WPARAM)0, (LPARAM)MAKELONG(100, 100)) == 1, "TB_SETBUTTONSIZE failed\n");
-    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&buttons2[0]) == 1, "TB_ADDBUTTONS failed\n");
-    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&buttons3[2]) == 1, "TB_ADDBUTTONS failed\n");
-    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n");
-    SendMessageA(hToolbar, TB_AUTOSIZE, (WPARAM)0, (LPARAM)0 );
+    ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELPARAM(32, 32)) == 1, "TB_SETBITMAPSIZE failed\n");
+    ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(100, 100)) == 1, "TB_SETBUTTONSIZE failed\n");
+    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons2[0]) == 1, "TB_ADDBUTTONS failed\n");
+    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[2]) == 1, "TB_ADDBUTTONS failed\n");
+    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n");
+    SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 );
     check_sizes_todo(0xff);
 
     rebuild_toolbar(&hToolbar);
     SetWindowLong(hToolbar, GWL_STYLE, TBSTYLE_LIST | GetWindowLong(hToolbar, GWL_STYLE));
-    ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, (WPARAM)0, (LPARAM) MAKELONG (32, 32) ) == 1, "TB_SETBITMAPSIZE failed\n");
-    ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, (WPARAM)0, (LPARAM)MAKELONG(100, 100)) == 1, "TB_SETBUTTONSIZE failed\n");
-    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n");
-    SendMessageA(hToolbar, TB_AUTOSIZE, (WPARAM)0, (LPARAM)0 );
+    ok(SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELPARAM(32, 32)) == 1, "TB_SETBITMAPSIZE failed\n");
+    ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(100, 100)) == 1, "TB_SETBUTTONSIZE failed\n");
+    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n");
+    SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 );
     check_sizes();
 
     rebuild_toolbar(&hToolbar);
     SetWindowLong(hToolbar, GWL_STYLE, TBSTYLE_WRAPABLE | GetWindowLong(hToolbar, GWL_STYLE));
-    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n");
-    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n");
+    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n");
+    ok(SendMessageA(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&buttons3[3]) == 1, "TB_ADDBUTTONS failed\n");
     tbinfo.cx = 672;
     tbinfo.cbSize = sizeof(TBBUTTONINFO);
     tbinfo.dwMask = TBIF_SIZE | TBIF_BYINDEX;
-    ok(SendMessageA(hToolbar, TB_SETBUTTONINFO, (WPARAM)0, (LPARAM)&tbinfo) != 0, "TB_SETBUTTONINFO failed\n");
-    ok(SendMessageA(hToolbar, TB_SETBUTTONINFO, (WPARAM)1, (LPARAM)&tbinfo) != 0, "TB_SETBUTTONINFO failed\n");
-    SendMessageA(hToolbar, TB_AUTOSIZE, (WPARAM)0, (LPARAM)0);
+    ok(SendMessageA(hToolbar, TB_SETBUTTONINFO, 0, (LPARAM)&tbinfo) != 0, "TB_SETBUTTONINFO failed\n");
+    ok(SendMessageA(hToolbar, TB_SETBUTTONINFO, 1, (LPARAM)&tbinfo) != 0, "TB_SETBUTTONINFO failed\n");
+    SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0);
     check_sizes();
 
     DestroyWindow(hToolbar);
diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c
index 1ce8ae0..b3f28fd 100644
--- a/dlls/comctl32/tests/tooltips.c
+++ b/dlls/comctl32/tests/tooltips.c
@@ -205,7 +205,7 @@ static void test_customdraw(void) {
        toolInfo.hwnd = parent;
        toolInfo.hinst = GetModuleHandleA(NULL);
        toolInfo.uFlags = TTF_SUBCLASS;
-       toolInfo.uId = (UINT_PTR)0x1234ABCD;
+       toolInfo.uId = 0x1234ABCD;
        toolInfo.lpszText = (LPSTR)"This is a test tooltip";
        toolInfo.lParam = 0xdeadbeef;
        GetClientRect (parent, &toolInfo.rect);
@@ -251,7 +251,7 @@ static void test_gettext(void)
     toolinfoA.hwnd = NULL;
     toolinfoA.hinst = GetModuleHandleA(NULL);
     toolinfoA.uFlags = 0;
-    toolinfoA.uId = (UINT_PTR)0x1234ABCD;
+    toolinfoA.uId = 0x1234ABCD;
     toolinfoA.lpszText = NULL;
     toolinfoA.lParam = 0xdeadbeef;
     GetClientRect(hwnd, &toolinfoA.rect);
@@ -260,7 +260,7 @@ static void test_gettext(void)
     if (r)
     {
         toolinfoA.hwnd = NULL;
-        toolinfoA.uId = (UINT_PTR)0x1234ABCD;
+        toolinfoA.uId = 0x1234ABCD;
         toolinfoA.lpszText = bufA;
         SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
         ok(strcmp(toolinfoA.lpszText, "") == 0, "lpszText should be an empty string\n");
@@ -284,7 +284,7 @@ static void test_gettext(void)
     toolinfoW.hwnd = NULL;
     toolinfoW.hinst = GetModuleHandleA(NULL);
     toolinfoW.uFlags = 0;
-    toolinfoW.uId = (UINT_PTR)0x1234ABCD;
+    toolinfoW.uId = 0x1234ABCD;
     toolinfoW.lpszText = NULL;
     toolinfoW.lParam = 0xdeadbeef;
     GetClientRect(hwnd, &toolinfoW.rect);
@@ -292,7 +292,7 @@ static void test_gettext(void)
     ok(r, "Adding the tool to the tooltip failed\n");
 
     toolinfoW.hwnd = NULL;
-    toolinfoW.uId = (UINT_PTR)0x1234ABCD;
+    toolinfoW.uId = 0x1234ABCD;
     toolinfoW.lpszText = bufW;
     SendMessageW(hwnd, TTM_GETTEXTW, 0, (LPARAM)&toolinfoW);
     ok(toolinfoW.lpszText[0] == 0, "lpszText should be an empty string\n");




More information about the wine-cvs mailing list