minor os/2 clean-ups.

This commit is contained in:
Ozkan Sezer 2022-03-10 18:50:10 +03:00
parent 50575aa184
commit afb0606f5a
4 changed files with 19 additions and 14 deletions

View File

@ -67,10 +67,12 @@ OS2VIDEOOUTPUT voDive = {
static BOOL voQueryInfo(VIDEOOUTPUTINFO *pInfo) static BOOL voQueryInfo(VIDEOOUTPUTINFO *pInfo)
{ {
DIVE_CAPS sDiveCaps = { 0 }; DIVE_CAPS sDiveCaps;
FOURCC fccFormats[100] = { 0 }; FOURCC fccFormats[100];
/* Query information about display hardware from DIVE. */ /* Query information about display hardware from DIVE. */
SDL_zeroa(fccFormats);
SDL_zero(sDiveCaps);
sDiveCaps.pFormatData = fccFormats; sDiveCaps.pFormatData = fccFormats;
sDiveCaps.ulFormatLength = 100; sDiveCaps.ulFormatLength = 100;
sDiveCaps.ulStructLen = sizeof(DIVE_CAPS); sDiveCaps.ulStructLen = sizeof(DIVE_CAPS);
@ -172,7 +174,7 @@ static BOOL voSetVisibleRegion(PVODATA pVOData, HWND hwnd,
/* Setup DIVE blitter. */ /* Setup DIVE blitter. */
SETUP_BLITTER sSetupBlitter; SETUP_BLITTER sSetupBlitter;
SWP swp; SWP swp;
POINTL pointl = { 0 }; POINTL pointl = { 0,0 };
WinQueryWindowPos(hwnd, &swp); WinQueryWindowPos(hwnd, &swp);
WinMapWindowPoints(hwnd, HWND_DESKTOP, &pointl, 1); WinMapWindowPoints(hwnd, HWND_DESKTOP, &pointl, 1);

View File

@ -27,8 +27,8 @@
HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY) HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY)
{ {
HBITMAP hbm; HBITMAP hbm;
BITMAPINFOHEADER2 bmih = { 0 }; BITMAPINFOHEADER2 bmih;
BITMAPINFO bmi = { 0 }; BITMAPINFO bmi;
HPS hps; HPS hps;
PULONG pulBitmap; PULONG pulBitmap;
PULONG pulDst, pulSrc, pulDstMask; PULONG pulDst, pulSrc, pulDstMask;
@ -40,7 +40,7 @@ HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY)
return NULLHANDLE; return NULLHANDLE;
} }
pulBitmap = SDL_malloc(surface->h * surface->w * 4 * 2); pulBitmap = (PULONG) SDL_malloc(surface->h * surface->w * 2 * sizeof(ULONG));
if (pulBitmap == NULL) { if (pulBitmap == NULL) {
SDL_OutOfMemory(); SDL_OutOfMemory();
return NULLHANDLE; return NULLHANDLE;
@ -72,6 +72,9 @@ HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY)
} }
/* Create system bitmap object. */ /* Create system bitmap object. */
SDL_zero(bmih);
SDL_zero(bmi);
bmih.cbFix = sizeof(BITMAPINFOHEADER2); bmih.cbFix = sizeof(BITMAPINFOHEADER2);
bmih.cx = surface->w; bmih.cx = surface->w;
bmih.cy = 2 * surface->h; bmih.cy = 2 * surface->h;

View File

@ -335,7 +335,7 @@ static VOID _wmChar(WINDATA *pWinData, MPARAM mp1, MPARAM mp2)
static VOID _wmMove(WINDATA *pWinData) static VOID _wmMove(WINDATA *pWinData)
{ {
SDL_DisplayMode *pSDLDisplayMode = _getDisplayModeForSDLWindow(pWinData->window); SDL_DisplayMode *pSDLDisplayMode = _getDisplayModeForSDLWindow(pWinData->window);
POINTL pointl = { 0 }; POINTL pointl = { 0,0 };
RECTL rectl; RECTL rectl;
WinQueryWindowRect(pWinData->hwnd, &rectl); WinQueryWindowRect(pWinData->hwnd, &rectl);
@ -1219,7 +1219,7 @@ static int OS2_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape,
{ {
SDL_ShapeTree *pShapeTree; SDL_ShapeTree *pShapeTree;
WINDATA *pWinData; WINDATA *pWinData;
SHAPERECTS stShapeRects = { 0 }; SHAPERECTS stShapeRects;
HPS hps; HPS hps;
debug_os2("Enter"); debug_os2("Enter");
@ -1235,6 +1235,7 @@ static int OS2_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape,
pShapeTree = SDL_CalculateShapeTree(*shape_mode, shape); pShapeTree = SDL_CalculateShapeTree(*shape_mode, shape);
shaper->driverdata = pShapeTree; shaper->driverdata = pShapeTree;
SDL_zero(stShapeRects);
stShapeRects.ulWinHeight = shaper->window->h; stShapeRects.ulWinHeight = shaper->window->h;
SDL_TraverseShapeTree(pShapeTree, &_combineRectRegions, &stShapeRects); SDL_TraverseShapeTree(pShapeTree, &_combineRectRegions, &stShapeRects);

View File

@ -91,10 +91,10 @@ static VOID APIENTRY ExitVMan(VOID)
static BOOL _vmanInit(void) static BOOL _vmanInit(void)
{ {
ULONG ulRC; ULONG ulRC;
CHAR acBuf[255]; CHAR acBuf[256];
INITPROCOUT stInitProcOut; INITPROCOUT stInitProcOut;
if (hmodVMan != NULLHANDLE) /* Already was initialized */ if (hmodVMan != NULLHANDLE) /* already initialized */
return TRUE; return TRUE;
/* Load vman.dll */ /* Load vman.dll */
@ -108,8 +108,7 @@ static BOOL _vmanInit(void)
/* Get VMIEntry */ /* Get VMIEntry */
ulRC = DosQueryProcAddr(hmodVMan, 0L, "VMIEntry", (PFN *)&pfnVMIEntry); ulRC = DosQueryProcAddr(hmodVMan, 0L, "VMIEntry", (PFN *)&pfnVMIEntry);
if (ulRC != NO_ERROR) { if (ulRC != NO_ERROR) {
debug_os2("Could not query address of pfnVMIEntry func. of VMAN.DLL, " debug_os2("Could not query address of VMIEntry from VMAN.DLL (Err: %lu)", ulRC);
"rc = %u", ulRC);
DosFreeModule(hmodVMan); DosFreeModule(hmodVMan);
hmodVMan = NULLHANDLE; hmodVMan = NULLHANDLE;
return FALSE; return FALSE;
@ -327,9 +326,8 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects,
PPOINTL pptlSrcOrg; PPOINTL pptlSrcOrg;
PBLTRECT pbrDst; PBLTRECT pbrDst;
HWREQIN sHWReqIn; HWREQIN sHWReqIn;
BITBLTINFO sBitbltInfo = { 0 }; BITBLTINFO sBitbltInfo;
ULONG ulIdx; ULONG ulIdx;
/* RECTL rectlScreenUpdate;*/
if (pVOData->pBuffer == NULL) if (pVOData->pBuffer == NULL)
return FALSE; return FALSE;
@ -454,6 +452,7 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects,
rclSrcBounds.xRight = bmiSrc.ulWidth; rclSrcBounds.xRight = bmiSrc.ulWidth;
rclSrcBounds.yTop = bmiSrc.ulHeight; rclSrcBounds.yTop = bmiSrc.ulHeight;
SDL_zero(sBitbltInfo);
sBitbltInfo.ulLength = sizeof(BITBLTINFO); sBitbltInfo.ulLength = sizeof(BITBLTINFO);
sBitbltInfo.ulBltFlags = BF_DEFAULT_STATE | BF_ROP_INCL_SRC | BF_PAT_HOLLOW; sBitbltInfo.ulBltFlags = BF_DEFAULT_STATE | BF_ROP_INCL_SRC | BF_PAT_HOLLOW;
sBitbltInfo.cBlits = cSDLRects; sBitbltInfo.cBlits = cSDLRects;