Michael Stefaniuc : comctl32: Do not cast NULL.
Alexandre Julliard
julliard at winehq.org
Mon Nov 3 09:06:58 CST 2008
Module: wine
Branch: master
Commit: d4b8948ce35aaf2ae61dbff9b804f95856becee3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d4b8948ce35aaf2ae61dbff9b804f95856becee3
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Sun Nov 2 00:22:49 2008 +0100
comctl32: Do not cast NULL.
---
dlls/comctl32/dpa.c | 2 +-
dlls/comctl32/listview.c | 2 +-
dlls/comctl32/tab.c | 2 +-
dlls/comctl32/tests/datetime.c | 4 ++--
dlls/comctl32/tests/monthcal.c | 2 +-
dlls/comctl32/tests/status.c | 4 ++--
dlls/comctl32/tests/tab.c | 2 +-
dlls/comctl32/tests/toolbar.c | 8 ++++----
dlls/comctl32/tests/trackbar.c | 2 +-
dlls/comctl32/treeview.c | 2 +-
10 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/dlls/comctl32/dpa.c b/dlls/comctl32/dpa.c
index e5f98b9..a14c530 100644
--- a/dlls/comctl32/dpa.c
+++ b/dlls/comctl32/dpa.c
@@ -106,7 +106,7 @@ HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
if (!phDpa || !loadProc || !pStream)
return E_INVALIDARG;
- *phDpa = (HDPA)NULL;
+ *phDpa = NULL;
position.QuadPart = 0;
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 0c5ec3e..47d79d6 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -8056,7 +8056,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
if (!infoPtr->hwndHeader) return -1;
/* set header unicode format */
- SendMessageW(infoPtr->hwndHeader, HDM_SETUNICODEFORMAT, (WPARAM)TRUE, (LPARAM)NULL);
+ SendMessageW(infoPtr->hwndHeader, HDM_SETUNICODEFORMAT, TRUE, 0);
/* set header font */
SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, (LPARAM)TRUE);
diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c
index e1abd16..0afcc77 100644
--- a/dlls/comctl32/tab.c
+++ b/dlls/comctl32/tab.c
@@ -459,7 +459,7 @@ static BOOL TAB_InternalGetItemRect(
static inline BOOL
TAB_GetItemRect(const TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
- return TAB_InternalGetItemRect(infoPtr, (INT)wParam, (LPRECT)lParam, (LPRECT)NULL);
+ return TAB_InternalGetItemRect(infoPtr, wParam, (LPRECT)lParam, NULL);
}
/******************************************************************************
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c
index d835e75..caef276 100644
--- a/dlls/comctl32/tests/datetime.c
+++ b/dlls/comctl32/tests/datetime.c
@@ -197,7 +197,7 @@ static void test_dtm_set_format(HWND hWndDateTime)
SYSTEMTIME systime;
LRESULT r;
- r = SendMessage(hWndDateTime, DTM_SETFORMAT, 0, (LPARAM)NULL);
+ r = SendMessage(hWndDateTime, DTM_SETFORMAT, 0, 0);
expect(1, r);
r = SendMessage(hWndDateTime, DTM_SETFORMAT, 0,
@@ -271,7 +271,7 @@ static void test_dtm_get_monthcal(HWND hWndDateTime)
todo_wine {
r = SendMessage(hWndDateTime, DTM_GETMONTHCAL, 0, 0);
- ok(r == (LPARAM)NULL, "Expected NULL(no child month calendar control), got %ld\n", r);
+ ok(r == 0, "Expected NULL(no child month calendar control), got %ld\n", r);
}
ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_get_monthcal_seq, "test_dtm_get_monthcal", FALSE);
diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c
index 8aade81..a8861fd 100644
--- a/dlls/comctl32/tests/monthcal.c
+++ b/dlls/comctl32/tests/monthcal.c
@@ -639,7 +639,7 @@ static void test_monthcal_currDate(HWND hwnd)
expect(st_original.wSecond, st_new.wSecond);
/* lparam cannot be NULL */
- res = SendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM) NULL);
+ res = SendMessage(hwnd, MCM_GETCURSEL, 0, 0);
expect(0, res);
ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_curr_date_seq, "monthcal currDate", TRUE);
diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c
index e2ec11d..a7c80c6 100644
--- a/dlls/comctl32/tests/status.c
+++ b/dlls/comctl32/tests/status.c
@@ -318,7 +318,7 @@ static void test_status_control(void)
/* Add an icon to the status bar */
hIcon = LoadIcon(NULL, IDI_QUESTION);
- r = SendMessage(hWndStatus, SB_SETICON, 1, (LPARAM) NULL);
+ r = SendMessage(hWndStatus, SB_SETICON, 1, 0);
ok(r != 0 ||
broken(r == 0), /* win95 */
"Expected non-zero, got %d\n", r);
@@ -326,7 +326,7 @@ static void test_status_control(void)
ok(r != 0 ||
broken(r == 0), /* win95 */
"Expected non-zero, got %d\n", r);
- r = SendMessage(hWndStatus, SB_SETICON, 1, (LPARAM) NULL);
+ r = SendMessage(hWndStatus, SB_SETICON, 1, 0);
ok(r != 0 ||
broken(r == 0), /* win95 */
"Expected non-zero, got %d\n", r);
diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c
index eba3f61..bd4919d 100644
--- a/dlls/comctl32/tests/tab.c
+++ b/dlls/comctl32/tests/tab.c
@@ -846,7 +846,7 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs)
SendMessage(hTab, TCM_SETTOOLTIPS, (LPARAM) toolTip, 0);
ok (toolTip == (HWND) SendMessage(hTab,TCM_GETTOOLTIPS,0,0), "ToolTip was set incorrectly.\n");
- SendMessage(hTab, TCM_SETTOOLTIPS, (LPARAM) NULL, 0);
+ SendMessage(hTab, TCM_SETTOOLTIPS, 0, 0);
ok (NULL == (HWND) SendMessage(hTab,TCM_GETTOOLTIPS,0,0), "ToolTip was set incorrectly.\n");
ok_sequence(sequences, TAB_SEQ_INDEX, getset_tooltip_seq, "Getset tooltip test sequence", TRUE);
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 4b6d3c3..8e54a76 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -1121,15 +1121,15 @@ static void test_getstring(void)
hToolbar = CreateWindowExA(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hMainWnd, (HMENU)5, GetModuleHandle(NULL), NULL);
ok(hToolbar != NULL, "Toolbar creation problem\n");
- r = SendMessage(hToolbar, TB_GETSTRING, MAKEWPARAM(0, 0), (LPARAM)NULL);
+ r = SendMessage(hToolbar, TB_GETSTRING, MAKEWPARAM(0, 0), 0);
expect(-1, r);
- r = SendMessage(hToolbar, TB_GETSTRINGW, MAKEWPARAM(0, 0), (LPARAM)NULL);
+ r = SendMessage(hToolbar, TB_GETSTRINGW, MAKEWPARAM(0, 0), 0);
expect(-1, r);
r = SendMessage(hToolbar, TB_ADDSTRING, 0, (LPARAM)answer);
expect(0, r);
- r = SendMessage(hToolbar, TB_GETSTRING, MAKEWPARAM(0, 0), (LPARAM)NULL);
+ r = SendMessage(hToolbar, TB_GETSTRING, MAKEWPARAM(0, 0), 0);
expect(lstrlenA(answer), r);
- r = SendMessage(hToolbar, TB_GETSTRINGW, MAKEWPARAM(0, 0), (LPARAM)NULL);
+ r = SendMessage(hToolbar, TB_GETSTRINGW, MAKEWPARAM(0, 0), 0);
expect(lstrlenA(answer), r);
r = SendMessage(hToolbar, TB_GETSTRING, MAKEWPARAM(sizeof(str), 0), (LPARAM)str);
expect(lstrlenA(answer), r);
diff --git a/dlls/comctl32/tests/trackbar.c b/dlls/comctl32/tests/trackbar.c
index 00f7024..f69e286 100644
--- a/dlls/comctl32/tests/trackbar.c
+++ b/dlls/comctl32/tests/trackbar.c
@@ -871,7 +871,7 @@ static void test_tool_tips(HWND hWndTrackbar){
SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 0);
rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0);
ok(rTest == hWndTooltip, "Expected hWndToolTip, got\n");
- SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) NULL, 0);
+ SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, 0, 0);
rTest = (HWND) SendMessage(hWndTrackbar, TBM_GETTOOLTIPS, 0,0);
ok(rTest == NULL, "Expected NULL\n");
SendMessage(hWndTrackbar, TBM_SETTOOLTIPS, (LPARAM) hWndTooltip, 5);
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 6605060..dd0563a 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -5019,7 +5019,7 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
CloseThemeData (GetWindowTheme (infoPtr->hwnd));
/* Deassociate treeview from the window before doing anything drastic. */
- SetWindowLongPtrW(infoPtr->hwnd, 0, (DWORD_PTR)NULL);
+ SetWindowLongPtrW(infoPtr->hwnd, 0, 0);
DeleteObject(infoPtr->hDefaultFont);
More information about the wine-cvs
mailing list