comctl32/tests: Removed sign comparison warning in header tests.

Marko Nikolic grkoma at gmail.com
Wed Oct 5 08:23:10 CDT 2011


---
 dlls/comctl32/tests/header.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index 08d5065..c73be49 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -29,7 +29,7 @@
 
 typedef struct tagEXPECTEDNOTIFY
 {
-    INT iCode;
+    UINT Code;
     BOOL fUnicode;
     HDITEMA hdItem;
 } EXPECTEDNOTIFY;
@@ -40,12 +40,12 @@ static CUSTOMDRAWPROC g_CustomDrawProc;
 static int g_CustomDrawCount;
 static DRAWITEMSTRUCT g_DrawItem;
 static BOOL g_DrawItemReceived;
-static DWORD g_customheight;
+static INT g_customheight;
 
 static EXPECTEDNOTIFY expectedNotify[10];
 static INT nExpectedNotify = 0;
 static INT nReceivedNotify = 0;
-static INT unexpectedNotify[10];
+static UINT unexpectedNotify[10];
 static INT nUnexpectedNotify = 0;
 
 static HWND hHeaderParentWnd;
@@ -217,7 +217,7 @@ static const struct message bitmapmarginMessages_seq[] = {
 static void expect_notify(INT iCode, BOOL fUnicode, HDITEMA *lpItem)
 {
     assert(nExpectedNotify < 10);
-    expectedNotify[nExpectedNotify].iCode = iCode;
+    expectedNotify[nExpectedNotify].Code = iCode;
     expectedNotify[nExpectedNotify].fUnicode = fUnicode;
     expectedNotify[nExpectedNotify].hdItem = *lpItem;
     nExpectedNotify++;
@@ -1334,14 +1334,14 @@ static void test_hds_nosizing(HWND hParent)
 
 #define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom) \
     ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %d\n", draw_stage, nm->dwDrawStage); \
-    if (item_spec != -1) \
+    if (item_spec != ~0u /*-1*/) \
         ok(nm->dwItemSpec == item_spec, "Invalid dwItemSpec %d vs %ld\n", item_spec, nm->dwItemSpec); \
     ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %ld\n", lparam, nm->lItemlParam); \
     ok((nm->rc.top == _top && nm->rc.bottom == _bottom && nm->rc.left == _left && nm->rc.right == _right) || \
         broken(draw_stage != CDDS_ITEMPREPAINT), /* comctl32 < 5.80 */ \
         "Invalid rect (%d,%d) (%d,%d) vs (%d,%d) (%d,%d)\n", _left, _top, _right, _bottom, \
         nm->rc.left, nm->rc.top, nm->rc.right, nm->rc.bottom);
-
+        
 static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
 {
     if (nm == NULL) {  /* test ended */
@@ -1353,7 +1353,7 @@ static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
     {
     case 0:
         /* don't test dwItemSpec - it's 0 no comctl5 but 1308756 on comctl6 */
-        TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
+        TEST_NMCUSTOMDRAW(CDDS_PREPAINT, ~0u/*-1*/, 0, 0, 0, 670, g_customheight);
         return 0;
     }
 
@@ -1371,7 +1371,7 @@ static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm)
     switch (n)
     {
     case 0:
-        TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
+        TEST_NMCUSTOMDRAW(CDDS_PREPAINT, ~0u/*-1*/, 0, 0, 0, 670, g_customheight);
         return CDRF_NOTIFYITEMDRAW;
     case 1:
         TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 0, 0, 0, 0, 50, g_customheight);
@@ -1398,7 +1398,7 @@ static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm)
     switch (n)
     {
     case 0:
-        TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
+        TEST_NMCUSTOMDRAW(CDDS_PREPAINT, ~0u/*-1*/, 0, 0, 0, 670, g_customheight);
         return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYPOSTERASE|CDRF_NOTIFYPOSTPAINT|CDRF_SKIPDEFAULT;
     case 1:
         TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 0, 0, 0, 0, 50, g_customheight);
@@ -1410,7 +1410,7 @@ static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm)
         TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight);
         return 0;
     case 4:
-        TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, g_customheight);
+        TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, ~0u/*-1*/, 0, 0, 0, 670, g_customheight);
         return 0;
     }
 
@@ -1429,7 +1429,7 @@ static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm)
     switch (n)
     {
     case 0:
-        TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight);
+        TEST_NMCUSTOMDRAW(CDDS_PREPAINT, ~0u/*-1*/, 0, 0, 0, 670, g_customheight);
         return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYPOSTPAINT;
     case 1:
         TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 0, 0, 0, 0, 50, g_customheight);
@@ -1438,7 +1438,7 @@ static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm)
         TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight);
         return 0;
     case 3:
-        TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, g_customheight);
+        TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, ~0u/*-1*/, 0, 0, 0, 670, g_customheight);
         return 0;
     }
 
@@ -1602,7 +1602,7 @@ static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
             break;
 
         expected = &expectedNotify[nReceivedNotify];
-        if (hdr->hdr.code != expected->iCode)
+        if (hdr->hdr.code != expected->Code)
             break;
         
         nReceivedNotify++;
-- 
1.7.4.1




More information about the wine-patches mailing list