Mike McCormack : regedit: Fix some gcc 4. 1 warnings caused by casts in macros.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 3 08:47:25 CST 2006


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

Author: Mike McCormack <mike at codeweavers.com>
Date:   Fri Mar  3 12:28:43 2006 +0900

regedit: Fix some gcc 4.1 warnings caused by casts in macros.

---

 programs/regedit/childwnd.c |    2 +-
 programs/regedit/framewnd.c |    6 +++---
 programs/regedit/listview.c |   15 +++++++--------
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index f6f0042..bc312ba 100644
--- a/programs/regedit/childwnd.c
+++ b/programs/regedit/childwnd.c
@@ -320,7 +320,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd,
 		    item.mask = TVIF_HANDLE | TVIF_TEXT;
 		    item.hItem = TreeView_GetSelection(pChildWnd->hTreeWnd);
 		    item.pszText = dispInfo->item.pszText;
-		    TreeView_SetItem(pChildWnd->hTreeWnd, &item);
+                    SendMessage( pChildWnd->hTreeWnd, TVM_SETITEMW, 0, (LPARAM)&item );
 		}
 		return res;
 	    }
diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c
index 241286c..fbe9646 100644
--- a/programs/regedit/framewnd.c
+++ b/programs/regedit/framewnd.c
@@ -640,8 +640,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT 
             DWORD ksize = KEY_MAX_LEN, vsize = sizeof(valuebuf), type = 0;
             if (RegEnumValue(hKey, LOWORD(wParam) - ID_FAVORITE_FIRST, namebuf, &ksize, NULL, 
                 &type, valuebuf, &vsize) == ERROR_SUCCESS) {
-                TreeView_SelectItem(g_pChildWnd->hTreeWnd, 
-                                    FindPathInTree(g_pChildWnd->hTreeWnd, (TCHAR *)valuebuf));
+                SendMessage( g_pChildWnd->hTreeWnd, TVM_SELECTITEM, TVGN_CARET,
+                             (LPARAM) FindPathInTree(g_pChildWnd->hTreeWnd, (TCHAR *)valuebuf) );
             }
             RegCloseKey(hKey);
         }
@@ -693,7 +693,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT 
             hItem = FindNext(g_pChildWnd->hTreeWnd, hItem, searchString, searchMask, &row);
             SetCursor(hcursorOld);
             if (hItem) {
-                TreeView_SelectItem(g_pChildWnd->hTreeWnd, hItem);
+                SendMessage( g_pChildWnd->hTreeWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM) hItem );
                 InvalidateRect(g_pChildWnd->hTreeWnd, NULL, TRUE);
                 UpdateWindow(g_pChildWnd->hTreeWnd);
                 if (row != -1) {
diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c
index 5cc8002..2e06508 100644
--- a/programs/regedit/listview.c
+++ b/programs/regedit/listview.c
@@ -19,7 +19,6 @@
  */
 
 #include <windows.h>
-#include <windowsx.h>
 #include <commctrl.h>
 #include <stdlib.h>
 #include <tchar.h>
@@ -218,7 +217,7 @@ static BOOL InitListViewImageList(HWND h
         IMAGE_ICON, cx, cy, LR_DEFAULTCOLOR);
     Image_Binary = ImageList_AddIcon(himl, hicon);
 
-    ListView_SetImageList(hWndListView, himl, LVSIL_SMALL);
+    SendMessage( hWndListView, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM) himl );
 
     /* fail if some of the icons failed to load */
     if (ImageList_GetImageCount(himl) < 2)
@@ -373,7 +372,7 @@ static LRESULT CALLBACK ListWndProc(HWND
                 g_invertSort = FALSE;
             }
                     
-            ListView_SortItems(hWnd, CompareFunc, hWnd);
+            SendMessage(hWnd, LVM_SORTITEMS, (WPARAM)hWnd, (LPARAM)CompareFunc);
             break;
 	case LVN_ENDLABELEDIT: {
 	        LPNMLVDISPINFO dispInfo = (LPNMLVDISPINFO)lParam;
@@ -453,12 +452,12 @@ HWND CreateListView(HWND hwndParent, int
                             0, 0, rcClient.right, rcClient.bottom,
                             hwndParent, (HMENU)id, hInst, NULL);
     if (!hwndLV) return NULL;
-    ListView_SetExtendedListViewStyle(hwndLV,  LVS_EX_FULLROWSELECT);
+    SendMessage(hwndLV, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
 
     /* Initialize the image list */
     if (!InitListViewImageList(hwndLV)) goto fail;
     if (!CreateListColumns(hwndLV)) goto fail;
-    g_orgListWndProc = SubclassWindow(hwndLV, ListWndProc);
+    g_orgListWndProc = (WNDPROC) SetWindowLongPtr(hwndLV, GWLP_WNDPROC, (LPARAM)ListWndProc);
     return hwndLV;
 fail:
     DestroyWindow(hwndLV);
@@ -490,12 +489,12 @@ BOOL RefreshListView(HWND hwndLV, HKEY h
     for (i = 0; i < count; i++) {
         item.mask = LVIF_PARAM;
         item.iItem = i;
-        ListView_GetItem(hwndLV, &item);
+        SendMessage( hwndLV, LVM_GETITEM, 0, (LPARAM)&item );
         free(((LINE_INFO*)item.lParam)->name);
         HeapFree(GetProcessHeap(), 0, (void*)item.lParam);
     }
     g_columnToSort = ~0UL;
-    ListView_DeleteAllItems(hwndLV);
+    SendMessage( hwndLV, LVM_DELETEALLITEMS, 0, 0L );
 
     /* get size information and resize the buffers if necessary */
     errCode = RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, &max_sub_key_len, NULL, 
@@ -524,7 +523,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY h
             bSelected = TRUE;
         AddEntryToList(hwndLV, valName[0] ? valName : NULL, valType, valBuf, valSize, bSelected);
     }
-    ListView_SortItems(hwndLV, CompareFunc, hwndLV); 
+    SendMessage(hwndLV, LVM_SORTITEMS, (WPARAM)hwndLV, (LPARAM)CompareFunc);
 
     g_currentRootKey = hKeyRoot;
     if (keyPath != g_currentPath) {




More information about the wine-cvs mailing list