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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 13 08:46:45 CST 2006


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

Author: Mike McCormack <mike at codeweavers.com>
Date:   Sat Mar 11 14:43:37 2006 +0900

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

---

 dlls/shell32/shlview.c |   57 +++++++++++++++++++++++++++---------------------
 1 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index 2cce8eb..7364f42 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -342,12 +342,17 @@ static BOOL ShellView_CreateList (IShell
         This->ListViewSortInfo.nLastHeaderID = -1;
 
        if (This->FolderSettings.fFlags & FWF_DESKTOP) {
-         if (0)  /* FIXME: look into registry vale HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ListviewShadow and activate drop shadows */
-           ListView_SetTextBkColor(This->hWndList, CLR_NONE);
+         /*
+          * FIXME: look at the registry value
+          * HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ListviewShadow
+          * and activate drop shadows if necessary
+          */
+         if (0)
+           SendMessageW(This->hWndList, LVM_SETTEXTBKCOLOR, 0, CLR_NONE);
          else
-           ListView_SetTextBkColor(This->hWndList, GetSysColor(COLOR_DESKTOP));
+           SendMessageW(This->hWndList, LVM_SETTEXTBKCOLOR, 0, GetSysColor(COLOR_DESKTOP));
 
-         ListView_SetTextColor(This->hWndList, RGB(255,255,255));
+         SendMessageW(This->hWndList, LVM_SETTEXTCOLOR, 0, RGB(255,255,255));
        }
 
         /*  UpdateShellSettings(); */
@@ -368,7 +373,7 @@ static BOOL ShellView_InitList(IShellVie
 
 	TRACE("%p\n",This);
 
-	ListView_DeleteAllItems(This->hWndList);
+	SendMessageW(This->hWndList, LVM_DELETEALLITEMS, 0, 0);
 
 	lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
 	lvColumn.pszText = szTemp;
@@ -382,7 +387,7 @@ static BOOL ShellView_InitList(IShellVie
 	    lvColumn.fmt = sd.fmt;
 	    lvColumn.cx = sd.cxChar*8; /* chars->pixel */
 	    StrRetToStrNA( szTemp, 50, &sd.str, NULL);
-	    ListView_InsertColumnA(This->hWndList, i, &lvColumn);
+	    SendMessageW(This->hWndList, LVM_INSERTCOLUMNW, i, (LPARAM) &lvColumn);
 	  }
 	}
 	else
@@ -390,8 +395,8 @@ static BOOL ShellView_InitList(IShellVie
 	  FIXME("no SF2\n");
 	}
 
-	ListView_SetImageList(This->hWndList, ShellSmallIconList, LVSIL_SMALL);
-	ListView_SetImageList(This->hWndList, ShellBigIconList, LVSIL_NORMAL);
+	SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ShellSmallIconList);
+	SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)ShellBigIconList);
 
 	return TRUE;
 }
@@ -524,7 +529,9 @@ static int LV_FindItemByPidl(
 	LVITEMA lvItem;
 	ZeroMemory(&lvItem, sizeof(LVITEMA));
 	lvItem.mask = LVIF_PARAM;
-	for(lvItem.iItem = 0; ListView_GetItemA(This->hWndList, &lvItem); lvItem.iItem++)
+	for(lvItem.iItem = 0;
+		SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem);
+		lvItem.iItem++)
 	{
 	  LPITEMIDLIST currentpidl = (LPITEMIDLIST) lvItem.lParam;
 	  HRESULT hr = IShellFolder_CompareIDs(This->pSFParent, 0, pidl, currentpidl);
@@ -583,14 +590,14 @@ static BOOLEAN LV_RenameItem(IShellViewI
 	  ZeroMemory(&lvItem, sizeof(lvItem));	/* create the listview item*/
 	  lvItem.mask = LVIF_PARAM;		/* only the pidl */
 	  lvItem.iItem = nItem;
-	  ListView_GetItemA(This->hWndList, &lvItem);
+	  SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem);
 
 	  SHFree((LPITEMIDLIST)lvItem.lParam);
 	  lvItem.mask = LVIF_PARAM;
 	  lvItem.iItem = nItem;
 	  lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidlNew));	/* set the item's data */
-	  ListView_SetItemA(This->hWndList, &lvItem);
-	  ListView_Update(This->hWndList, nItem);
+	  SendMessageA(This->hWndList, LVM_SETITEMA, 0, (LPARAM) &lvItem);
+	  SendMessageA(This->hWndList, LVM_UPDATE, nItem, 0);
 	  return TRUE;					/* FIXME: better handling */
 	}
 	return FALSE;
@@ -1227,7 +1234,7 @@ static LRESULT ShellView_OnCommand(IShel
 	    This->ListViewSortInfo.nHeaderID = (LPARAM) (dwCmdID - 0x30);
 	    This->ListViewSortInfo.bIsAscending = TRUE;
 	    This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
-	    ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
+	    SendMessageA(This->hWndList, LVM_SORTITEMS, (WPARAM) &This->ListViewSortInfo, (LPARAM)ShellView_ListViewCompareItems);
 	    break;
 
 	  default:
@@ -1323,7 +1330,7 @@ static LRESULT ShellView_OnNotify(IShell
 	    }
 	    This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
 
-	    ListView_SortItems(lpnmlv->hdr.hwndFrom, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
+	    SendMessageA(lpnmlv->hdr.hwndFrom, LVM_SORTITEMS, (WPARAM) &This->ListViewSortInfo, (LPARAM)ShellView_ListViewCompareItems);
 	    break;
 
 	  case LVN_GETDISPINFOA:
@@ -1423,7 +1430,7 @@ static LRESULT ShellView_OnNotify(IShell
 		ZeroMemory(&lvItem, sizeof(LVITEMA));
 		lvItem.iItem = lpdi->item.iItem;
 		lvItem.mask = LVIF_PARAM;
-		ListView_GetItemA(This->hWndList, &lvItem);
+		SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem);
 
 		pidl = (LPITEMIDLIST)lpdi->item.lParam;
                 if (!MultiByteToWideChar( CP_ACP, 0, lpdi->item.pszText, -1, wszNewName, MAX_PATH ))
@@ -1434,7 +1441,7 @@ static LRESULT ShellView_OnNotify(IShell
 		{
 	          lvItem.mask = LVIF_PARAM;
 		  lvItem.lParam = (LPARAM)pidl;
-		  ListView_SetItemA(This->hWndList, &lvItem);
+		  SendMessageA(This->hWndList, LVM_SETITEMA, 0, (LPARAM) &lvItem);
 		  return TRUE;
 		}
 	      }
@@ -1466,8 +1473,8 @@ static LRESULT ShellView_OnNotify(IShell
                   i = ListView_GetNextItem(This->hWndList, -1,
 			LVNI_SELECTED);
 
-                  ListView_EnsureVisible(This->hWndList, i, 0);
-                  ListView_EditLabelA(This->hWndList, i);
+                  SendMessageW(This->hWndList, LVM_ENSUREVISIBLE, i, 0);
+                  SendMessageW(This->hWndList, LVM_EDITLABELW, i, 0);
                 }
               }
 #if 0
@@ -1504,7 +1511,7 @@ static LRESULT ShellView_OnNotify(IShell
 			item_index, LVNI_SELECTED);
 		  item.iItem = item_index;
 		  item.mask |= LVIF_PARAM;
-		  ListView_GetItemA(This->hWndList, &item);
+		  SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &item);
 
 		  /* get item pidl */
 		  pItems[i] = (LPITEMIDLIST)item.lParam;
@@ -1817,7 +1824,7 @@ static HRESULT WINAPI IShellView_fnRefre
 
 	TRACE("(%p)\n",This);
 
-	ListView_DeleteAllItems(This->hWndList);
+	SendMessageW(This->hWndList, LVM_DELETEALLITEMS, 0, 0);
 	ShellView_FillList(This);
 
 	return S_OK;
@@ -1968,13 +1975,13 @@ static HRESULT WINAPI IShellView_fnSelec
 	  LVITEMA lvItem;
 
 	  if(uFlags & SVSI_ENSUREVISIBLE)
-	    ListView_EnsureVisible(This->hWndList, i, 0);
+	    SendMessageW(This->hWndList, LVM_ENSUREVISIBLE, i, 0);
 
           ZeroMemory(&lvItem, sizeof(LVITEMA));
 	  lvItem.mask = LVIF_STATE;
 	  lvItem.iItem = 0;
 
-          while(ListView_GetItemA(This->hWndList, &lvItem))
+          while(SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem))
 	  {
 	    if (lvItem.iItem == i)
 	    {
@@ -1991,13 +1998,13 @@ static HRESULT WINAPI IShellView_fnSelec
 	      if (uFlags & SVSI_DESELECTOTHERS)
 	        lvItem.state &= ~LVIS_SELECTED;
 	    }
-	    ListView_SetItemA(This->hWndList, &lvItem);
+	    SendMessageA(This->hWndList, LVM_SETITEMA, 0, (LPARAM) &lvItem);
 	    lvItem.iItem++;
 	  }
 
 
 	  if(uFlags & SVSI_EDIT)
-	    ListView_EditLabelA(This->hWndList, i);
+	    SendMessageW(This->hWndList, LVM_EDITLABELW, i, 0);
 
 	}
 	return S_OK;
@@ -2255,7 +2262,7 @@ static HRESULT drag_notify_subitem(IShel
         ZeroMemory(&lvItem, sizeof(lvItem));
         lvItem.mask = LVIF_PARAM;
         lvItem.iItem = lResult;
-        ListView_GetItemA(This->hWndList, &lvItem);
+        SendMessageA(This->hWndList, LVM_GETITEMA, 0, (LPARAM) &lvItem);
 
         /* ... and bind pCurDropTarget to the IDropTarget interface of an UIObject of this object */
         hr = IShellFolder_GetUIObjectOf(This->pSFParent, This->hWndList, 1,




More information about the wine-cvs mailing list