os2: several warning fixes.

mostly those "W007: '&array' may not produce intended result" warnings
from Watcom, visible only in C++ mode.  one or two others here & there.
This commit is contained in:
Ozkan Sezer
2020-10-14 23:01:02 +03:00
parent f9af19f51d
commit aa790837eb
10 changed files with 49 additions and 55 deletions

View File

@@ -72,7 +72,7 @@ static BOOL voQueryInfo(PVIDEOOUTPUTINFO pInfo)
// Query information about display hardware from DIVE.
sDiveCaps.pFormatData = &fccFormats;
sDiveCaps.pFormatData = fccFormats;
sDiveCaps.ulFormatLength = 100;
sDiveCaps.ulStructLen = sizeof(DIVE_CAPS);

View File

@@ -68,10 +68,10 @@ static VOID _wmInitDlg(HWND hwnd, PMSGBOXDLGDATA pDlgData)
while( ( hWndNext = WinGetNextWindow( hEnum ) ) != NULLHANDLE )
{
if ( WinQueryClassName( hWndNext, sizeof(acBuf), &acBuf ) == 0 )
if ( WinQueryClassName( hWndNext, sizeof(acBuf), acBuf ) == 0 )
continue;
if ( strcmp( &acBuf, "#3" ) == 0 ) // Class name of button.
if ( strcmp( acBuf, "#3" ) == 0 ) // Class name of button.
{
if ( cButtons < sizeof(aButtons) / sizeof(struct _BUTTON) )
{
@@ -91,8 +91,8 @@ static VOID _wmInitDlg(HWND hwnd, PMSGBOXDLGDATA pDlgData)
for( ulIdx = 0; ulIdx < cButtons; ulIdx++ )
{
// Query size of text in window coordinates.
cbBuf = WinQueryWindowText( aButtons[ulIdx].hwnd, sizeof(acBuf), &acBuf );
GpiQueryTextBox( hps, cbBuf, acBuf, TXTBOX_COUNT, &aptText );
cbBuf = WinQueryWindowText( aButtons[ulIdx].hwnd, sizeof(acBuf), acBuf );
GpiQueryTextBox( hps, cbBuf, acBuf, TXTBOX_COUNT, aptText );
aptText[TXTBOX_TOPRIGHT].x -= aptText[TXTBOX_BOTTOMLEFT].x;
aptText[TXTBOX_TOPRIGHT].y -= aptText[TXTBOX_BOTTOMLEFT].y;
// Convert text size to dialog coordinates.
@@ -154,7 +154,7 @@ static VOID _wmInitDlg(HWND hwnd, PMSGBOXDLGDATA pDlgData)
aptText[1].x = aButtons[ulIdx].ulCX;
aptText[1].y = ulButtonsCY;
// Convert to window coordinates.
WinMapDlgPoints( hwnd, &aptText, 2, TRUE );
WinMapDlgPoints( hwnd, aptText, 2, TRUE );
WinSetWindowPos( aButtons[ulIdx].hwnd, HWND_TOP,
aptText[0].x, aptText[0].y, aptText[1].x, aptText[1].y,
@@ -229,10 +229,8 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
PSZ pszBtnText;
ULONG cbBtnText;
HWND hwnd;
SDL_MessageBoxColor *pSDLColors = messageboxdata->colorScheme == NULL
? NULL
: (SDL_MessageBoxColor *)&messageboxdata->colorScheme->colors;
SDL_MessageBoxColor *pSDLColor;
const SDL_MessageBoxColor *pSDLColors = (messageboxdata->colorScheme == NULL)? NULL : messageboxdata->colorScheme->colors;
const SDL_MessageBoxColor *pSDLColor;
MSGBOXDLGDATA stDlgData;
/* Build a dialog tamplate in memory */
@@ -256,7 +254,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
( 48 * cSDLBtnData ); /* PP for buttons. */
// Allocate memory for the dialog template.
pTemplate = SDL_malloc( cbTemplate );
pTemplate = (PDLGTEMPLATE) SDL_malloc( cbTemplate );
// Pointer on data for dialog items in allocated memory.
pcDlgData = &((PCHAR)pTemplate)[ sizeof(DLGTEMPLATE) +
( (2 + cSDLBtnData) * sizeof(DLGTITEM) ) ];
@@ -276,7 +274,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
/* First item info - frame */
pDlgItem = &pTemplate->adlgti;
pDlgItem = pTemplate->adlgti;
pDlgItem->fsItemStatus = 0; /* Reserved? */
/* Number of dialog item child windows owned by this item. */
pDlgItem->cChildren = 2 + cSDLBtnData; // Ststic text + buttons.

View File

@@ -330,9 +330,9 @@ static VOID _wmChar(PWINDATA pWinData, MPARAM mp1, MPARAM mp2)
if ( (ulFlags & KC_CHAR) != 0 )
{
CHAR acUTF8[4];
LONG lRC = StrUTF8( 1, &acUTF8, sizeof(acUTF8), (PSZ)&ulCharCode, 1 );
LONG lRC = StrUTF8( 1, acUTF8, sizeof(acUTF8), (PSZ)&ulCharCode, 1 );
SDL_SendKeyboardText( lRC > 0 ? &acUTF8 : (PSZ)&ulCharCode );
SDL_SendKeyboardText( lRC > 0 ? acUTF8 : (PSZ)&ulCharCode );
}
}
@@ -421,13 +421,13 @@ static MRESULT _wmDrop(PWINDATA pWinData, PDRAGINFO pDragInfo)
{
// Get file name from the item.
DrgQueryStrName( pDragItem->hstrContainerName,
sizeof(acFName), &acFName );
pcFName = strchr( &acFName, '\0' );
sizeof(acFName), acFName );
pcFName = strchr( acFName, '\0' );
DrgQueryStrName( pDragItem->hstrSourceName,
sizeof(acFName) - (pcFName - &acFName), pcFName );
sizeof(acFName) - (pcFName - acFName), pcFName );
// Send to SDL full file name converted to UTF-8.
pcFName = OS2_SysToUTF8( &acFName );
pcFName = OS2_SysToUTF8( acFName );
SDL_SendDropFile( pcFName );
SDL_free( pcFName );
@@ -852,7 +852,7 @@ static int OS2_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
// Get client and frame window handles.
WinQueryClassName( hwndUser, sizeof(acBuf), acBuf );
if ( !WinQueryClassInfo( pVData->hab, &acBuf, &stCI ) )
if ( !WinQueryClassInfo( pVData->hab, acBuf, &stCI ) )
return SDL_SetError( "Cannot get user window class information" );
if ( (stCI.flClassStyle & CS_FRAME) == 0 )
@@ -879,7 +879,7 @@ static int OS2_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
hwndFrame = hwndUser;
WinQueryClassName( hwnd, sizeof(acBuf), acBuf );
if ( !WinQueryClassInfo( pVData->hab, &acBuf, &stCI ) )
if ( !WinQueryClassInfo( pVData->hab, acBuf, &stCI ) )
return SDL_SetError( "Cannot get client window class information" );
}

View File

@@ -103,7 +103,7 @@ static BOOL _vmanInit()
return TRUE;
// Load vman.dll
ulRC = DosLoadModule( &acBuf, sizeof(acBuf), "VMAN", &hmodVMan );
ulRC = DosLoadModule( acBuf, sizeof(acBuf), "VMAN", &hmodVMan );
if ( ulRC != NO_ERROR )
{
debug( "Could not load VMAN.DLL, rc = %u : %s", ulRC, &acBuf );