Alexandre Julliard : user32/tests: Fix some integer to pointer conversion warnings.

Alexandre Julliard julliard at winehq.org
Thu Jan 8 08:31:08 CST 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jan  8 13:18:01 2009 +0100

user32/tests: Fix some integer to pointer conversion warnings.

---

 dlls/user32/tests/dialog.c |   14 +++++++-------
 dlls/user32/tests/msg.c    |    2 +-
 dlls/user32/tests/win.c    |    8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c
index f92566c..3f07bd3 100644
--- a/dlls/user32/tests/dialog.c
+++ b/dlls/user32/tests/dialog.c
@@ -54,7 +54,7 @@ static BOOL g_bInitialFocusInitDlgResult;
 static int g_terminated;
 
 typedef struct {
-    unsigned int id;
+    INT_PTR id;
     int parent;
     DWORD style;
     DWORD exstyle;
@@ -160,7 +160,7 @@ static BOOL CreateWindows (HINSTANCE hinst)
         {
             if (p->id >=  sizeof(hwnd)/sizeof(hwnd[0]))
             {
-                trace ("Control %d is out of range\n", p->id);
+                trace ("Control %ld is out of range\n", p->id);
                 return FALSE;
             }
             else
@@ -168,21 +168,21 @@ static BOOL CreateWindows (HINSTANCE hinst)
         }
         if (p->id <= 0)
         {
-            trace ("Control %d is out of range\n", p->id);
+            trace ("Control %ld is out of range\n", p->id);
             return FALSE;
         }
         if (hwnd[p->id] != 0)
         {
-            trace ("Control %d is used more than once\n", p->id);
+            trace ("Control %ld is used more than once\n", p->id);
             return FALSE;
         }
 
         /* Create the control */
-        sprintf (ctrlname, "ctrl%4.4d", p->id);
+        sprintf (ctrlname, "ctrl%4.4ld", p->id);
         hwnd[p->id] = CreateWindowEx (p->exstyle, TEXT(p->parent ? "static" : "GetNextDlgItemWindowClass"), TEXT(ctrlname), p->style, 10, 10, 10, 10, hwnd[p->parent], p->parent ? (HMENU) (2000 + p->id) : 0, hinst, 0);
         if (!hwnd[p->id])
         {
-            trace ("Failed to create control %d\n", p->id);
+            trace ("Failed to create control %ld\n", p->id);
             return FALSE;
         }
 
@@ -196,7 +196,7 @@ static BOOL CreateWindows (HINSTANCE hinst)
             exstyle = GetWindowLong (hwnd[p->id], GWL_EXSTYLE);
             if (style != p->style || exstyle != p->exstyle)
             {
-                trace ("Style mismatch at %d: %8.8x %8.8x cf %8.8x %8.8x\n", p->id, style, exstyle, p->style, p->exstyle);
+                trace ("Style mismatch at %ld: %8.8x %8.8x cf %8.8x %8.8x\n", p->id, style, exstyle, p->style, p->exstyle);
             }
         }
         p++;
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 9ad9fde..b77a102 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -8263,7 +8263,7 @@ static void test_DestroyWindow(void)
 {
     BOOL ret;
     HWND parent, child1, child2, child3, child4, test;
-    UINT child_id = WND_CHILD_ID + 1;
+    UINT_PTR child_id = WND_CHILD_ID + 1;
 
     parent = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
 			     100, 100, 200, 200, 0, 0, 0, NULL);
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 4bb495c..99b58c0 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -1972,7 +1972,7 @@ static void test_SetMenu(HWND parent)
 static void test_window_tree(HWND parent, const DWORD *style, const int *order, int total)
 {
     HWND child[5], hwnd;
-    int i;
+    INT_PTR i;
 
     assert(total <= 5);
 
@@ -1993,7 +1993,7 @@ static void test_window_tree(HWND parent, const DWORD *style, const int *order,
         else
             child[i] = CreateWindowExA(0, "static", "", style[i], 0,0,10,10,
                                        parent, (HMENU)i, 0, NULL);
-        trace("child[%d] = %p\n", i, child[i]);
+        trace("child[%ld] = %p\n", i, child[i]);
         ok(child[i] != 0, "CreateWindowEx failed to create child window\n");
     }
 
@@ -2004,8 +2004,8 @@ static void test_window_tree(HWND parent, const DWORD *style, const int *order,
 
     for (i = 0; i < total; i++)
     {
-        trace("hwnd[%d] = %p\n", i, hwnd);
-        ok(child[order[i]] == hwnd, "Z order of child #%d is wrong\n", i);
+        trace("hwnd[%ld] = %p\n", i, hwnd);
+        ok(child[order[i]] == hwnd, "Z order of child #%ld is wrong\n", i);
 
         hwnd = GetWindow(hwnd, GW_HWNDNEXT);
     }




More information about the wine-cvs mailing list