comctl32/tests: Remove some superfluous casts around SendMessage().

Michael Stefaniuc mstefani at redhat.de
Sun Dec 27 16:50:38 CST 2009


Those casts happen implicitly.
---
 dlls/comctl32/tests/comboex.c  |    8 ++++----
 dlls/comctl32/tests/header.c   |   18 +++++++++---------
 dlls/comctl32/tests/listview.c |    2 +-
 dlls/comctl32/tests/monthcal.c |    2 +-
 dlls/comctl32/tests/rebar.c    |    2 +-
 dlls/comctl32/tests/treeview.c |   10 +++++-----
 6 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c
index d6bbce1..f9a42df 100644
--- a/dlls/comctl32/tests/comboex.c
+++ b/dlls/comctl32/tests/comboex.c
@@ -54,7 +54,7 @@ static LONG addItem(HWND cbex, int idx, LPTSTR text) {
     cbexItem.iItem = idx;
     cbexItem.pszText    = text;
     cbexItem.cchTextMax = 0;
-    return (LONG)SendMessage(cbex, CBEM_INSERTITEM, 0,(LPARAM)&cbexItem);
+    return SendMessage(cbex, CBEM_INSERTITEM, 0, (LPARAM)&cbexItem);
 }
 
 static LONG setItem(HWND cbex, int idx, LPTSTR text) {
@@ -64,11 +64,11 @@ static LONG setItem(HWND cbex, int idx, LPTSTR text) {
     cbexItem.iItem = idx;
     cbexItem.pszText    = text;
     cbexItem.cchTextMax = 0;
-    return (LONG)SendMessage(cbex, CBEM_SETITEM, 0,(LPARAM)&cbexItem);
+    return SendMessage(cbex, CBEM_SETITEM, 0, (LPARAM)&cbexItem);
 }
 
 static LONG delItem(HWND cbex, int idx) {
-    return (LONG)SendMessage(cbex, CBEM_DELETEITEM, (LPARAM)idx, 0);
+    return SendMessage(cbex, CBEM_DELETEITEM, idx, 0);
 }
 
 static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEM *cbItem) {
@@ -77,7 +77,7 @@ static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEM *cbItem) {
     cbItem->pszText      = textBuffer;
     cbItem->iItem        = idx;
     cbItem->cchTextMax   = 100;
-    return (LONG)SendMessage(cbex, CBEM_GETITEM, 0, (LPARAM)cbItem);
+    return SendMessage(cbex, CBEM_GETITEM, 0, (LPARAM)cbItem);
 }
 
 static LRESULT WINAPI editbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index 102327a..d9b4a73 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -244,7 +244,7 @@ static LONG addItem(HWND hdex, int idx, LPSTR text)
     hdItem.cxy        = 100;
     hdItem.pszText    = text;
     hdItem.cchTextMax = 0;
-    return (LONG)SendMessage(hdex, HDM_INSERTITEMA, (WPARAM)idx, (LPARAM)&hdItem);
+    return SendMessage(hdex, HDM_INSERTITEMA, idx, (LPARAM)&hdItem);
 }
 
 static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
@@ -259,7 +259,7 @@ static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
         expect_notify(HDN_ITEMCHANGINGA, FALSE, &hdexItem);
         expect_notify(HDN_ITEMCHANGEDA, FALSE, &hdexItem);
     }
-    ret = (LONG)SendMessage(hdex, HDM_SETITEMA, (WPARAM)idx, (LPARAM)&hdexItem);
+    ret = SendMessage(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
     if (fCheckNotifies)
         ok(notifies_received(), "setItem(): not all expected notifies were received\n");
     return ret;
@@ -279,19 +279,19 @@ static LONG setItemUnicodeNotify(HWND hdex, int idx, LPSTR text, LPWSTR wText)
     
     expect_notify(HDN_ITEMCHANGINGW, TRUE, (HDITEMA*)&hdexNotify);
     expect_notify(HDN_ITEMCHANGEDW, TRUE, (HDITEMA*)&hdexNotify);
-    ret = (LONG)SendMessage(hdex, HDM_SETITEMA, (WPARAM)idx, (LPARAM)&hdexItem);
+    ret = SendMessage(hdex, HDM_SETITEMA, idx, (LPARAM)&hdexItem);
     ok(notifies_received(), "setItemUnicodeNotify(): not all expected notifies were received\n");
     return ret;
 }
 
 static LONG delItem(HWND hdex, int idx)
 {
-    return (LONG)SendMessage(hdex, HDM_DELETEITEM, (WPARAM)idx, 0);
+    return SendMessage(hdex, HDM_DELETEITEM, idx, 0);
 }
 
 static LONG getItemCount(HWND hdex)
 {
-    return (LONG)SendMessage(hdex, HDM_GETITEMCOUNT, 0, 0);
+    return SendMessage(hdex, HDM_GETITEMCOUNT, 0, 0);
 }
 
 static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
@@ -300,7 +300,7 @@ static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
     hdItem.mask         = HDI_TEXT;
     hdItem.pszText      = textBuffer;
     hdItem.cchTextMax   = MAX_CHARS;
-    return (LONG)SendMessage(hdex, HDM_GETITEMA, (WPARAM)idx, (LPARAM)&hdItem);
+    return SendMessage(hdex, HDM_GETITEMA, idx, (LPARAM)&hdItem);
 }
 
 static void addReadDelItem(HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
@@ -748,10 +748,10 @@ static void test_header_control (void)
         TEST_GET_ITEM(i, 4);
         TEST_GET_ITEMCOUNT(6);
     }
-    
-    SendMessageA(hWndHeader, HDM_SETUNICODEFORMAT, (WPARAM)TRUE, 0);
+
+    SendMessageA(hWndHeader, HDM_SETUNICODEFORMAT, TRUE, 0);
     setItemUnicodeNotify(hWndHeader, 3, pszUniTestA, pszUniTestW);
-    SendMessageA(hWndHeader, WM_NOTIFYFORMAT, (WPARAM)hHeaderParentWnd, (LPARAM)NF_REQUERY);
+    SendMessageA(hWndHeader, WM_NOTIFYFORMAT, (WPARAM)hHeaderParentWnd, NF_REQUERY);
     setItem(hWndHeader, 3, str_items[4], TRUE);
     
     dont_expect_notify(HDN_GETDISPINFOA);
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index a21eb23..0122886 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -1553,7 +1553,7 @@ static void test_icon_spacing(void)
     hwnd = create_listview_control(LVS_ICON);
     ok(hwnd != NULL, "failed to create a listview window\n");
 
-    r = SendMessage(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwndparent, (LPARAM)NF_REQUERY);
+    r = SendMessage(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwndparent, NF_REQUERY);
     expect(NFR_ANSI, r);
 
     /* reset the icon spacing to defaults */
diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c
index a7aeddd..ea10b9f 100644
--- a/dlls/comctl32/tests/monthcal.c
+++ b/dlls/comctl32/tests/monthcal.c
@@ -857,7 +857,7 @@ static void test_monthcal_firstDay(void)
         /* checking for the values that actually will be stored as */
         /* current first day when we set a new value */
         for (i = -5; i < 12; i++){
-            res = SendMessage(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, (LPARAM) i);
+            res = SendMessage(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, i);
             expect(prev, res);
             res = SendMessage(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0);
             prev = res;
diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index e2021d1..a75a064 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -87,7 +87,7 @@ static HWND build_toolbar(int nr, HWND hParent)
     int i;
 
     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");
 
diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c
index c49dd80..74d4d0e 100644
--- a/dlls/comctl32/tests/treeview.c
+++ b/dlls/comctl32/tests/treeview.c
@@ -520,12 +520,12 @@ static void test_get_set_bkcolor(void)
     ok(crColor == -1, "Default background color reported as 0x%.8x\n", crColor);
 
     /* Test for black background */
-    SendMessage( hTree, TVM_SETBKCOLOR, 0, (LPARAM)RGB(0,0,0) );
+    SendMessage( hTree, TVM_SETBKCOLOR, 0, RGB(0,0,0) );
     crColor = (COLORREF)SendMessage( hTree, TVM_GETBKCOLOR, 0, 0 );
     ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8x\n", crColor);
 
     /* Test for white background */
-    SendMessage( hTree, TVM_SETBKCOLOR, 0, (LPARAM)RGB(255,255,255) );
+    SendMessage( hTree, TVM_SETBKCOLOR, 0, RGB(255,255,255) );
     crColor = (COLORREF)SendMessage( hTree, TVM_GETBKCOLOR, 0, 0 );
     ok(crColor == RGB(255,255,255), "White background color reported as 0x%.8x\n", crColor);
 
@@ -718,12 +718,12 @@ static void test_get_set_textcolor(void)
     ok(crColor == -1, "Default text color reported as 0x%.8x\n", crColor);
 
     /* Test for black text */
-    SendMessage( hTree, TVM_SETTEXTCOLOR, 0, (LPARAM)RGB(0,0,0) );
+    SendMessage( hTree, TVM_SETTEXTCOLOR, 0, RGB(0,0,0) );
     crColor = (COLORREF)SendMessage( hTree, TVM_GETTEXTCOLOR, 0, 0 );
     ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8x\n", crColor);
 
     /* Test for white text */
-    SendMessage( hTree, TVM_SETTEXTCOLOR, 0, (LPARAM)RGB(255,255,255) );
+    SendMessage( hTree, TVM_SETTEXTCOLOR, 0, RGB(255,255,255) );
     crColor = (COLORREF)SendMessage( hTree, TVM_GETTEXTCOLOR, 0, 0 );
     ok(crColor == RGB(255,255,255), "White text color reported as 0x%.8x\n", crColor);
 
@@ -785,7 +785,7 @@ static void test_get_set_unicodeformat(void)
     ok(bNewSetting == 0, "ANSI setting did not work.\n");
 
     /* Revert to original setting */
-    SendMessage( hTree, TVM_SETUNICODEFORMAT, (LPARAM)bPreviousSetting, 0 );
+    SendMessage( hTree, TVM_SETUNICODEFORMAT, bPreviousSetting, 0 );
 
     ok_sequence(MsgSequences, TREEVIEW_SEQ_INDEX, test_get_set_unicodeformat_seq,
         "test get set unicode format", FALSE);
-- 
1.6.6.rc4



More information about the wine-patches mailing list