Commit ba3c18df authored by Gavriel State's avatar Gavriel State Committed by Alexandre Julliard

Warning fixes.

parent 73db900a
......@@ -422,7 +422,7 @@ create_primary(IDirectDrawImpl* This, LPDDSURFACEDESC2 pDDSD,
IDirectDrawSurface7_Release(pPrev);
}
This->primary_surface = *ppSurf;
This->primary_surface = (IDirectDrawSurfaceImpl *)*ppSurf;
return DD_OK;
}
......@@ -468,7 +468,7 @@ Main_DirectDraw_CreateSurface(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
ICOM_THIS(IDirectDrawImpl, iface);
TRACE("(%p)->(%p,%p,%p)\n",This,pDDSD,ppSurf,pUnkOuter);
TRACE("Requested Caps: 0x%x\n", pDDSD->ddsCaps.dwCaps);
TRACE("Requested Caps: 0x%lx\n", pDDSD->ddsCaps.dwCaps);
if (pUnkOuter != NULL)
return CLASS_E_NOAGGREGATION; /* unchecked */
......
......@@ -188,13 +188,17 @@ IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc,
LPDIRECTDRAWSURFACE7 pSurface7;
HRESULT hr;
/* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
* since the data layout is the same */
hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
IDirectDraw,
IDirectDraw7,
This),
pSDesc, &pSurface7, pUnkOuter);
(LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
*ppSurface = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
/* This coercion is safe, since the IDirectDrawSurface3 vtable has the
* IDirectDrawSurface vtable layout at the beginning */
*ppSurface = (LPDIRECTDRAWSURFACE) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
IDirectDrawSurface7, IDirectDrawSurface3,
pSurface7);
......@@ -209,13 +213,17 @@ IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc,
LPDIRECTDRAWSURFACE7 pSurface7;
HRESULT hr;
/* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
* since the data layout is the same */
hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
IDirectDraw,
IDirectDraw7,
This),
pSDesc, &pSurface7, pUnkOuter);
(LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
*ppSurface = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
/* This coercion is safe, since the IDirectDrawSurface3 vtable has the
* IDirectDrawSurface vtable layout at the beginning */
*ppSurface = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
IDirectDrawSurface7, IDirectDrawSurface3,
pSurface7);
......@@ -227,11 +235,13 @@ IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pSDesc,
LPDIRECTDRAWSURFACE4 *ppSurface,
IUnknown *pUnkOuter)
{
/* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
* since the data layout is the same */
return IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
IDirectDraw4,
IDirectDraw7,
This),
pSDesc,
(LPDDSURFACEDESC2)pSDesc,
(LPDIRECTDRAWSURFACE7 *)ppSurface,
pUnkOuter);
}
......@@ -252,7 +262,9 @@ IDirectDrawImpl_DuplicateSurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE pSrc,
pSrc),
&pDst7);
*ppDst = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
/* This coercion is safe, since the IDirectDrawSurface3 vtable has the
* IDirectDrawSurface vtable layout at the beginning */
*ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
IDirectDrawSurface3, pDst7);
return hr;
......@@ -274,7 +286,9 @@ IDirectDraw2Impl_DuplicateSurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE pSrc,
pSrc),
&pDst7);
*ppDst = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
/* This coercion is safe, since the IDirectDrawSurface3 vtable has the
* IDirectDrawSurface vtable layout at the beginning */
*ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
IDirectDrawSurface3, pDst7);
return hr;
......@@ -318,7 +332,7 @@ IDirectDrawImpl_EnumDisplayModes(LPDIRECTDRAW This, DWORD dwFlags,
IDirectDraw,
IDirectDraw7,
This),
dwFlags, pDDSD, &cbcontext,
dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
EnumDisplayModesCallbackThunk);
}
......@@ -333,7 +347,7 @@ IDirectDraw2Impl_EnumDisplayModes(LPDIRECTDRAW2 This, DWORD dwFlags,
IDirectDraw2,
IDirectDraw7,
This),
dwFlags, pDDSD, &cbcontext,
dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
EnumDisplayModesCallbackThunk);
}
......@@ -361,7 +375,10 @@ EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD,
{
struct surfacescallback_context *cbcontext = context;
return cbcontext->func(COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
/* This coercion is safe, since the IDirectDrawSurface3 vtable has the
* IDirectDrawSurface vtable layout at the beginning */
return cbcontext->func((LPDIRECTDRAWSURFACE)
COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
IDirectDrawSurface7,
IDirectDrawSurface3, pSurf),
(LPDDSURFACEDESC)pDDSD, cbcontext->context);
......@@ -527,7 +544,9 @@ IDirectDrawImpl_GetGDISurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE *ppSurf)
IDirectDraw7,
This), &pSurf7);
*ppSurf = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
/* This coercion is safe, since the IDirectDrawSurface3 vtable has the
* IDirectDrawSurface vtable layout at the beginning */
*ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
IDirectDrawSurface3, pSurf7);
return hr;
......@@ -544,7 +563,9 @@ IDirectDraw2Impl_GetGDISurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE *ppSurf)
IDirectDraw7,
This), &pSurf7);
*ppSurf = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
/* This coercion is safe, since the IDirectDrawSurface3 vtable has the
* IDirectDrawSurface vtable layout at the beginning */
*ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
IDirectDrawSurface3, pSurf7);
return hr;
......
......@@ -251,6 +251,8 @@ typedef struct {
} ddraw_driver;
void DDRAW_register_driver(const ddraw_driver*);
BOOL DDRAW_XVidMode_Init(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv);
BOOL DDRAW_XF86DGA2_Init(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv);
const ddraw_driver* DDRAW_FindDriver(const GUID* guid);
......
#ifndef __WINE_DDRAW_DGA2_PRIVATE_H
#define __WINE_DDRAW_DGA2_PRIVATE_H
#include "ddraw_private.h"
#include "x11_private.h"
#include "dga_private.h"
#include "ts_xf86dga.h"
#include "ts_xf86dga2.h"
extern ICOM_VTABLE(IDirectDrawSurface4) dga2_dds4vt;
extern ICOM_VTABLE(IDirectDraw) dga2_ddvt;
typedef struct dga2_dd_private {
/* Reuse of the DGA code */
dga_dd_private DGA;
XDGADevice *dev;
XDGAMode *modes;
int num_modes;
} dga2_dd_private;
typedef x11_dp_private dga2_dp_private; /* reuse X11 palette stuff */
typedef dga_ds_private dga2_ds_private; /* reuse of DGA1 surface stuff */
extern void _DGA2_Initialize_FrameBuffer(IDirectDrawImpl *This, int mode);
#endif /* __WINE_DDRAW_DGA2_PRIVATE_H */
#ifndef __WINE_DDRAW_DGA_PRIVATE_H
#define __WINE_DDRAW_DGA_PRIVATE_H
#include "ddraw_private.h"
#include "x11_private.h"
#include "ts_xf86dga.h"
extern ICOM_VTABLE(IDirectDrawSurface4) dga_dds4vt;
extern ICOM_VTABLE(IDirectDraw) dga_ddvt;
extern ICOM_VTABLE(IDirectDrawPalette) dga_ddpalvt;
typedef struct dga_dd_private {
DWORD fb_height; /* height of the viewport */
DWORD fb_width; /* width of the viewport */
caddr_t fb_addr; /* start address of the framebuffer */
DWORD fb_memsize; /* total memory on the card */
DWORD vpmask; /* viewports in use flag bitmap */
void (*InstallColormap)(Display *, int, Colormap) ;
} dga_dd_private;
typedef x11_dp_private dga_dp_private; /* reuse X11 palette stuff */
typedef struct dga_ds_private {
DWORD fb_height;
int *oldDIBmap;
} dga_ds_private;
/* For usage in DGA2 */
extern ULONG WINAPI DGA_IDirectDrawSurface4Impl_Release(LPDIRECTDRAWSURFACE4 iface) ;
extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_SetPalette(LPDIRECTDRAWSURFACE4 iface,LPDIRECTDRAWPALETTE pal) ;
extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_Unlock(LPDIRECTDRAWSURFACE4 iface,LPVOID surface) ;
extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_GetDC(LPDIRECTDRAWSURFACE4 iface,HDC* lphdc);
extern HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_with_VT(LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsd,
LPDIRECTDRAWSURFACE *lpdsf,IUnknown *lpunk, void *vtable) ;
extern HRESULT WINAPI DGA_IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 iface,REFIID refiid,LPVOID *obj) ;
extern HRESULT WINAPI DGA_IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 iface,LPDDCAPS caps1,LPDDCAPS caps2) ;
extern HRESULT WINAPI DGA_IDirectDraw2Impl_GetDisplayMode(LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsfd) ;
extern HRESULT WINAPI DGA_IDirectDraw2Impl_GetAvailableVidMem(LPDIRECTDRAW2 iface,LPDDSCAPS ddscaps,LPDWORD total,LPDWORD free) ;
#endif /* __WINE_DDRAW_DGA_PRIVATE_H */
......@@ -246,10 +246,10 @@ Main_DirectDrawSurface_ChangeUniquenessValue(LPDIRECTDRAWSURFACE7 iface)
if (old_uniqueness_value == 0) break;
if (new_uniqueness_value == 0) new_uniqueness_value = 1;
if (InterlockedCompareExchange(&vThis->uniqueness_value,
old_uniqueness_value,
new_uniqueness_value)
== old_uniqueness_value)
if (InterlockedCompareExchange((PVOID*)&vThis->uniqueness_value,
(PVOID)old_uniqueness_value,
(PVOID)new_uniqueness_value)
== (PVOID)old_uniqueness_value)
break;
}
......@@ -356,7 +356,7 @@ Main_DirectDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface,
/* XXX I don't think this algorithm works for more than 1 backbuffer. */
if (override == NULL)
{
static const DDSCAPS2 back_caps = { DDSCAPS_BACKBUFFER };
static DDSCAPS2 back_caps = { DDSCAPS_BACKBUFFER };
LPDIRECTDRAWSURFACE7 tgt;
hr = IDirectDrawSurface7_GetAttachedSurface(iface, &back_caps, &tgt);
......
......@@ -110,7 +110,9 @@ EnumCallback(LPDIRECTDRAWSURFACE7 iface, LPDDSURFACEDESC2 pDDSD,
DDRAW_Convert_DDSURFACEDESC_2_To_1(pDDSD, &ddsd);
#endif
return info->callback((LPDIRECTDRAWSURFACE)CONVERT_REV(iface), pDDSD,
/* the LPDDSURFACEDESC2 -> LPDDSURFACEDESC coercion is safe, since
* the data format is compatible with older enum procs */
return info->callback((LPDIRECTDRAWSURFACE)CONVERT_REV(iface), (LPDDSURFACEDESC)pDDSD,
info->context);
}
......
......@@ -328,13 +328,14 @@ static void User_destroy_own_window(IDirectDrawSurfaceImpl* This)
{
USER_PRIV_VAR(priv, This);
if (This->ddraw_owner->cooperative_level & DDSCL_FULLSCREEN)
if (priv->user.window)
{
SetWindowPos(priv->user.window, 0, 0, 0, 0, 0,
SWP_DEFERERASE|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOZORDER|
SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOSIZE|SWP_HIDEWINDOW);
DestroyWindow(priv->user.window);
DirectDrawSurface_UnregisterClass();
priv->user.window = 0;
}
}
#endif
......
......@@ -63,7 +63,8 @@ static LRESULT WINAPI DirectDrawSurface_WndProc(HWND hwnd, UINT msg, WPARAM wPar
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC dc = BeginPaint(hwnd, &ps);
HDC dc;
dc = BeginPaint(hwnd, &ps);
/* call User_copy_to_screen? */
EndPaint(hwnd, &ps);
ret = 0;
......
......@@ -18,7 +18,6 @@
#include "debugtools.h"
#include "heap.h"
#include "initguid.h"
#include "ddraw.h"
#include "d3d.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment