]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix harmless MinGW warning in wxMSW wxListCtrl code.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Jul 2013 14:12:44 +0000 (14:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Jul 2013 14:12:44 +0000 (14:12 +0000)
Add an explicit cast to WPARAM because MinGW headers don't do it for us (even
though they should).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp

index 9684bf0e9a25fdd13018f2a4444f865e83641a4a..9befc6a9559a3806f4731f7886dd5320231a03cf 100644 (file)
@@ -1339,7 +1339,10 @@ void wxListCtrl::AssignImageList(wxImageList *imageList, int which)
 
 wxSize wxListCtrl::MSWGetBestViewRect(int x, int y) const
 {
-    const DWORD rc = ListView_ApproximateViewRect(GetHwnd(), x, y, -1);
+    // The cast is necessary to suppress a MinGW warning due to a missing cast
+    // to WPARAM in the definition of ListView_ApproximateViewRect() in its
+    // own headers (this was the case up to at least MinGW 4.8).
+    const DWORD rc = ListView_ApproximateViewRect(GetHwnd(), x, y, (WPARAM)-1);
 
     wxSize size(LOWORD(rc), HIWORD(rc));