Alexandre Julliard : comctl32/tests: Fix pointer casting warnings on 64-bit .

Alexandre Julliard julliard at winehq.org
Sun Jan 4 09:08:55 CST 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat Jan  3 20:13:20 2009 +0100

comctl32/tests: Fix pointer casting warnings on 64-bit.

---

 dlls/comctl32/tests/dpa.c      |   16 ++++++++--------
 dlls/comctl32/tests/subclass.c |    2 +-
 dlls/comctl32/tests/toolbar.c  |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/dlls/comctl32/tests/dpa.c b/dlls/comctl32/tests/dpa.c
index 08a7b02..a0d1920 100644
--- a/dlls/comctl32/tests/dpa.c
+++ b/dlls/comctl32/tests/dpa.c
@@ -182,7 +182,7 @@ static BOOL CheckDPA(HDPA dpa, DWORD dwIn, PDWORD pdwOut)
         
         do
         {
-            pDPA_InsertPtr(dpa, 0, (PVOID)(dwIn & 0xf));
+            pDPA_InsertPtr(dpa, 0, (PVOID)(ULONG_PTR)(dwIn & 0xf));
             dwIn >>= 4;
         }
         while(dwIn);
@@ -242,9 +242,9 @@ static void test_dpa(void)
     for(i = 1; i <= 6; i++)
     {
         INT j, k;
-        k = pDPA_GetPtrIndex(dpa, (PVOID)i);
+        k = pDPA_GetPtrIndex(dpa, (PVOID)(INT_PTR)i);
         /* Linear searches should work on unsorted DPAs */
-        j = pDPA_Search(dpa, (PVOID)i, 0, CB_CmpLT, 0xdeadbeef, 0);
+        j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, 0, CB_CmpLT, 0xdeadbeef, 0);
         ok(j == k, "j=%d k=%d\n", j, k);
     }
 
@@ -279,16 +279,16 @@ static void test_dpa(void)
         INT j;
 
         /* The array is in order so ptr == index+1 */
-        j = pDPA_GetPtrIndex(dpa, (PVOID)i);
+        j = pDPA_GetPtrIndex(dpa, (PVOID)(INT_PTR)i);
         ok(j+1 == i, "j=%d i=%d\n", j, i);
-        j = pDPA_Search(dpa, (PVOID)i, 0, CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
+        j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, 0, CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
         ok(j+1 == i, "j=%d i=%d\n", j, i);
 
         /* Linear searches respect iStart ... */
-        j = pDPA_Search(dpa, (PVOID)i, i+1, CB_CmpLT, 0xdeadbeef, 0);
+        j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, i+1, CB_CmpLT, 0xdeadbeef, 0);
         ok(j == DPA_ERR, "j=%d\n", j);
         /* ... but for a binary search it's ignored */
-        j = pDPA_Search(dpa, (PVOID)i, i+1, CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
+        j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, i+1, CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
         todo_wine ok(j+1 == i, "j=%d i=%d\n", j, i);
     }
     
@@ -331,7 +331,7 @@ static void test_dpa(void)
      * should be bogus */
     for(i = 0; i < 6; i++)
     {
-        INT j = pDPA_Search(dpa, (PVOID)i, 0, CB_CmpGT, 0xdeadbeef,
+        INT j = pDPA_Search(dpa, (PVOID)(INT_PTR)i, 0, CB_CmpGT, 0xdeadbeef,
                             DPAS_SORTED|DPAS_INSERTBEFORE);
         ok(j != i, "i=%d\n", i);
     }
diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c
index c225f72..f4d0b72 100644
--- a/dlls/comctl32/tests/subclass.c
+++ b/dlls/comctl32/tests/subclass.c
@@ -234,7 +234,7 @@ static void test_subclass(void)
     ok_sequence(Sub_AfterDeletedTest, "After Deleted");
 
     pSetWindowSubclass(hwnd, WndProcSub, 2, 0);
-    origProc3 = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG)WndProc3);
+    origProc3 = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)WndProc3);
     SendMessage(hwnd, WM_USER, 1, 0);
     SendMessage(hwnd, WM_USER, 2, 0);
     ok_sequence(Sub_OldAfterNewTest, "Old after New");
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 328ee2f..c92f3f2 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -1151,7 +1151,7 @@ static void test_setrows(void)
         memset(&rc, 0xCC, sizeof(rc));
         SendMessageA(hToolbar, TB_SETROWS,
                      MAKELONG(tbrows_results[i].nRows, tbrows_results[i].bLarger),
-                     (LONG) &rc);
+                     (LPARAM) &rc);
 
         rows = SendMessageA(hToolbar, TB_GETROWS, MAKELONG(0,0), MAKELONG(0,0));
         ok(rows == tbrows_results[i].expectedRows,




More information about the wine-cvs mailing list