minor os/2 clean-ups.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
diff --git a/src/video/os2/SDL_os2dive.c b/src/video/os2/SDL_os2dive.c
index 52f1483..95aae6f 100644
--- a/src/video/os2/SDL_os2dive.c
+++ b/src/video/os2/SDL_os2dive.c
@@ -67,10 +67,12 @@ OS2VIDEOOUTPUT voDive = {
static BOOL voQueryInfo(VIDEOOUTPUTINFO *pInfo)
{
- DIVE_CAPS sDiveCaps = { 0 };
- FOURCC fccFormats[100] = { 0 };
+ DIVE_CAPS sDiveCaps;
+ FOURCC fccFormats[100];
/* Query information about display hardware from DIVE. */
+ SDL_zeroa(fccFormats);
+ SDL_zero(sDiveCaps);
sDiveCaps.pFormatData = fccFormats;
sDiveCaps.ulFormatLength = 100;
sDiveCaps.ulStructLen = sizeof(DIVE_CAPS);
@@ -172,7 +174,7 @@ static BOOL voSetVisibleRegion(PVODATA pVOData, HWND hwnd,
/* Setup DIVE blitter. */
SETUP_BLITTER sSetupBlitter;
SWP swp;
- POINTL pointl = { 0 };
+ POINTL pointl = { 0,0 };
WinQueryWindowPos(hwnd, &swp);
WinMapWindowPoints(hwnd, HWND_DESKTOP, &pointl, 1);
diff --git a/src/video/os2/SDL_os2util.c b/src/video/os2/SDL_os2util.c
index adc2fd5..bcc6c54 100644
--- a/src/video/os2/SDL_os2util.c
+++ b/src/video/os2/SDL_os2util.c
@@ -27,8 +27,8 @@
HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY)
{
HBITMAP hbm;
- BITMAPINFOHEADER2 bmih = { 0 };
- BITMAPINFO bmi = { 0 };
+ BITMAPINFOHEADER2 bmih;
+ BITMAPINFO bmi;
HPS hps;
PULONG pulBitmap;
PULONG pulDst, pulSrc, pulDstMask;
@@ -40,7 +40,7 @@ HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY)
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) {
SDL_OutOfMemory();
return NULLHANDLE;
@@ -72,6 +72,9 @@ HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY)
}
/* Create system bitmap object. */
+ SDL_zero(bmih);
+ SDL_zero(bmi);
+
bmih.cbFix = sizeof(BITMAPINFOHEADER2);
bmih.cx = surface->w;
bmih.cy = 2 * surface->h;
diff --git a/src/video/os2/SDL_os2video.c b/src/video/os2/SDL_os2video.c
index 6b9fcda..64731d7 100644
--- a/src/video/os2/SDL_os2video.c
+++ b/src/video/os2/SDL_os2video.c
@@ -335,7 +335,7 @@ static VOID _wmChar(WINDATA *pWinData, MPARAM mp1, MPARAM mp2)
static VOID _wmMove(WINDATA *pWinData)
{
SDL_DisplayMode *pSDLDisplayMode = _getDisplayModeForSDLWindow(pWinData->window);
- POINTL pointl = { 0 };
+ POINTL pointl = { 0,0 };
RECTL rectl;
WinQueryWindowRect(pWinData->hwnd, &rectl);
@@ -1219,7 +1219,7 @@ static int OS2_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape,
{
SDL_ShapeTree *pShapeTree;
WINDATA *pWinData;
- SHAPERECTS stShapeRects = { 0 };
+ SHAPERECTS stShapeRects;
HPS hps;
debug_os2("Enter");
@@ -1235,6 +1235,7 @@ static int OS2_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape,
pShapeTree = SDL_CalculateShapeTree(*shape_mode, shape);
shaper->driverdata = pShapeTree;
+ SDL_zero(stShapeRects);
stShapeRects.ulWinHeight = shaper->window->h;
SDL_TraverseShapeTree(pShapeTree, &_combineRectRegions, &stShapeRects);
diff --git a/src/video/os2/SDL_os2vman.c b/src/video/os2/SDL_os2vman.c
index 3fb93f1..acb9200 100644
--- a/src/video/os2/SDL_os2vman.c
+++ b/src/video/os2/SDL_os2vman.c
@@ -91,10 +91,10 @@ static VOID APIENTRY ExitVMan(VOID)
static BOOL _vmanInit(void)
{
ULONG ulRC;
- CHAR acBuf[255];
+ CHAR acBuf[256];
INITPROCOUT stInitProcOut;
- if (hmodVMan != NULLHANDLE) /* Already was initialized */
+ if (hmodVMan != NULLHANDLE) /* already initialized */
return TRUE;
/* Load vman.dll */
@@ -108,8 +108,7 @@ static BOOL _vmanInit(void)
/* Get VMIEntry */
ulRC = DosQueryProcAddr(hmodVMan, 0L, "VMIEntry", (PFN *)&pfnVMIEntry);
if (ulRC != NO_ERROR) {
- debug_os2("Could not query address of pfnVMIEntry func. of VMAN.DLL, "
- "rc = %u", ulRC);
+ debug_os2("Could not query address of VMIEntry from VMAN.DLL (Err: %lu)", ulRC);
DosFreeModule(hmodVMan);
hmodVMan = NULLHANDLE;
return FALSE;
@@ -327,9 +326,8 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects,
PPOINTL pptlSrcOrg;
PBLTRECT pbrDst;
HWREQIN sHWReqIn;
- BITBLTINFO sBitbltInfo = { 0 };
+ BITBLTINFO sBitbltInfo;
ULONG ulIdx;
-/* RECTL rectlScreenUpdate;*/
if (pVOData->pBuffer == NULL)
return FALSE;
@@ -454,6 +452,7 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects,
rclSrcBounds.xRight = bmiSrc.ulWidth;
rclSrcBounds.yTop = bmiSrc.ulHeight;
+ SDL_zero(sBitbltInfo);
sBitbltInfo.ulLength = sizeof(BITBLTINFO);
sBitbltInfo.ulBltFlags = BF_DEFAULT_STATE | BF_ROP_INCL_SRC | BF_PAT_HOLLOW;
sBitbltInfo.cBlits = cSDLRects;