2009-03-21 15:44 UTC+0100 Viktor Szakats (harbour.01 syenar hu)

* contrib/hbtpathy/tpwin.c
  * contrib/hbwin/win_regc.c
    ! mingw64 reported (64-bit) problems fixed.

  * contrib/hbwin/wapi_winbase.c
    ! mingw64 reported (64-bit) problem fixed.
    ! ISNIL() -> ISCHAR(). It appear many times, but using ISNIL()
      has the same cost IS<ACTUAL_TYPE>(), yet only covers one
      case, so it's very dangerous and leave potential GPFs when
      passing wrong type. So, when there is no strong special reason
      to use ISNIL() (like we really want to allow all types except NIL),
      always use ISCHAR(), ISNUM(), ISPOINTER(), ... instead.

  * ChangeLog
    - Deleted resolved mingw64 warnings from entry.
This commit is contained in:
Viktor Szakats
2009-03-21 14:54:29 +00:00
parent cc6096c71a
commit e686ad05b8
4 changed files with 36 additions and 67 deletions

View File

@@ -8,6 +8,23 @@
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2009-03-21 15:44 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* contrib/hbtpathy/tpwin.c
* contrib/hbwin/win_regc.c
! mingw64 reported (64-bit) problems fixed.
* contrib/hbwin/wapi_winbase.c
! mingw64 reported (64-bit) problem fixed.
! ISNIL() -> ISCHAR(). It appear many times, but using ISNIL()
has the same cost IS<ACTUAL_TYPE>(), yet only covers one
case, so it's very dangerous and leave potential GPFs when
passing wrong type. So, when there is no strong special reason
to use ISNIL() (like we really want to allow all types except NIL),
always use ISCHAR(), ISNUM(), ISPOINTER(), ... instead.
* ChangeLog
- Deleted resolved mingw64 warnings from entry.
2009-03-21 15:12 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* contrib/hbwin/win_dll.c
* contrib/hbwin/win_ole.c
@@ -91,57 +108,11 @@
../../getenvrn.c: In function 'HB_FUN_FT_GETE':
../../getenvrn.c:178: warning: implicit declaration of function 'GetEnvironmentStrings'
../../getenvrn.c:178: warning: initialization makes pointer from integer without a cast
../../tpwin.c: In function 'HB_FUN_P_INITPORTSPEED':
../../tpwin.c:78: warning: cast to pointer from integer of different size
../../tpwin.c:89: warning: cast to pointer from integer of different size
../../tpwin.c: In function 'HB_FUN_P_READPORT':
../../tpwin.c:108: warning: cast to pointer from integer of different size
../../tpwin.c: In function 'HB_FUN_P_WRITEPORT':
../../tpwin.c:119: warning: cast to pointer from integer of different size
../../win_dll.c: In function 'DllExec':
../../win_dll.c:509: warning: cast from pointer to integer of different size
../../win_dll.c:603: warning: cast to pointer from integer of different size
../../win_dll.c:672: warning: cast to pointer from integer of different size
../../win_dll.c:689: warning: cast to pointer from integer of different size
../../win_dll.c: In function 'hb_getprocaddress':
../../win_dll.c:809: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'hb_oleItemToVariant':
../../win_ole.c:466: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'FreeParams':
../../win_ole.c:762: warning: cast from pointer to integer of different size
../../win_ole.c: In function 'hb_oleVariantToItem':
../../win_ole.c:1092: warning: cast from pointer to integer of different size
../../win_ole.c: In function 'HB_FUN_CREATEOLEOBJECT':
../../win_ole.c:1425: warning: cast from pointer to integer of different size
../../win_ole.c: In function 'HB_FUN_GETOLEOBJECT':
../../win_ole.c:1478: warning: cast from pointer to integer of different size
../../win_ole.c: In function 'HB_FUN_OLEADDREF':
../../win_ole.c:1486: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'HB_FUN_OLERELEASEOBJECT':
../../win_ole.c:1498: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'HB_FUN_TOLEAUTO_OLEVALUE':
../../win_ole.c:1648: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'HB_FUN_TOLEAUTO__OLEVALUE':
../../win_ole.c:1675: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'HB_FUN_TOLEAUTO_OLENEWENUMERATOR':
../../win_ole.c:1703: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'HB_FUN_TOLEAUTO_INVOKE':
../../win_ole.c:1786: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'HB_FUN_TOLEAUTO_SET':
../../win_ole.c:1810: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'HB_FUN_TOLEAUTO_GET':
../../win_ole.c:1834: warning: cast to pointer from integer of different size
../../win_ole.c: In function 'HB_FUN_TOLEAUTO_ONERROR':
../../win_ole.c:1861: warning: cast to pointer from integer of different size
../../win_regc.c: In function 'hb_regkeyconv':
../../win_regc.c:77: warning: cast to pointer from integer of different size
../../win_regc.c: In function 'HB_FUN_WIN_REGCREATEKEYEX':
../../win_regc.c:82: warning: cast to pointer from integer of different size
../../win_regc.c:96: warning: cast from pointer to integer of different size
../../win_regc.c: In function 'HB_FUN_WIN_REGOPENKEYEX':
../../win_regc.c:118: warning: cast from pointer to integer of different size
../../win_regc.c: In function 'HB_FUN_WIN_REGCLOSEKEY':
../../win_regc.c:193: warning: cast to pointer from integer of different size
../../wapi_commctrl.c: In function 'HB_FUN_WAPI_TABCTRL_GETITEMRECT':
../../wapi_commctrl.c:521: warning: value computed is not used
../../wapi_commctrl.c: In function 'HB_FUN_WAPI_TABCTRL_GETIMAGELIST':

View File

@@ -75,7 +75,7 @@ HB_FUNC( P_INITPORTSPEED )
if( BuildCommDCB( lpValues, &dcb ) )
{
if( SetCommState( ( HANDLE ) hb_parnl( 1 ), &dcb ) )
if( SetCommState( ( HANDLE ) hb_parnint( 1 ), &dcb ) )
{
COMMTIMEOUTS timeouts;
@@ -86,7 +86,7 @@ HB_FUNC( P_INITPORTSPEED )
timeouts.WriteTotalTimeoutMultiplier = 0;
timeouts.WriteTotalTimeoutConstant = 0;
hb_retnl( SetCommTimeouts( ( HANDLE ) hb_parnl( 1 ), &timeouts ) ? 0 : -1 );
hb_retnl( SetCommTimeouts( ( HANDLE ) hb_parnint( 1 ), &timeouts ) ? 0 : -1 );
}
else
hb_retnl( -1 );
@@ -105,7 +105,7 @@ HB_FUNC( P_READPORT )
BOOL bRet;
memset( &Overlapped, 0, sizeof( OVERLAPPED ) );
bRet = ReadFile( ( HANDLE ) hb_parnl( 1 ), Buffer, sizeof( Buffer ), &nRead, &Overlapped );
bRet = ReadFile( ( HANDLE ) hb_parnint( 1 ), Buffer, sizeof( Buffer ), &nRead, &Overlapped );
hb_retclen( bRet ? Buffer : NULL, nRead );
}
@@ -116,7 +116,7 @@ HB_FUNC( P_WRITEPORT )
BOOL bRet;
memset( &Overlapped, 0, sizeof( OVERLAPPED ) );
bRet = WriteFile( ( HANDLE ) hb_parnl( 1 ), hb_parcx( 2 ), hb_parclen( 2 ), &nWritten, &Overlapped );
bRet = WriteFile( ( HANDLE ) hb_parnint( 1 ), hb_parcx( 2 ), hb_parclen( 2 ), &nWritten, &Overlapped );
hb_retnl( bRet ? ( long ) nWritten : -1 ); /* Put GetLastError() on error, or better a second byref param? */
}

View File

@@ -76,11 +76,11 @@ HB_FUNC( WAPI_GETCOMMANDLINE )
}
/*----------------------------------------------------------------------*/
/*
HMODULE WINAPI GetModuleHandle( __in_opt LPCTSTR lpModuleName );
HMODULE WINAPI GetModuleHandle( __in_opt LPCTSTR lpModuleName );
*/
HB_FUNC( WAPI_GETMODULEHANDLE )
{
LPTSTR lpModuleName = ( LPTSTR ) ISNIL( 1 ) ? 0 : HB_TCHAR_CONVTO( hb_parc( 1 ) );
LPTSTR lpModuleName = ISCHAR( 1 ) ? ( LPTSTR ) HB_TCHAR_CONVTO( hb_parc( 1 ) ) : ( LPTSTR ) NULL;
wapi_ret_HANDLE( GetModuleHandle( lpModuleName ) );
@@ -88,5 +88,3 @@ HB_FUNC( WAPI_GETMODULEHANDLE )
HB_TCHAR_FREE( lpModuleName );
}
/*----------------------------------------------------------------------*/

View File

@@ -55,7 +55,7 @@
#include "hbapi.h"
#include "hbapiitm.h"
static HKEY hb_regkeyconv( ULONG nKey )
static HKEY hb_regkeyconv( HB_PTRDIFF nKey )
{
switch( nKey )
{
@@ -79,11 +79,11 @@ static HKEY hb_regkeyconv( ULONG nKey )
HB_FUNC( WIN_REGCREATEKEYEX )
{
HKEY hWnd = ( HKEY ) hb_parnl( 8 );
HKEY hWnd = ( HKEY ) hb_parnint( 8 );
ULONG nResult = hb_parnl( 9 );
LPTSTR lpText = HB_TCHAR_CONVTO( hb_parc( 2 ) );
if( RegCreateKeyEx( hb_regkeyconv( hb_parnl( 1 ) ),
if( RegCreateKeyEx( hb_regkeyconv( ( HB_PTRDIFF ) hb_parnint( 1 ) ),
lpText,
0,
NULL,
@@ -93,7 +93,7 @@ HB_FUNC( WIN_REGCREATEKEYEX )
&hWnd,
&nResult ) == ERROR_SUCCESS )
{
hb_stornl( ( ULONG ) hWnd, 8 );
hb_stornint( ( HB_PTRDIFF ) hWnd, 8 );
hb_stornl( nResult, 9 );
hb_retnl( ERROR_SUCCESS );
@@ -109,13 +109,13 @@ HB_FUNC( WIN_REGOPENKEYEX )
HKEY hWnd;
LPTSTR lpText = HB_TCHAR_CONVTO( hb_parc( 2 ) );
if( RegOpenKeyEx( hb_regkeyconv( hb_parnl( 1 ) ),
if( RegOpenKeyEx( hb_regkeyconv( ( HB_PTRDIFF ) hb_parnint( 1 ) ),
lpText,
0,
hb_parnl( 4 ),
&hWnd ) == ERROR_SUCCESS )
{
hb_stornl( ( ULONG ) hWnd, 5 );
hb_stornint( ( HB_PTRDIFF ) hWnd, 5 );
hb_retnl( ERROR_SUCCESS );
}
else
@@ -130,7 +130,7 @@ HB_FUNC( WIN_REGQUERYVALUEEX )
DWORD nSize = 0;
LPTSTR lpKey = HB_TCHAR_CONVTO( hb_parc( 2 ) );
if( RegQueryValueEx( hb_regkeyconv( hb_parnl( 1 ) ),
if( RegQueryValueEx( hb_regkeyconv( ( HB_PTRDIFF ) hb_parnint( 1 ) ),
lpKey,
NULL,
&nType,
@@ -141,7 +141,7 @@ HB_FUNC( WIN_REGQUERYVALUEEX )
{
BYTE * cValue = ( BYTE * ) hb_xgrab( nSize + 1 );
RegQueryValueEx( hb_regkeyconv( hb_parnl( 1 ) ),
RegQueryValueEx( hb_regkeyconv( ( HB_PTRDIFF ) hb_parnint( 1 ) ),
lpKey,
NULL,
&nType,
@@ -161,13 +161,13 @@ HB_FUNC( WIN_REGQUERYVALUEEX )
HB_FUNC( WIN_REGSETVALUEEX )
{
DWORD nType = hb_parnl( 4 );
DWORD nType = ( DWORD ) hb_parnl( 4 );
LPTSTR lpKey = HB_TCHAR_CONVTO( hb_parc( 2 ) );
if( nType != REG_DWORD )
{
BYTE * cValue = ( BYTE * ) hb_parc( 5 );
hb_retni( RegSetValueEx( hb_regkeyconv( hb_parnl( 1 ) ),
hb_retni( RegSetValueEx( hb_regkeyconv( ( HB_PTRDIFF ) hb_parnint( 1 ) ),
lpKey,
0,
nType,
@@ -176,8 +176,8 @@ HB_FUNC( WIN_REGSETVALUEEX )
}
else
{
DWORD nSpace = hb_parnl( 5 );
hb_retni( RegSetValueEx( hb_regkeyconv( hb_parnl( 1 ) ),
DWORD nSpace = ( DWORD ) hb_parnl( 5 );
hb_retni( RegSetValueEx( hb_regkeyconv( ( HB_PTRDIFF ) hb_parnint( 1 ) ),
lpKey,
0,
nType,
@@ -190,5 +190,5 @@ HB_FUNC( WIN_REGSETVALUEEX )
HB_FUNC( WIN_REGCLOSEKEY )
{
hb_retnl( RegCloseKey( ( HKEY ) hb_parnl( 1 ) ) );
hb_retnl( RegCloseKey( ( HKEY ) hb_parnint( 1 ) ) );
}