2009-10-26 15:29 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/contrib/hbqt/qtcore/QLocale.cpp
  * harbour/contrib/hbqt/qtcore/QByteArray.cpp
    ! fixed casting for 64bit builds - in all 64bit builds except Win64
      LONG is 64bit integer and HB_LONG is declared as LONG not LONGLONG

  * harbour/contrib/hbwin/win_dll.c
    % minor optimization
    * removed unnecessary casting
This commit is contained in:
Przemyslaw Czerpak
2009-10-26 14:29:12 +00:00
parent b27ce56c5e
commit 07671ae2f3
4 changed files with 31 additions and 18 deletions

View File

@@ -17,6 +17,16 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-10-26 15:29 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbqt/qtcore/QLocale.cpp
* harbour/contrib/hbqt/qtcore/QByteArray.cpp
! fixed casting for 64bit builds - in all 64bit builds except Win64
LONG is 64bit integer and HB_LONG is declared as LONG not LONGLONG
* harbour/contrib/hbwin/win_dll.c
% minor optimization
* removed unnecessary casting
2009-10-26 14:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* src/vm/maindllp.c
! Using hb_getProcAddress() instead of GetProcAddress().

View File

@@ -684,7 +684,7 @@ HB_FUNC( QT_QBYTEARRAY_SETNUM_3 )
*/
HB_FUNC( QT_QBYTEARRAY_SETNUM_4 )
{
hb_retptrGC( hbqt_ptrTOgcpointer( new QByteArray( hbqt_par_QByteArray( 1 )->setNum( hb_parnint( 2 ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : 10 ) ) ), release_QByteArray ) );
hb_retptrGC( hbqt_ptrTOgcpointer( new QByteArray( hbqt_par_QByteArray( 1 )->setNum( ( qulonglong ) hb_parnint( 2 ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : 10 ) ) ), release_QByteArray ) );
}
/*
@@ -692,7 +692,7 @@ HB_FUNC( QT_QBYTEARRAY_SETNUM_4 )
*/
HB_FUNC( QT_QBYTEARRAY_SETNUM_5 )
{
hb_retptrGC( hbqt_ptrTOgcpointer( new QByteArray( hbqt_par_QByteArray( 1 )->setNum( hb_parnint( 2 ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : 10 ) ) ), release_QByteArray ) );
hb_retptrGC( hbqt_ptrTOgcpointer( new QByteArray( hbqt_par_QByteArray( 1 )->setNum( ( qulonglong ) hb_parnint( 2 ), ( HB_ISNUM( 3 ) ? hb_parni( 3 ) : 10 ) ) ), release_QByteArray ) );
}
/*

View File

@@ -347,7 +347,7 @@ HB_FUNC( QT_QLOCALE_TOSHORT )
*/
HB_FUNC( QT_QLOCALE_TOSTRING )
{
hb_retc( hbqt_par_QLocale( 1 )->toString( hb_parnint( 2 ) ).toAscii().data() );
hb_retc( hbqt_par_QLocale( 1 )->toString( ( qulonglong ) hb_parnint( 2 ) ).toAscii().data() );
}
/*
@@ -403,7 +403,7 @@ HB_FUNC( QT_QLOCALE_TOSTRING_6 )
*/
HB_FUNC( QT_QLOCALE_TOSTRING_7 )
{
hb_retc( hbqt_par_QLocale( 1 )->toString( hb_parnint( 2 ) ).toAscii().data() );
hb_retc( hbqt_par_QLocale( 1 )->toString( ( qulonglong ) hb_parnint( 2 ) ).toAscii().data() );
}
/*

View File

@@ -743,13 +743,13 @@ static LPVOID hb_getprocaddress( HMODULE hDLL, int iProc )
HB_SYMBOL_UNUSED( iProc );
return NULL;
#else
LPVOID lpFunction = ( LPVOID ) GetProcAddress( hDLL, HB_ISCHAR( iProc ) ? ( LPCSTR ) hb_parc( iProc ) : ( LPCSTR ) ( HB_PTRDIFF ) hb_parnint( iProc ) );
const char * szProc = hb_parc( iProc );
LPVOID lpFunction = ( LPVOID ) GetProcAddress( hDLL, szProc ? szProc : ( LPCSTR ) ( HB_PTRDIFF ) hb_parnint( iProc ) );
if( ! lpFunction && HB_ISCHAR( iProc ) ) /* try with ANSI suffix? */
if( ! lpFunction && szProc ) /* try with ANSI suffix? */
{
char * pszFuncName = ( char * ) hb_xgrab( hb_parclen( iProc ) + 2 );
hb_strncpy( pszFuncName, hb_parc( iProc ), hb_parclen( iProc ) );
lpFunction = ( LPVOID ) GetProcAddress( hDLL, hb_strncat( pszFuncName, "A", hb_parclen( iProc ) + 1 ) );
char * pszFuncName = hb_xstrcpy( NULL, szProc, "A", NULL );
lpFunction = ( LPVOID ) GetProcAddress( hDLL, pszFuncName );
hb_xfree( pszFuncName );
}
@@ -761,7 +761,7 @@ HB_FUNC( LOADLIBRARY )
{
LPTSTR lpName = HB_TCHAR_CONVTO( hb_parcx( 1 ) );
hb_retnint( ( HB_PTRDIFF ) LoadLibrary( ( LPCTSTR ) lpName ) );
hb_retnint( ( HB_PTRDIFF ) LoadLibrary( lpName ) );
HB_TCHAR_FREE( lpName );
}
@@ -812,7 +812,7 @@ HB_FUNC( DLLCALL )
{
LPTSTR lpName = HB_TCHAR_CONVTO( hb_parcx( 1 ) );
hDLL = LoadLibrary( ( LPCTSTR ) lpName );
hDLL = LoadLibrary( lpName );
HB_TCHAR_FREE( lpName );
}
@@ -836,11 +836,11 @@ HB_FUNC( DLLPREPARECALL )
if( HB_ISCHAR( 1 ) )
{
LPTSTR lpName = HB_TCHAR_CONVTO( hb_parc( 1 ) );
LPTSTR lpName;
xec->cDLL = hb_strdup( hb_parc( 1 ) );
xec->hDLL = LoadLibrary( ( LPCTSTR ) lpName );
lpName = HB_TCHAR_CONVTO( xec->cDLL );
xec->hDLL = LoadLibrary( lpName );
HB_TCHAR_FREE( lpName );
}
else if( HB_ISPOINTER( 1 ) )
@@ -850,18 +850,21 @@ HB_FUNC( DLLPREPARECALL )
if( xec->hDLL )
{
ULONG ulLen = 0;
if( HB_ISCHAR( 3 ) )
{
xec->cProc = ( char * ) hb_xgrab( hb_parclen( 3 ) + 2 ); /* Reserving space for possible ANSI "A" suffix. */
hb_strncpy( xec->cProc, hb_parc( 3 ), hb_parclen( 3 ) );
ulLen = hb_parclen( 3 ) + 1;
xec->cProc = ( char * ) hb_xgrab( ulLen + 1 ); /* Reserving space for possible ANSI "A" suffix. */
hb_strncpy( xec->cProc, hb_parc( 3 ), ulLen );
}
else if( HB_ISNUM( 3 ) )
xec->wOrdinal = ( WORD ) hb_parni( 3 );
xec->lpFunc = ( LPVOID ) GetProcAddress( xec->hDLL, xec->cProc ? ( LPCSTR ) xec->cProc : ( LPCSTR ) ( HB_PTRDIFF ) xec->wOrdinal );
xec->lpFunc = ( LPVOID ) GetProcAddress( xec->hDLL, xec->cProc ? xec->cProc : ( LPCSTR ) ( HB_PTRDIFF ) xec->wOrdinal );
if( ! xec->lpFunc && xec->cProc ) /* try with ANSI suffix? */
xec->lpFunc = ( LPVOID ) GetProcAddress( xec->hDLL, ( LPCSTR ) hb_strncat( xec->cProc, "A", hb_parclen( 3 ) + 1 ) );
xec->lpFunc = ( LPVOID ) GetProcAddress( xec->hDLL, hb_strncat( xec->cProc, "A", ulLen ) );
if( xec->lpFunc )
{