DSTRICT: some fixes for the user dll

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

License: LGPL, X11
Changelog:
	Michael Stefaniuc <mstefani@redhat.com>
	- some fixes for the compilation of the user dll with -DSTRICT

bye
	michael
-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
System Administration           Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani@redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart
Index: controls/button.c
===================================================================
RCS file: /home/wine/wine/controls/button.c,v
retrieving revision 1.61
diff -u -r1.61 button.c
--- controls/button.c	21 Jun 2002 22:25:17 -0000	1.61
+++ controls/button.c	27 Oct 2002 17:44:51 -0000
@@ -124,12 +124,12 @@
 
 inline static HFONT get_button_font( HWND hwnd )
 {
-    return GetWindowLongA( hwnd, HFONT_GWL_OFFSET );
+    return (HFONT)GetWindowLongA( hwnd, HFONT_GWL_OFFSET );
 }
 
 inline static void set_button_font( HWND hwnd, HFONT font )
 {
-    SetWindowLongA( hwnd, HFONT_GWL_OFFSET, font );
+    SetWindowLongA( hwnd, HFONT_GWL_OFFSET, (LONG)font );
 }
 
 inline static UINT get_button_type( LONG window_style )
@@ -308,9 +308,11 @@
         HBRUSH hbrush;
         RECT client, rc;
 
-        hbrush = SendMessageW(GetParent(hWnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hWnd);
+        hbrush = (HBRUSH)SendMessageW(GetParent(hWnd), WM_CTLCOLORSTATIC,
+				      (WPARAM)hdc, (LPARAM)hWnd);
         if (!hbrush) /* did the app forget to call DefWindowProc ? */
-            hbrush = DefWindowProcW(GetParent(hWnd), WM_CTLCOLORSTATIC, hdc, (LPARAM)hWnd);
+            hbrush = (HBRUSH)DefWindowProcW(GetParent(hWnd), WM_CTLCOLORSTATIC,
+					    (WPARAM)hdc, (LPARAM)hWnd);
 
         GetClientRect(hWnd, &client);
         rc = client;
@@ -331,12 +333,12 @@
     }
 
     case WM_SETFONT:
-        set_button_font( hWnd, wParam );
+        set_button_font( hWnd, (HFONT)wParam );
         if (lParam) paint_button( hWnd, btn_type, ODA_DRAWENTIRE );
         break;
 
     case WM_GETFONT:
-        return get_button_font( hWnd );
+        return (LRESULT)get_button_font( hWnd );
 
     case WM_SETFOCUS:
         if ((btn_type == BS_RADIOBUTTON || btn_type == BS_AUTORADIOBUTTON) && (GetCapture() != hWnd) &&
@@ -394,9 +396,9 @@
         default:
             return 0;
         }
-        oldHbitmap = SetWindowLongA( hWnd, HIMAGE_GWL_OFFSET, lParam );
+        oldHbitmap = (HBITMAP)SetWindowLongA( hWnd, HIMAGE_GWL_OFFSET, lParam );
 	InvalidateRect( hWnd, NULL, FALSE );
-	return oldHbitmap;
+	return (LRESULT)oldHbitmap;
 
     case BM_GETIMAGE:
         return GetWindowLongA( hWnd, HIMAGE_GWL_OFFSET );
@@ -716,7 +718,7 @@
 
     /* Send WM_CTLCOLOR to allow changing the font (the colors are fixed) */
     if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
-    SendMessageW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
+    SendMessageW( GetParent(hwnd), WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd );
     hOldPen = (HPEN)SelectObject(hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME));
     hOldBrush =(HBRUSH)SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE));
     oldBkMode = SetBkMode(hDC, TRANSPARENT);
@@ -841,9 +843,11 @@
 
     if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
 
-    hBrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
+    hBrush = (HBRUSH)SendMessageW(GetParent(hwnd), WM_CTLCOLORSTATIC,
+				  (WPARAM)hDC, (LPARAM)hwnd);
     if (!hBrush) /* did the app forget to call defwindowproc ? */
-        hBrush = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
+        hBrush = (HBRUSH)DefWindowProcW(GetParent(hwnd), WM_CTLCOLORSTATIC,
+					(WPARAM)hDC, (LPARAM)hwnd );
 
     if (style & BS_LEFTTEXT)
     {
@@ -989,9 +993,10 @@
 
     if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
     /* GroupBox acts like static control, so it sends CTLCOLORSTATIC */
-    hbr = SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
+    hbr = (HBRUSH)SendMessageW(GetParent(hwnd), WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)hwnd);
     if (!hbr) /* did the app forget to call defwindowproc ? */
-        hbr = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd );
+        hbr = (HBRUSH)DefWindowProcW(GetParent(hwnd), WM_CTLCOLORSTATIC,
+				     (WPARAM)hDC, (LPARAM)hwnd);
 
     GetClientRect( hwnd, &rc);
     if (TWEAK_WineLook == WIN31_LOOK) {
@@ -1049,9 +1054,10 @@
 
     if ((hFont = get_button_font( hwnd ))) SelectObject( hDC, hFont );
 
-    hBrush = SendMessageW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
+    hBrush = (HBRUSH)SendMessageW(GetParent(hwnd), WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd);
     if (!hBrush) /* did the app forget to call defwindowproc ? */
-        hBrush = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORBTN, hDC, (LPARAM)hwnd );
+        hBrush = (HBRUSH)DefWindowProcW(GetParent(hwnd), WM_CTLCOLORBTN,
+					(WPARAM)hDC, (LPARAM)hwnd);
 
     FillRect( hDC, &rc, hBrush );
     if ((action == ODA_FOCUS) ||
Index: controls/listbox.c
===================================================================
RCS file: /home/wine/wine/controls/listbox.c,v
retrieving revision 1.86
diff -u -r1.86 listbox.c
--- controls/listbox.c	17 Oct 2002 16:43:44 -0000	1.86
+++ controls/listbox.c	27 Oct 2002 17:44:52 -0000
@@ -691,8 +691,8 @@
     if (LISTBOX_GetItemRect( descr, index, &rect ) != 1) return;
     if (!(hdc = GetDCEx( hwnd, 0, DCX_CACHE ))) return;
     if (descr->font) oldFont = SelectObject( hdc, descr->font );
-    hbrush = SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
-                             hdc, (LPARAM)hwnd );
+    hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
+				   (WPARAM)hdc, (LPARAM)hwnd );
     if (hbrush) oldBrush = SelectObject( hdc, hbrush );
     if (!IsWindowEnabled(hwnd))
         SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
@@ -1012,8 +1012,8 @@
     }
 
     if (descr->font) oldFont = SelectObject( hdc, descr->font );
-    hbrush = SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
-                             hdc, (LPARAM)hwnd );
+    hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
+			   	   (WPARAM)hdc, (LPARAM)hwnd );
     if (hbrush) oldBrush = SelectObject( hdc, hbrush );
     if (!IsWindowEnabled(hwnd)) SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
 
@@ -2245,7 +2245,7 @@
     {
         caret = SendMessageW( descr->owner, WM_VKEYTOITEM,
                                 MAKEWPARAM(LOWORD(wParam), descr->focus_item),
-                                hwnd );
+                                (LPARAM)hwnd );
         if (caret == -2) return 0;
     }
     if (caret == -1) switch(wParam)
@@ -2926,7 +2926,7 @@
         LISTBOX_UpdateSize( hwnd, descr );
         return 0;
     case WM_GETFONT:
-        return descr->font;
+        return (LRESULT)descr->font;
     case WM_SETFONT:
         LISTBOX_SetFont( hwnd, descr, (HFONT)wParam );
         if (lParam) InvalidateRect( hwnd, 0, TRUE );
@@ -2987,7 +2987,7 @@
         if ((IS_OWNERDRAW(descr)) && !(descr->style & LBS_DISPLAYCHANGED))
         {
             RECT rect;
-            HBRUSH hbrush = SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
+            HBRUSH hbrush = (HBRUSH)SendMessageW( descr->owner, WM_CTLCOLORLISTBOX,
                                               wParam, (LPARAM)hwnd );
 	    TRACE("hbrush = %04x\n", hbrush);
 	    if(!hbrush)
Index: windows/defdlg.c
===================================================================
RCS file: /home/wine/wine/windows/defdlg.c,v
retrieving revision 1.25
diff -u -r1.25 defdlg.c
--- windows/defdlg.c	28 Jun 2002 23:32:29 -0000	1.25
+++ windows/defdlg.c	27 Oct 2002 17:44:52 -0000
@@ -168,8 +168,8 @@
     {
         case WM_ERASEBKGND:
         {
-            HBRUSH brush = SendMessageW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
-            if (!brush) brush = DefWindowProcW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
+            HBRUSH brush = (HBRUSH)SendMessageW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
+            if (!brush) brush = (HBRUSH)DefWindowProcW( hwnd, WM_CTLCOLORDLG, wParam, (LPARAM)hwnd );
             if (brush)
             {
                 RECT rect;
@@ -252,7 +252,7 @@
 	    return DefWindowProcA( hwnd, msg, wParam, lParam );
 
 	case WM_GETFONT:
-            return dlgInfo ? dlgInfo->hUserFont : 0;
+            return dlgInfo ? (LRESULT)dlgInfo->hUserFont : 0;
 
         case WM_CLOSE:
             PostMessageA( hwnd, WM_COMMAND, IDCANCEL,
Index: windows/mdi.c
===================================================================
RCS file: /home/wine/wine/windows/mdi.c,v
retrieving revision 1.101
diff -u -r1.101 mdi.c
--- windows/mdi.c	22 Oct 2002 00:42:53 -0000	1.101
+++ windows/mdi.c	27 Oct 2002 17:44:53 -0000
@@ -186,7 +186,7 @@
     MDIClientWndProcW,      /* procW */
     sizeof(MDICLIENTINFO),  /* extra */
     IDC_ARROWA,             /* cursor */
-    COLOR_APPWORKSPACE+1    /* brush */
+    (HBRUSH)(COLOR_APPWORKSPACE+1)    /* brush */
 };
 
 
@@ -439,7 +439,7 @@
         {
             if( ci->hwndChildMaximized )
                 MDI_AugmentFrameMenu( GetParent(hwnd), ci->hwndChildMaximized );
-            return oldFrameMenu;
+            return (LRESULT)oldFrameMenu;
         }
     }
     else
@@ -477,7 +477,7 @@
 
     FIXME("partially function stub\n");
 
-    return oldFrameMenu;
+    return (LRESULT)oldFrameMenu;
 }
 
 
Index: dlls/user/exticon.c
===================================================================
RCS file: /home/wine/wine/dlls/user/exticon.c,v
retrieving revision 1.21
diff -u -r1.21 exticon.c
--- dlls/user/exticon.c	10 Oct 2002 21:22:12 -0000	1.21
+++ dlls/user/exticon.c	27 Oct 2002 17:44:53 -0000
@@ -250,7 +250,7 @@
 	UINT cxDesired,
 	UINT cyDesired )
 {
-	HGLOBAL		hRet = E_FAIL;
+	HRESULT		hRet = E_FAIL;
 	LPBYTE		pData;
 	DWORD		sig;
 	HANDLE		hFile;
Index: dlls/user/message.c
===================================================================
RCS file: /home/wine/wine/dlls/user/message.c,v
retrieving revision 1.24
diff -u -r1.24 message.c
--- dlls/user/message.c	11 Oct 2002 23:41:06 -0000	1.24
+++ dlls/user/message.c	27 Oct 2002 17:44:54 -0000
@@ -1061,7 +1061,7 @@
     case WM_WINE_ENABLEWINDOW:
         return EnableWindow( hwnd, wparam );
     case WM_WINE_SETACTIVEWINDOW:
-        return SetActiveWindow( (HWND)wparam );
+        return (LRESULT)SetActiveWindow( (HWND)wparam );
     default:
         FIXME( "unknown internal message %x\n", msg );
         return 0;
Index: dlls/user/wnd16.c
===================================================================
RCS file: /home/wine/wine/dlls/user/wnd16.c,v
retrieving revision 1.14
diff -u -r1.14 wnd16.c
--- dlls/user/wnd16.c	23 Oct 2002 18:56:02 -0000	1.14
+++ dlls/user/wnd16.c	27 Oct 2002 17:44:54 -0000
@@ -24,8 +24,9 @@
 #include "win.h"
 #include "stackframe.h"
 
-/* handle --> handle16 conversions */
+/* handle <--> handle16 conversions */
 #define HANDLE_16(h32)		(LOWORD(h32))
+#define HANDLE_32(h16)		((HANDLE)(ULONG_PTR)(h16))
 
 static HWND16 hwndSysModal;
 
@@ -131,7 +132,7 @@
  */
 BOOL16 WINAPI SetProp16( HWND16 hwnd, LPCSTR str, HANDLE16 handle )
 {
-    return SetPropA( WIN_Handle32(hwnd), str, handle );
+    return SetPropA( WIN_Handle32(hwnd), str, HANDLE_32(handle) );
 }
 
 
@@ -257,7 +258,7 @@
     PAINTSTRUCT ps;
 
     BeginPaint( WIN_Handle32(hwnd), &ps );
-    lps->hdc            = ps.hdc;
+    lps->hdc            = HDC_16(ps.hdc);
     lps->fErase         = ps.fErase;
     lps->rcPaint.top    = ps.rcPaint.top;
     lps->rcPaint.left   = ps.rcPaint.left;
@@ -276,7 +277,7 @@
 {
     PAINTSTRUCT ps;
 
-    ps.hdc = lps->hdc;
+    ps.hdc = HDC_32(lps->hdc);
     return EndPaint( WIN_Handle32(hwnd), &ps );
 }
 
@@ -1153,7 +1154,7 @@
  */
 HDWP16 WINAPI BeginDeferWindowPos16( INT16 count )
 {
-    return BeginDeferWindowPos( count );
+    return HDWP_16(BeginDeferWindowPos( count ));
 }
 
 

Attachment: pgp00081.pgp
Description: PGP signature


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux