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

This commit is contained in:
Alexandre Julliard 2009-01-08 13:18:01 +01:00
parent 02a1c0d7ee
commit d852ac0b1f
3 changed files with 12 additions and 12 deletions

View File

@ -54,7 +54,7 @@ static BOOL g_bInitialFocusInitDlgResult;
static int g_terminated; static int g_terminated;
typedef struct { typedef struct {
unsigned int id; INT_PTR id;
int parent; int parent;
DWORD style; DWORD style;
DWORD exstyle; DWORD exstyle;
@ -160,7 +160,7 @@ static BOOL CreateWindows (HINSTANCE hinst)
{ {
if (p->id >= sizeof(hwnd)/sizeof(hwnd[0])) 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; return FALSE;
} }
else else
@ -168,21 +168,21 @@ static BOOL CreateWindows (HINSTANCE hinst)
} }
if (p->id <= 0) 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; return FALSE;
} }
if (hwnd[p->id] != 0) 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; return FALSE;
} }
/* Create the control */ /* 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); 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]) if (!hwnd[p->id])
{ {
trace ("Failed to create control %d\n", p->id); trace ("Failed to create control %ld\n", p->id);
return FALSE; return FALSE;
} }
@ -196,7 +196,7 @@ static BOOL CreateWindows (HINSTANCE hinst)
exstyle = GetWindowLong (hwnd[p->id], GWL_EXSTYLE); exstyle = GetWindowLong (hwnd[p->id], GWL_EXSTYLE);
if (style != p->style || exstyle != p->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++; p++;

View File

@ -8263,7 +8263,7 @@ static void test_DestroyWindow(void)
{ {
BOOL ret; BOOL ret;
HWND parent, child1, child2, child3, child4, test; 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, parent = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
100, 100, 200, 200, 0, 0, 0, NULL); 100, 100, 200, 200, 0, 0, 0, NULL);

View File

@ -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) static void test_window_tree(HWND parent, const DWORD *style, const int *order, int total)
{ {
HWND child[5], hwnd; HWND child[5], hwnd;
int i; INT_PTR i;
assert(total <= 5); assert(total <= 5);
@ -1993,7 +1993,7 @@ static void test_window_tree(HWND parent, const DWORD *style, const int *order,
else else
child[i] = CreateWindowExA(0, "static", "", style[i], 0,0,10,10, child[i] = CreateWindowExA(0, "static", "", style[i], 0,0,10,10,
parent, (HMENU)i, 0, NULL); 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"); 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++) for (i = 0; i < total; i++)
{ {
trace("hwnd[%d] = %p\n", i, hwnd); trace("hwnd[%ld] = %p\n", i, hwnd);
ok(child[order[i]] == hwnd, "Z order of child #%d is wrong\n", i); ok(child[order[i]] == hwnd, "Z order of child #%ld is wrong\n", i);
hwnd = GetWindow(hwnd, GW_HWNDNEXT); hwnd = GetWindow(hwnd, GW_HWNDNEXT);
} }