2008-08-25 16:01 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/vm/macro.c
  * harbour/source/vm/hvm.c
    ! fixed _FIELD indirectly used as alias, f.e.:
         ? ("_FIELD")->NAME
      or:
         M->var := "_FIELD"
         ? ("&var")->NAME

  * harbour/include/hbclass.ch
  * harbour/include/common.ch
    * use a little bit simpler form for HB_SYMBOL_UNUSED()

  * harbour/contrib/hbw32/w32_ole.c
  * harbour/contrib/hbole/ole2.c
    ! fixed numeric to pointer casting
    * accept both pointer and numeric values as window handle
      for easier code migration
This commit is contained in:
Przemyslaw Czerpak
2008-08-25 14:02:59 +00:00
parent d1b94f5e7e
commit c9fde7451a
7 changed files with 41 additions and 10 deletions

View File

@@ -8,6 +8,25 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-08-25 16:01 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/macro.c
* harbour/source/vm/hvm.c
! fixed _FIELD indirectly used as alias, f.e.:
? ("_FIELD")->NAME
or:
M->var := "_FIELD"
? ("&var")->NAME
* harbour/include/hbclass.ch
* harbour/include/common.ch
* use a little bit simpler form for HB_SYMBOL_UNUSED()
* harbour/contrib/hbw32/w32_ole.c
* harbour/contrib/hbole/ole2.c
! fixed numeric to pointer casting
* accept both pointer and numeric values as window handle
for easier code migration
2008-08-25 14:46 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/vm/cmdarg.c
! hb_hInstance, hb_hPrevInstance, s_iCmdShow, s_WinMainParam

View File

@@ -644,7 +644,9 @@ HB_FUNC( MESSAGEBOX )
{
LPTSTR lpStr1 = HB_TCHAR_CONVTO( hb_parcx( 2 ) );
LPTSTR lpStr2 = HB_TCHAR_CONVTO( hb_parcx( 3 ) );
hb_retni( MessageBox( ( HWND ) hb_parnint( 1 ), lpStr1, lpStr2, hb_parni( 4 ) ) );
HWND hWnd = ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) :
( HWND ) hb_parptr( 1 );
hb_retni( MessageBox( hWnd, lpStr1, lpStr2, hb_parni( 4 ) ) );
HB_TCHAR_FREE( lpStr1 );
HB_TCHAR_FREE( lpStr2 );
}

View File

@@ -1370,7 +1370,9 @@ HB_FUNC( MESSAGEBOX )
{
LPTSTR lpStr1 = HB_TCHAR_CONVTO( hb_parcx( 2 ) );
LPTSTR lpStr2 = HB_TCHAR_CONVTO( hb_parcx( 3 ) );
hb_retni( MessageBox( ( HWND ) hb_parnint( 1 ), lpStr1, lpStr2, hb_parni( 4 ) ) );
HWND hWnd = ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) :
( HWND ) hb_parptr( 1 );
hb_retni( MessageBox( hWnd, lpStr1, lpStr2, hb_parni( 4 ) ) );
HB_TCHAR_FREE( lpStr1 );
HB_TCHAR_FREE( lpStr2 );
}

View File

@@ -82,7 +82,7 @@
optimized out by the compiler, so it won't cause any overhead.
It can be used in codeblocks, too. */
/* Please keep it synced with the similar #define in hbclass.ch */
#define HB_SYMBOL_UNUSED( symbol ) ( symbol := ( symbol ) )
#define HB_SYMBOL_UNUSED( symbol ) ( ( symbol ) )
/* HASH autoadd options */
#define HB_HAUTOADD_NEVER 0x00

View File

@@ -207,7 +207,7 @@
#endif
/* Please keep it synced with the similar #define in common.ch */
#define __HB_CLS_SYMBOL_UNUSED( symbol ) ( symbol := ( symbol ) )
#define __HB_CLS_SYMBOL_UNUSED( symbol ) ( ( symbol ) )
#xtranslate __HB_CLS_VARERR(<var>) => __HB_CLS_ERR( Invalid instance variable name: <var> )

View File

@@ -5772,8 +5772,10 @@ static void hb_vmPushAliasedVar( PHB_SYMB pSym )
}
}
else if( pAlias->item.asString.length >= 4 &&
hb_strnicmp( szAlias, "FIELD", /* FIELD-> or FIEL-> */
pAlias->item.asString.length ) == 0 )
( hb_strnicmp( szAlias, "FIELD", /* FIELD-> or FIEL-> */
pAlias->item.asString.length ) == 0 ||
hb_strnicmp( szAlias, "_FIELD", /* _FIELD-> or _FIE-> */
pAlias->item.asString.length ) == 0 ) )
{
hb_rddGetFieldValue( pAlias, pSym );
return;
@@ -6073,8 +6075,10 @@ static void hb_vmPopAliasedVar( PHB_SYMB pSym )
}
}
else if( pAlias->item.asString.length >= 4 &&
hb_strnicmp( szAlias, "FIELD", /* FIELD-> or FIEL-> */
pAlias->item.asString.length ) == 0 )
( hb_strnicmp( szAlias, "FIELD", /* FIELD-> or FIEL-> */
pAlias->item.asString.length ) == 0 ||
hb_strnicmp( szAlias, "_FIELD", /* _FIELD-> or _FIE-> */
pAlias->item.asString.length ) == 0 ) )
{
hb_rddPutFieldValue( hb_stackItemFromTop( -2 ), pSym );
hb_stackPop(); /* alias */

View File

@@ -1281,7 +1281,9 @@ void hb_macroGenPopAliasedVar( char * szVarName,
/* TODO: memvars created inside TYPE() function should have PUBLIC scope */
hb_macroMemvarGenPCode( HB_P_MPOPMEMVAR, szVarName, HB_COMP_PARAM );
}
else if( iLen >= 4 && iLen <= 5 && strncmp( szAlias, "FIELD", iLen ) == 0 )
else if( iLen >= 4 && iLen <= 6 &&
( strncmp( szAlias, "FIELD", iLen ) == 0 ||
strncmp( szAlias, "_FIELD", iLen ) == 0 ) )
{ /* FIELD-> */
hb_macroMemvarGenPCode( HB_P_MPOPFIELD, szVarName, HB_COMP_PARAM );
}
@@ -1374,7 +1376,9 @@ void hb_macroGenPushAliasedVar( char * szVarName,
{ /* M-> or MEMV-> or MEMVA-> or MEMVAR-> variable */
hb_macroMemvarGenPCode( HB_P_MPUSHMEMVAR, szVarName, HB_COMP_PARAM );
}
else if( iLen >= 4 && iLen <= 5 && strncmp( szAlias, "FIELD", iLen ) == 0 )
else if( iLen >= 4 && iLen <= 6 &&
( strncmp( szAlias, "FIELD", iLen ) == 0 ||
strncmp( szAlias, "_FIELD", iLen ) == 0 ) )
{ /* FIELD-> */
hb_macroMemvarGenPCode( HB_P_MPUSHFIELD, szVarName, HB_COMP_PARAM );
}