user32/tests: Fix pointer casting warnings on 64-bit.
authorAlexandre Julliard <julliard@winehq.org>
Sat, 3 Jan 2009 19:16:16 +0000 (20:16 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Sat, 3 Jan 2009 19:16:16 +0000 (20:16 +0100)
dlls/user32/tests/cursoricon.c
dlls/user32/tests/dde.c
dlls/user32/tests/listbox.c
dlls/user32/tests/menu.c

index 5d1cf2bde1e560bcbdd66c6c11517407bdfd5599..fc1ceaa7f8e1b197426ec0d23c3303d1505b9417 100644 (file)
@@ -175,7 +175,7 @@ static void do_parent(void)
     startup.dwFlags = STARTF_USESHOWWINDOW;
     startup.wShowWindow = SW_SHOWNORMAL;
 
-    sprintf(path_name, "%s cursoricon %x", test_argv[0], (unsigned int) parent);
+    sprintf(path_name, "%s cursoricon %lx", test_argv[0], (INT_PTR)parent);
     ok(CreateProcessA(NULL, path_name, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess failed.\n");
     child_process = info.hProcess;
 
index dafb68c00ffb75c2cfde0028a524acc784df6ef3..f11e0fecb4523d92d798f1b217020ebb0813a891 100644 (file)
@@ -160,7 +160,7 @@ static LRESULT WINAPI dde_server_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPA
         lstrcpyA((LPSTR)data->Value, str);
         GlobalUnlock(hglobal);
 
-        lparam = PackDDElParam(WM_DDE_ACK, (UINT)hglobal, HIWORD(lparam));
+        lparam = PackDDElParam(WM_DDE_ACK, (UINT_PTR)hglobal, HIWORD(lparam));
         PostMessageA(client, WM_DDE_DATA, (WPARAM)hwnd, lparam);
 
         break;
index c87235763355853364c4ed7521f6c6b4d58c00d5..6c89f6278f089f3122c25e8202f6b5e17e13c1ec 100644 (file)
@@ -50,7 +50,7 @@ static HWND
 create_listbox (DWORD add_style, HWND parent)
 {
   HWND handle;
-  int ctl_id=0;
+  INT_PTR ctl_id=0;
   if (parent)
     ctl_id=1;
   handle=CreateWindow ("LISTBOX", "TestList",
index adc9410d22c58ddd48cae5167640617839752b8b..c0a5f025ae050ae53bfacea2f467ad17f62ef2e6 100644 (file)
@@ -285,7 +285,7 @@ static void test_menu_ownerdraw(void)
                                NULL, NULL, NULL, NULL);
     ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
     if( !hwnd) return;
-    SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG)menu_ownerdraw_wnd_proc);
+    SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
     hmenu = CreatePopupMenu();
     ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError());
     if( !hmenu) { DestroyWindow(hwnd);return;}
@@ -538,7 +538,7 @@ static void test_menu_bmp_and_string(void)
 
     ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
     if( !hwnd) return;
-    SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG)menu_ownerdraw_wnd_proc);
+    SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc);
 
     if( winetest_debug)
         trace("    check %d,%d arrow %d avechar %d\n",
@@ -552,7 +552,7 @@ static void test_menu_bmp_and_string(void)
         for( szidx=0; szidx < sizeof( bmsizes) / sizeof( SIZE); szidx++) {
             HBITMAP hbm = CreateBitmap( bmsizes[szidx].cx, bmsizes[szidx].cy,1,1,bmfill);
             HBITMAP bitmaps[] = { HBMMENU_CALLBACK, hbm, NULL  };
-            ok( (int)hbm, "CreateBitmap failed err %d\n", GetLastError());
+            ok( hbm != 0, "CreateBitmap failed err %d\n", GetLastError());
             for( txtidx = 0; txtidx < sizeof(MOD_txtsizes)/sizeof(MOD_txtsizes[0]); txtidx++) {
                 for( hassub = 0; hassub < 2 ; hassub++) { /* add submenu item */
                     for( mnuopt = 0; mnuopt < 3 ; mnuopt++){ /* test MNS_NOCHECK/MNS_CHECKORBMP */
@@ -1607,7 +1607,7 @@ static void test_menu_search_bycommand( void )
 
     rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub2, FALSE, &info);
     ok (rc, "Getting the menus info failed\n");
-    ok (info.wID == (UINT)hmenuSub2, "IDs differ for popup menu\n");
+    ok (info.wID == (UINT_PTR)hmenuSub2, "IDs differ for popup menu\n");
     ok (!strcmp(info.dwTypeData, "Submenu2"), "Returned item has wrong label (%s)\n", info.dwTypeData);
 
     DestroyMenu( hmenu );
@@ -1872,7 +1872,7 @@ static void test_menu_flags( void )
     hMenu = CreateMenu();
     hPopupMenu = CreatePopupMenu();
 
-    AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT)hPopupMenu, "Popup");
+    AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup");
 
     AppendMenu(hPopupMenu, MF_STRING | MF_HILITE | MF_DEFAULT, 101, "Item 1");
     InsertMenu(hPopupMenu, 1, MF_BYPOSITION | MF_STRING | MF_HILITE | MF_DEFAULT, 102, "Item 2");
@@ -1920,7 +1920,7 @@ static void test_menu_hilitemenuitem( void )
     hMenu = CreateMenu();
     hPopupMenu = CreatePopupMenu();
 
-    AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT)hPopupMenu, "Popup");
+    AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup");
 
     AppendMenu(hPopupMenu, MF_STRING, 101, "Item 1");
     AppendMenu(hPopupMenu, MF_STRING, 102, "Item 2");
@@ -2053,7 +2053,7 @@ static void check_menu_items(HMENU hmenu, UINT checked_cmd, UINT checked_type,
 #endif
         if (mii.hSubMenu)
         {
-            ok((HMENU)mii.wID == mii.hSubMenu, "id %u: wID should be equal to hSubMenu\n", checked_cmd);
+            ok(mii.wID == (UINT_PTR)mii.hSubMenu, "id %u: wID should be equal to hSubMenu\n", checked_cmd);
             check_menu_items(mii.hSubMenu, checked_cmd, checked_type, checked_state);
         }
         else