Commit 92e4e633 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

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

parent f897a912
...@@ -54,7 +54,7 @@ static LONG addItem(HWND cbex, int idx, LPTSTR text) { ...@@ -54,7 +54,7 @@ static LONG addItem(HWND cbex, int idx, LPTSTR text) {
cbexItem.iItem = idx; cbexItem.iItem = idx;
cbexItem.pszText = text; cbexItem.pszText = text;
cbexItem.cchTextMax = 0; 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) { static LONG setItem(HWND cbex, int idx, LPTSTR text) {
...@@ -64,11 +64,11 @@ 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.iItem = idx;
cbexItem.pszText = text; cbexItem.pszText = text;
cbexItem.cchTextMax = 0; 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) { 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) { static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEM *cbItem) {
...@@ -77,7 +77,7 @@ 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->pszText = textBuffer;
cbItem->iItem = idx; cbItem->iItem = idx;
cbItem->cchTextMax = 100; 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) static LRESULT WINAPI editbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
......
...@@ -244,7 +244,7 @@ static LONG addItem(HWND hdex, int idx, LPSTR text) ...@@ -244,7 +244,7 @@ static LONG addItem(HWND hdex, int idx, LPSTR text)
hdItem.cxy = 100; hdItem.cxy = 100;
hdItem.pszText = text; hdItem.pszText = text;
hdItem.cchTextMax = 0; 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) 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) ...@@ -259,7 +259,7 @@ static LONG setItem(HWND hdex, int idx, LPSTR text, BOOL fCheckNotifies)
expect_notify(HDN_ITEMCHANGINGA, FALSE, &hdexItem); expect_notify(HDN_ITEMCHANGINGA, FALSE, &hdexItem);
expect_notify(HDN_ITEMCHANGEDA, 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) if (fCheckNotifies)
ok(notifies_received(), "setItem(): not all expected notifies were received\n"); ok(notifies_received(), "setItem(): not all expected notifies were received\n");
return ret; return ret;
...@@ -279,19 +279,19 @@ static LONG setItemUnicodeNotify(HWND hdex, int idx, LPSTR text, LPWSTR wText) ...@@ -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_ITEMCHANGINGW, TRUE, (HDITEMA*)&hdexNotify);
expect_notify(HDN_ITEMCHANGEDW, 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"); ok(notifies_received(), "setItemUnicodeNotify(): not all expected notifies were received\n");
return ret; return ret;
} }
static LONG delItem(HWND hdex, int idx) 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) 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) static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
...@@ -300,7 +300,7 @@ 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.mask = HDI_TEXT;
hdItem.pszText = textBuffer; hdItem.pszText = textBuffer;
hdItem.cchTextMax = MAX_CHARS; 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) static void addReadDelItem(HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
...@@ -748,10 +748,10 @@ static void test_header_control (void) ...@@ -748,10 +748,10 @@ static void test_header_control (void)
TEST_GET_ITEM(i, 4); TEST_GET_ITEM(i, 4);
TEST_GET_ITEMCOUNT(6); TEST_GET_ITEMCOUNT(6);
} }
SendMessageA(hWndHeader, HDM_SETUNICODEFORMAT, (WPARAM)TRUE, 0); SendMessageA(hWndHeader, HDM_SETUNICODEFORMAT, TRUE, 0);
setItemUnicodeNotify(hWndHeader, 3, pszUniTestA, pszUniTestW); 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); setItem(hWndHeader, 3, str_items[4], TRUE);
dont_expect_notify(HDN_GETDISPINFOA); dont_expect_notify(HDN_GETDISPINFOA);
......
...@@ -1553,7 +1553,7 @@ static void test_icon_spacing(void) ...@@ -1553,7 +1553,7 @@ static void test_icon_spacing(void)
hwnd = create_listview_control(LVS_ICON); hwnd = create_listview_control(LVS_ICON);
ok(hwnd != NULL, "failed to create a listview window\n"); 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); expect(NFR_ANSI, r);
/* reset the icon spacing to defaults */ /* reset the icon spacing to defaults */
......
...@@ -857,7 +857,7 @@ static void test_monthcal_firstDay(void) ...@@ -857,7 +857,7 @@ static void test_monthcal_firstDay(void)
/* checking for the values that actually will be stored as */ /* checking for the values that actually will be stored as */
/* current first day when we set a new value */ /* current first day when we set a new value */
for (i = -5; i < 12; i++){ for (i = -5; i < 12; i++){
res = SendMessage(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, (LPARAM) i); res = SendMessage(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, i);
expect(prev, res); expect(prev, res);
res = SendMessage(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0); res = SendMessage(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0);
prev = res; prev = res;
......
...@@ -87,7 +87,7 @@ static HWND build_toolbar(int nr, HWND hParent) ...@@ -87,7 +87,7 @@ static HWND build_toolbar(int nr, HWND hParent)
int i; int i;
ok(hToolbar != NULL, "Toolbar creation problem\n"); 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, TB_AUTOSIZE, 0, 0) == 0, "TB_AUTOSIZE failed\n");
ok(SendMessage(hToolbar, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0)==1, "WM_SETFONT\n"); ok(SendMessage(hToolbar, WM_SETFONT, (WPARAM)GetStockObject(SYSTEM_FONT), 0)==1, "WM_SETFONT\n");
......
...@@ -520,12 +520,12 @@ static void test_get_set_bkcolor(void) ...@@ -520,12 +520,12 @@ static void test_get_set_bkcolor(void)
ok(crColor == -1, "Default background color reported as 0x%.8x\n", crColor); ok(crColor == -1, "Default background color reported as 0x%.8x\n", crColor);
/* Test for black background */ /* 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 ); crColor = (COLORREF)SendMessage( hTree, TVM_GETBKCOLOR, 0, 0 );
ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8x\n", crColor); ok(crColor == RGB(0,0,0), "Black background color reported as 0x%.8x\n", crColor);
/* Test for white background */ /* 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 ); crColor = (COLORREF)SendMessage( hTree, TVM_GETBKCOLOR, 0, 0 );
ok(crColor == RGB(255,255,255), "White background color reported as 0x%.8x\n", crColor); 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) ...@@ -718,12 +718,12 @@ static void test_get_set_textcolor(void)
ok(crColor == -1, "Default text color reported as 0x%.8x\n", crColor); ok(crColor == -1, "Default text color reported as 0x%.8x\n", crColor);
/* Test for black text */ /* 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 ); crColor = (COLORREF)SendMessage( hTree, TVM_GETTEXTCOLOR, 0, 0 );
ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8x\n", crColor); ok(crColor == RGB(0,0,0), "Black text color reported as 0x%.8x\n", crColor);
/* Test for white text */ /* 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 ); crColor = (COLORREF)SendMessage( hTree, TVM_GETTEXTCOLOR, 0, 0 );
ok(crColor == RGB(255,255,255), "White text color reported as 0x%.8x\n", crColor); 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) ...@@ -785,7 +785,7 @@ static void test_get_set_unicodeformat(void)
ok(bNewSetting == 0, "ANSI setting did not work.\n"); ok(bNewSetting == 0, "ANSI setting did not work.\n");
/* Revert to original setting */ /* 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, ok_sequence(MsgSequences, TREEVIEW_SEQ_INDEX, test_get_set_unicodeformat_seq,
"test get set unicode format", FALSE); "test get set unicode format", FALSE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment