user32/tests: Remove some explicit LPARAM/WPARAM casts.

Michael Stefaniuc mstefani at redhat.de
Sun Dec 27 07:40:19 CST 2009


The same casts happen implicitly.
---
 dlls/user32/tests/edit.c    |   40 ++++++++++++++++++++--------------------
 dlls/user32/tests/listbox.c |   16 ++++++++--------
 dlls/user32/tests/msg.c     |    4 ++--
 3 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c
index 2ef8fd0..3b38d30 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -1070,11 +1070,11 @@ static void test_edit_control_4(void)
     mid = lo + (hi - lo) / 2;
 
     for (i = lo; i < mid; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok(0 == ret, "expected 0 got %d\n", ret);
     }
     for (i = mid; i <= hi; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok(1 == ret, "expected 1 got %d\n", ret);
     }
     ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
@@ -1088,11 +1088,11 @@ static void test_edit_control_4(void)
     mid = lo + (hi - lo) / 2;
 
     for (i = lo; i < mid; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok(0 == ret, "expected 0 got %d\n", ret);
     }
     for (i = mid; i <= hi; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok(1 == ret, "expected 1 got %d\n", ret);
     }
     ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
@@ -1106,11 +1106,11 @@ static void test_edit_control_4(void)
     mid = lo + (hi - lo) / 2;
 
     for (i = lo; i < mid; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok(0 == ret, "expected 0 got %d\n", ret);
     }
     for (i = mid; i <= hi; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok(1 == ret, "expected 1 got %d\n", ret);
     }
     ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
@@ -1124,11 +1124,11 @@ static void test_edit_control_4(void)
     mid = lo + (hi - lo) / 2 +1;
 
     for (i = lo; i < mid; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret);
     }
     for (i = mid; i <= hi; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok(1 == ret, "expected 1 got %d\n", ret);
     }
     ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
@@ -1142,11 +1142,11 @@ static void test_edit_control_4(void)
     mid = lo + (hi - lo) / 2 +1;
 
     for (i = lo; i < mid; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret);
     }
     for (i = mid; i <= hi; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok(1 == ret, "expected 1 got %d\n", ret);
     }
     ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
@@ -1160,11 +1160,11 @@ static void test_edit_control_4(void)
     mid = lo + (hi - lo) / 2 +1;
 
     for (i = lo; i < mid; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret);
     }
     for (i = mid; i <= hi; i++) {
-       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i));
+       ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i));
        ok(1 == ret, "expected 1 got %d\n", ret);
     }
     ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0);
@@ -1524,7 +1524,7 @@ static void test_text_position_style(DWORD style)
     /* Edit controls that are in a parent window */
        
     hwEdit = create_child_editcontrol(style | WS_VISIBLE, 0);
-    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE);
+    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
     if (single_line)
     check_pos(hwEdit, metrics.tmHeight -  1, 0, metrics.tmHeight - 1, 0);
     check_pos(hwEdit, metrics.tmHeight     , 0, metrics.tmHeight    , 0);
@@ -1534,7 +1534,7 @@ static void test_text_position_style(DWORD style)
     destroy_child_editcontrol(hwEdit);
 
     hwEdit = create_child_editcontrol(style | WS_BORDER | WS_VISIBLE, 0);
-    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE);
+    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
     if (single_line)
     check_pos(hwEdit, metrics.tmHeight -  1, 0, metrics.tmHeight - 1, b);
     check_pos(hwEdit, metrics.tmHeight     , 0, metrics.tmHeight    , b);
@@ -1545,7 +1545,7 @@ static void test_text_position_style(DWORD style)
     destroy_child_editcontrol(hwEdit);
 
     hwEdit = create_child_editcontrol(style | WS_VISIBLE, WS_EX_CLIENTEDGE);
-    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE);
+    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
     if (single_line)
     check_pos(hwEdit, metrics.tmHeight -  1, 0, metrics.tmHeight - 1, 1);
     check_pos(hwEdit, metrics.tmHeight     , 0, metrics.tmHeight    , 1);
@@ -1555,7 +1555,7 @@ static void test_text_position_style(DWORD style)
     destroy_child_editcontrol(hwEdit);
 
     hwEdit = create_child_editcontrol(style | WS_BORDER | WS_VISIBLE, WS_EX_CLIENTEDGE);
-    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE);
+    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
     if (single_line)
     check_pos(hwEdit, metrics.tmHeight -  1, 0, metrics.tmHeight - 1, 1);
     check_pos(hwEdit, metrics.tmHeight     , 0, metrics.tmHeight    , 1);
@@ -1568,7 +1568,7 @@ static void test_text_position_style(DWORD style)
     /* Edit controls that are popup windows */
     
     hwEdit = create_editcontrol(style | WS_POPUP, 0);
-    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE);
+    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
     if (single_line)
     check_pos(hwEdit, metrics.tmHeight -  1, 0, metrics.tmHeight - 1, 0);
     check_pos(hwEdit, metrics.tmHeight     , 0, metrics.tmHeight    , 0);
@@ -1578,7 +1578,7 @@ static void test_text_position_style(DWORD style)
     DestroyWindow(hwEdit);
 
     hwEdit = create_editcontrol(style | WS_POPUP | WS_BORDER, 0);
-    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE);
+    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
     if (single_line)
     check_pos(hwEdit, metrics.tmHeight -  1, 0, metrics.tmHeight - 1, b);
     check_pos(hwEdit, metrics.tmHeight     , 0, metrics.tmHeight    , b);
@@ -1589,7 +1589,7 @@ static void test_text_position_style(DWORD style)
     DestroyWindow(hwEdit);
 
     hwEdit = create_editcontrol(style | WS_POPUP, WS_EX_CLIENTEDGE);
-    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE);
+    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
     if (single_line)
     check_pos(hwEdit, metrics.tmHeight -  1, 0, metrics.tmHeight - 1, 1);
     check_pos(hwEdit, metrics.tmHeight     , 0, metrics.tmHeight    , 1);
@@ -1599,7 +1599,7 @@ static void test_text_position_style(DWORD style)
     DestroyWindow(hwEdit);
 
     hwEdit = create_editcontrol(style | WS_POPUP | WS_BORDER, WS_EX_CLIENTEDGE);
-    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE);
+    SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE);
     if (single_line)
     check_pos(hwEdit, metrics.tmHeight -  1, 0, metrics.tmHeight - 1, 1);
     check_pos(hwEdit, metrics.tmHeight     , 0, metrics.tmHeight    , 1);
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c
index 942c780..06c41d4 100644
--- a/dlls/user32/tests/listbox.c
+++ b/dlls/user32/tests/listbox.c
@@ -146,7 +146,7 @@ check (const struct listbox_test test)
   listbox_query (hLB, &answer);
   listbox_ok (test, init, answer);
 
-  SendMessage (hLB, LB_GETITEMRECT, (WPARAM) 1, (LPARAM) &second_item);
+  SendMessage (hLB, LB_GETITEMRECT, 1, (LPARAM) &second_item);
   buttonpress(hLB, (WORD)second_item.left, (WORD)second_item.top);
 
   listbox_query (hLB, &answer);
@@ -354,7 +354,7 @@ static void test_selection(void)
     listbox_query(hLB, &answer);
     listbox_test_query(test_1, answer);
 
-    SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1);
+    SendMessage(hLB, LB_SETSEL, FALSE, -1);
     listbox_query(hLB, &answer);
     listbox_test_query(test_nosel, answer);
 
@@ -363,7 +363,7 @@ static void test_selection(void)
     listbox_query(hLB, &answer);
     listbox_test_query(test_3, answer);
 
-    SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1);
+    SendMessage(hLB, LB_SETSEL, FALSE, -1);
     listbox_query(hLB, &answer);
     listbox_test_query(test_nosel, answer);
 
@@ -372,7 +372,7 @@ static void test_selection(void)
     listbox_query(hLB, &answer);
     listbox_test_query(test_nosel, answer);
 
-    SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1);
+    SendMessage(hLB, LB_SETSEL, FALSE, -1);
     listbox_query(hLB, &answer);
     listbox_test_query(test_nosel, answer);
 
@@ -381,7 +381,7 @@ static void test_selection(void)
     listbox_query(hLB, &answer);
     listbox_test_query(test_1, answer);
 
-    SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1);
+    SendMessage(hLB, LB_SETSEL, FALSE, -1);
     listbox_query(hLB, &answer);
     listbox_test_query(test_nosel, answer);
 
@@ -390,7 +390,7 @@ static void test_selection(void)
     listbox_query(hLB, &answer);
     listbox_test_query(test_nosel, answer);
 
-    SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1);
+    SendMessage(hLB, LB_SETSEL, FALSE, -1);
     listbox_query(hLB, &answer);
     listbox_test_query(test_nosel, answer);
 
@@ -399,7 +399,7 @@ static void test_selection(void)
     listbox_query(hLB, &answer);
     listbox_test_query(test_2, answer);
 
-    SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1);
+    SendMessage(hLB, LB_SETSEL, FALSE, -1);
     listbox_query(hLB, &answer);
     listbox_test_query(test_nosel, answer);
 
@@ -1112,7 +1112,7 @@ static void test_listbox_dlgdir(void)
         "expected conversion to uppercase, got %s\n", pathBuffer);
 
     /* Loaded path should have overwritten the label text */
-    SendMessage(g_label, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)pathBuffer);
+    SendMessage(g_label, WM_GETTEXT, MAX_PATH, (LPARAM)pathBuffer);
     trace("Static control after DlgDirList: %s\n", pathBuffer);
     ok (strcmp("default contents", pathBuffer), "DlgDirList() did not modify static control!\n");
 
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index d6d8b6a..7be49ed 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -6869,8 +6869,8 @@ static const struct message WmVkAppsSeq[] = {
     { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_APPS, 0xc0000001 }, /* XP */
     { WM_KEYUP, wparam|lparam, VK_APPS, 0xc0000001 },
     { WM_KEYUP, sent|wparam|lparam, VK_APPS, 0xc0000001 },
-    { WM_CONTEXTMENU, lparam, /*hwnd*/0, (LPARAM)-1 },
-    { WM_CONTEXTMENU, sent|lparam, /*hwnd*/0, (LPARAM)-1 },
+    { WM_CONTEXTMENU, lparam, /*hwnd*/0, -1 },
+    { WM_CONTEXTMENU, sent|lparam, /*hwnd*/0, -1 },
     { 0 }
 };
 static const struct message WmVkF10Seq[] = {
-- 
1.6.6.rc4



More information about the wine-patches mailing list