Michael Stefaniuc : comctl32: Do not cast zero.

Alexandre Julliard julliard at winehq.org
Tue Nov 4 07:29:15 CST 2008


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Mon Nov  3 22:43:40 2008 +0100

comctl32: Do not cast zero.

---

 dlls/comctl32/comboex.c       |    5 ++---
 dlls/comctl32/monthcal.c      |    8 ++++----
 dlls/comctl32/propsheet.c     |    3 +--
 dlls/comctl32/tests/header.c  |   22 +++++++++++-----------
 dlls/comctl32/tests/status.c  |    4 ++--
 dlls/comctl32/tests/toolbar.c |    4 ++--
 dlls/comctl32/toolbar.c       |    2 +-
 7 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
index a5dfc01..f576eee 100644
--- a/dlls/comctl32/comboex.c
+++ b/dlls/comctl32/comboex.c
@@ -431,10 +431,9 @@ static void COMBOEX_ReSize (COMBOEX_INFO *infoPtr)
 	cy = max (iinfo.rcImage.bottom - iinfo.rcImage.top, cy);
 	TRACE("upgraded height due to image:  height=%d\n", cy);
     }
-    SendMessageW (infoPtr->hwndSelf, CB_SETITEMHEIGHT, (WPARAM)-1, (LPARAM)cy);
+    SendMessageW (infoPtr->hwndSelf, CB_SETITEMHEIGHT, -1, cy);
     if (infoPtr->hwndCombo) {
-        SendMessageW (infoPtr->hwndCombo, CB_SETITEMHEIGHT,
-		      (WPARAM) 0, (LPARAM) cy);
+        SendMessageW (infoPtr->hwndCombo, CB_SETITEMHEIGHT, 0, cy);
 	if ( !(infoPtr->flags & CBES_EX_NOSIZELIMIT)) {
 	    RECT comboRect;
 	    if (GetWindowRect(infoPtr->hwndCombo, &comboRect)) {
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index e3e4d2a..8cae0db 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -1393,7 +1393,7 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
 
   if (infoPtr->hWndYearUpDown)
     {
-      infoPtr->currentYear=SendMessageW( infoPtr->hWndYearUpDown, UDM_SETPOS,   (WPARAM) 0,(LPARAM)0);
+      infoPtr->currentYear=SendMessageW(infoPtr->hWndYearUpDown, UDM_SETPOS, 0, 0);
       if(!DestroyWindow(infoPtr->hWndYearUpDown))
 	{
 	  FIXME("Can't destroy Updown Control\n");
@@ -1474,9 +1474,9 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
 			 NULL,
 			 NULL,
 			 NULL);
-    SendMessageW( infoPtr->hWndYearUpDown, UDM_SETRANGE, (WPARAM) 0, MAKELONG (9999, 1753));
-    SendMessageW( infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM) infoPtr->hWndYearEdit, (LPARAM)0 );
-    SendMessageW( infoPtr->hWndYearUpDown, UDM_SETPOS,   (WPARAM) 0,(LPARAM)infoPtr->currentYear );
+    SendMessageW(infoPtr->hWndYearUpDown, UDM_SETRANGE, 0, MAKELONG (9999, 1753));
+    SendMessageW(infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM) infoPtr->hWndYearEdit, 0);
+    SendMessageW(infoPtr->hWndYearUpDown, UDM_SETPOS, 0, infoPtr->currentYear);
     return 0;
 
   }
diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index 8b60a3c..7c2f26a 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -3479,8 +3479,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
 
       if (psInfo->useCallback)
-             (*(psInfo->ppshheader.pfnCallback))(hwnd,
-					      PSCB_INITIALIZED, (LPARAM)0);
+             (*(psInfo->ppshheader.pfnCallback))(hwnd, PSCB_INITIALIZED, 0);
 
       idx = psInfo->active_page;
       psInfo->active_page = -1;
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index fd0c4c4..dc61a75 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -304,11 +304,11 @@ static LONG getItem(HWND hdex, int idx, LPSTR textBuffer)
 
 static void addReadDelItem(HWND hdex, HDITEMA *phdiCreate, int maskRead, HDITEMA *phdiRead)
 {
-    ok(SendMessage(hdex, HDM_INSERTITEMA, (WPARAM)0, (LPARAM)phdiCreate)!=-1, "Adding item failed\n");
+    ok(SendMessage(hdex, HDM_INSERTITEMA, 0, (LPARAM)phdiCreate)!=-1, "Adding item failed\n");
     ZeroMemory(phdiRead, sizeof(HDITEMA));
     phdiRead->mask = maskRead;
-    ok(SendMessage(hdex, HDM_GETITEMA, (WPARAM)0, (LPARAM)phdiRead)!=0, "Getting item data failed\n");
-    ok(SendMessage(hdex, HDM_DELETEITEM, (WPARAM)0, (LPARAM)0)!=0, "Deleting item failed\n");
+    ok(SendMessage(hdex, HDM_GETITEMA, 0, (LPARAM)phdiRead)!=0, "Getting item data failed\n");
+    ok(SendMessage(hdex, HDM_DELETEITEM, 0, 0)!=0, "Deleting item failed\n");
 }
 
 static HWND create_header_control (void)
@@ -661,24 +661,24 @@ static void check_mask(void)
     hdi.iOrder = 0;
     hdi.lParam = 17;
     hdi.cchTextMax = 260;
-    ret = SendMessage(hWndHeader, HDM_INSERTITEM, (WPARAM)0, (LPARAM)&hdi);
+    ret = SendMessage(hWndHeader, HDM_INSERTITEM, 0, (LPARAM)&hdi);
     ok(ret == -1, "Creating an item with a zero mask should have failed\n");
-    if (ret != -1) SendMessage(hWndHeader, HDM_DELETEITEM, (WPARAM)0, (LPARAM)0);
+    if (ret != -1) SendMessage(hWndHeader, HDM_DELETEITEM, 0, 0);
 
     /* with a non-zero mask creation will succeed */
     ZeroMemory(&hdi, sizeof(hdi));
     hdi.mask = HDI_LPARAM;
-    ret = SendMessage(hWndHeader, HDM_INSERTITEM, (WPARAM)0, (LPARAM)&hdi);
+    ret = SendMessage(hWndHeader, HDM_INSERTITEM, 0, (LPARAM)&hdi);
     ok(ret != -1, "Adding item with non-zero mask failed\n");
     if (ret != -1)
-        SendMessage(hWndHeader, HDM_DELETEITEM, (WPARAM)0, (LPARAM)0);
+        SendMessage(hWndHeader, HDM_DELETEITEM, 0, 0);
 
     /* in SETITEM if the mask contains a unknown bit, it is ignored */
     ZeroMemory(&hdi, sizeof(hdi));
     hdi.mask = 0x08000000 | HDI_LPARAM | HDI_IMAGE;
     hdi.lParam = 133;
     hdi.iImage = 17;
-    ret = SendMessage(hWndHeader, HDM_INSERTITEM, (WPARAM)0, (LPARAM)&hdi);
+    ret = SendMessage(hWndHeader, HDM_INSERTITEM, 0, (LPARAM)&hdi);
     ok(ret != -1, "Adding item failed\n");
 
     if (ret != -1)
@@ -686,18 +686,18 @@ static void check_mask(void)
         /* check result */
         ZeroMemory(&hdi, sizeof(hdi));
         hdi.mask = HDI_LPARAM | HDI_IMAGE;
-        SendMessage(hWndHeader, HDM_GETITEM, (WPARAM)0, (LPARAM)&hdi);
+        SendMessage(hWndHeader, HDM_GETITEM, 0, (LPARAM)&hdi);
         ok(hdi.lParam == 133, "comctl32 4.0 field not set\n");
         ok(hdi.iImage == 17, "comctl32 >4.0 field not set\n");
 
         /* but in GETITEM if an unknown bit is set, comctl32 uses only version 4.0 fields */
         ZeroMemory(&hdi, sizeof(hdi));
         hdi.mask = 0x08000000 | HDI_LPARAM | HDI_IMAGE;
-        SendMessage(hWndHeader, HDM_GETITEM, (WPARAM)0, (LPARAM)&hdi);
+        SendMessage(hWndHeader, HDM_GETITEM, 0, (LPARAM)&hdi);
         ok(hdi.lParam == 133, "comctl32 4.0 field not read\n");
         ok(hdi.iImage == 0, "comctl32 >4.0 field shouldn't be read\n");
 
-        SendMessage(hWndHeader, HDM_DELETEITEM, (WPARAM)0, (LPARAM)0);
+        SendMessage(hWndHeader, HDM_DELETEITEM, 0, 0);
     }
 }
 
diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c
index a7c80c6..e5b9155 100644
--- a/dlls/comctl32/tests/status.c
+++ b/dlls/comctl32/tests/status.c
@@ -347,8 +347,8 @@ static void test_status_control(void)
     expect(TRUE,r);
 
     /* Set the minimum height and get rectangle information again */
-    SendMessage(hWndStatus, SB_SETMINHEIGHT, 50, (LPARAM) 0);
-    r = SendMessage(hWndStatus, WM_SIZE, 0, (LPARAM) 0);
+    SendMessage(hWndStatus, SB_SETMINHEIGHT, 50, 0);
+    r = SendMessage(hWndStatus, WM_SIZE, 0, 0);
     expect(0,r);
     r = SendMessage(hWndStatus, SB_GETRECT, 0, (LPARAM)&rc);
     expect(TRUE,r);
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 8e54a76..e648ed8 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -114,7 +114,7 @@ static void basic_test(void)
         WS_VISIBLE | WS_CLIPCHILDREN | CCS_TOP |
         WS_CHILD | TBSTYLE_LIST,
         100,
-        0, NULL, (UINT)0,
+        0, NULL, 0,
         buttons, sizeof(buttons)/sizeof(buttons[0]),
         0, 0, 20, 16, sizeof(TBBUTTON));
     ok(hToolbar != NULL, "Toolbar creation\n");
@@ -1084,7 +1084,7 @@ static void test_setrows(void)
         WS_VISIBLE | WS_CLIPCHILDREN | WS_CHILD | CCS_NORESIZE | CCS_NOPARENTALIGN
         | CCS_NOMOVEY | CCS_TOP,
         0,
-        0, NULL, (UINT)0,
+        0, NULL, 0,
         buttons, sizeof(buttons)/sizeof(buttons[0]),
         20, 20, 0, 0, sizeof(TBBUTTON));
     ok(hToolbar != NULL, "Toolbar creation\n");
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 6a6eeb4..c2f602f 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -5177,7 +5177,7 @@ TOOLBAR_SetVersion (HWND hwnd, INT iVersion)
     infoPtr->iVersion = iVersion;
 
     if (infoPtr->iVersion >= 5)
-        TOOLBAR_SetUnicodeFormat(hwnd, (WPARAM)TRUE, (LPARAM)0);
+        TOOLBAR_SetUnicodeFormat(hwnd, TRUE, 0);
 
     return iOldVersion;
 }




More information about the wine-cvs mailing list